Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
13cc2cfb
Commit
13cc2cfb
authored
Aug 26, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass in autopilot type
parent
bbdfdd90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
20 deletions
+4
-20
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+1
-1
QGCMAVLinkUASFactory.cc
src/uas/QGCMAVLinkUASFactory.cc
+2
-18
QGCMAVLinkUASFactory.h
src/uas/QGCMAVLinkUASFactory.h
+1
-1
No files found.
src/comm/MAVLinkProtocol.cc
View file @
13cc2cfb
...
...
@@ -391,7 +391,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
}
// Create a new UAS object
uas
=
QGCMAVLinkUASFactory
::
createUAS
(
this
,
link
,
message
.
sysid
,
&
heartbea
t
);
uas
=
QGCMAVLinkUASFactory
::
createUAS
(
this
,
link
,
message
.
sysid
,
(
MAV_AUTOPILOT
)
heartbeat
.
autopilo
t
);
}
...
...
src/uas/QGCMAVLinkUASFactory.cc
View file @
13cc2cfb
...
...
@@ -6,26 +6,13 @@ QGCMAVLinkUASFactory::QGCMAVLinkUASFactory(QObject *parent) :
{
}
UASInterface
*
QGCMAVLinkUASFactory
::
createUAS
(
MAVLinkProtocol
*
mavlink
,
LinkInterface
*
link
,
int
sysid
,
mavlink_heartbeat_t
*
heartbeat
,
QObject
*
parent
)
UASInterface
*
QGCMAVLinkUASFactory
::
createUAS
(
MAVLinkProtocol
*
mavlink
,
LinkInterface
*
link
,
int
sysid
,
MAV_AUTOPILOT
autopilotType
)
{
QPointer
<
QObject
>
p
;
if
(
parent
!=
NULL
)
{
p
=
parent
;
}
else
{
p
=
mavlink
;
}
UASInterface
*
uasInterface
;
UAS
*
uasObject
=
new
UAS
(
mavlink
,
sysid
);
UAS
*
uasObject
=
new
UAS
(
mavlink
,
sysid
,
autopilotType
);
Q_CHECK_PTR
(
uasObject
);
uasInterface
=
uasObject
;
uasObject
->
setSystemType
((
int
)
heartbeat
->
type
);
// Connect this robot to the UAS object
// It is IMPORTANT here to use the right object type,
...
...
@@ -33,9 +20,6 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
// packets never reach their goal)
connect
(
mavlink
,
&
MAVLinkProtocol
::
messageReceived
,
uasObject
,
&
UAS
::
receiveMessage
);
// Set the autopilot type
uasInterface
->
setAutopilotType
((
int
)
heartbeat
->
autopilot
);
// Make UAS aware that this link can be used to communicate with the actual robot
uasInterface
->
addLink
(
link
);
...
...
src/uas/QGCMAVLinkUASFactory.h
View file @
13cc2cfb
...
...
@@ -18,7 +18,7 @@ public:
explicit
QGCMAVLinkUASFactory
(
QObject
*
parent
=
0
);
/** @brief Create a new UAS object using MAVLink as protocol */
static
UASInterface
*
createUAS
(
MAVLinkProtocol
*
mavlink
,
LinkInterface
*
link
,
int
sysid
,
mavlink_heartbeat_t
*
heartbeat
,
QObject
*
parent
=
NULL
);
static
UASInterface
*
createUAS
(
MAVLinkProtocol
*
mavlink
,
LinkInterface
*
link
,
int
sysid
,
MAV_AUTOPILOT
autopilotType
);
signals:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment