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
15812f3a
Commit
15812f3a
authored
May 07, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move UAS objects to their own worker threads
parent
65dcf96e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
QGCMAVLinkUASFactory.cc
src/uas/QGCMAVLinkUASFactory.cc
+22
-0
No files found.
src/uas/QGCMAVLinkUASFactory.cc
View file @
15812f3a
...
...
@@ -21,6 +21,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
UASInterface
*
uas
;
QThread
*
worker
=
new
QThread
();
switch
(
heartbeat
->
autopilot
)
{
case
MAV_AUTOPILOT_GENERIC
:
...
...
@@ -28,6 +30,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
UAS
*
mav
=
new
UAS
(
mavlink
,
sysid
);
// Set the system type
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
// Connect this robot to the UAS object
connect
(
mavlink
,
SIGNAL
(
messageReceived
(
LinkInterface
*
,
mavlink_message_t
)),
mav
,
SLOT
(
receiveMessage
(
LinkInterface
*
,
mavlink_message_t
)));
#ifdef QGC_PROTOBUF_ENABLED
...
...
@@ -41,6 +46,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
PxQuadMAV
*
mav
=
new
PxQuadMAV
(
mavlink
,
sysid
);
// Set the system type
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
// Connect this robot to the UAS object
// it is IMPORTANT here to use the right object type,
// else the slot of the parent object is called (and thus the special
...
...
@@ -57,6 +65,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
SlugsMAV
*
mav
=
new
SlugsMAV
(
mavlink
,
sysid
);
// Set the system type
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
// Connect this robot to the UAS object
// it is IMPORTANT here to use the right object type,
// else the slot of the parent object is called (and thus the special
...
...
@@ -70,6 +81,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
ArduPilotMegaMAV
*
mav
=
new
ArduPilotMegaMAV
(
mavlink
,
sysid
);
// Set the system type
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
// Connect this robot to the UAS object
// it is IMPORTANT here to use the right object type,
// else the slot of the parent object is called (and thus the special
...
...
@@ -83,6 +97,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
{
senseSoarMAV
*
mav
=
new
senseSoarMAV
(
mavlink
,
sysid
);
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
connect
(
mavlink
,
SIGNAL
(
messageReceived
(
LinkInterface
*
,
mavlink_message_t
)),
mav
,
SLOT
(
receiveMessage
(
LinkInterface
*
,
mavlink_message_t
)));
uas
=
mav
;
break
;
...
...
@@ -92,6 +109,9 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
{
UAS
*
mav
=
new
UAS
(
mavlink
,
sysid
);
mav
->
setSystemType
((
int
)
heartbeat
->
type
);
mav
->
moveToThread
(
worker
);
// Connect this robot to the UAS object
// it is IMPORTANT here to use the right object type,
// else the slot of the parent object is called (and thus the special
...
...
@@ -111,5 +131,7 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
// Now add UAS to "official" list, which makes the whole application aware of it
UASManager
::
instance
()
->
addUAS
(
uas
);
worker
->
start
(
QThread
::
HighPriority
);
return
uas
;
}
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