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
3caf4007
Commit
3caf4007
authored
Jun 15, 2016
by
Don Gagne
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3572 from DonLakeFlyer/MockLink'
MockLink: Support multi-vehicle simulation
parents
500de017
8c7159fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
MockLink.cc
src/comm/MockLink.cc
+15
-8
MockLink.h
src/comm/MockLink.h
+5
-3
No files found.
src/comm/MockLink.cc
View file @
3caf4007
...
...
@@ -57,9 +57,10 @@ union px4_custom_mode {
float
data_float
;
};
float
MockLink
::
_vehicleLatitude
=
47.633033
f
;
float
MockLink
::
_vehicleLongitude
=
-
122.08794
f
;
float
MockLink
::
_vehicleAltitude
=
3.5
f
;
float
MockLink
::
_vehicleLatitude
=
47.633033
f
;
float
MockLink
::
_vehicleLongitude
=
-
122.08794
f
;
float
MockLink
::
_vehicleAltitude
=
3.5
f
;
int
MockLink
::
_nextVehicleSystemId
=
128
;
const
char
*
MockConfiguration
::
_firmwareTypeKey
=
"FirmwareType"
;
const
char
*
MockConfiguration
::
_vehicleTypeKey
=
"VehicleType"
;
...
...
@@ -69,8 +70,8 @@ MockLink::MockLink(MockConfiguration* config)
:
_missionItemHandler
(
this
,
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
())
,
_name
(
"MockLink"
)
,
_connected
(
false
)
,
_vehicleSystemId
(
128
)
// FIXME: Pull from eventual parameter manager
,
_vehicleComponentId
(
200
)
// FIXME: magic number?
,
_vehicleSystemId
(
_nextVehicleSystemId
++
)
,
_vehicleComponentId
(
200
)
,
_inNSH
(
false
)
,
_mavlinkStarted
(
true
)
,
_mavBaseMode
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_CUSTOM_MODE_ENABLED
)
...
...
@@ -80,7 +81,8 @@ MockLink::MockLink(MockConfiguration* config)
,
_fileServer
(
NULL
)
,
_sendStatusText
(
false
)
,
_apmSendHomePositionOnEmptyList
(
false
)
,
_sendHomePositionDelayCount
(
2
)
,
_sendHomePositionDelayCount
(
10
)
// No home position for 4 seconds
,
_sendGPSPositionDelayCount
(
100
)
// No gps lock for 5 seconds
{
_config
=
config
;
if
(
_config
)
{
...
...
@@ -163,7 +165,7 @@ void MockLink::_run1HzTasks(void)
_sendRCChannels
();
}
if
(
_sendHomePositionDelayCount
>
0
)
{
// We delay home position
a bit to be more realistic
// We delay home position
for better testing
_sendHomePositionDelayCount
--
;
}
else
{
_sendHomePosition
();
...
...
@@ -178,7 +180,12 @@ void MockLink::_run1HzTasks(void)
void
MockLink
::
_run10HzTasks
(
void
)
{
if
(
_mavlinkStarted
&&
_connected
)
{
_sendGpsRawInt
();
if
(
_sendGPSPositionDelayCount
>
0
)
{
// We delay gps position for better testing
_sendGPSPositionDelayCount
--
;
}
else
{
_sendGpsRawInt
();
}
}
}
...
...
src/comm/MockLink.h
View file @
3caf4007
...
...
@@ -206,10 +206,12 @@ private:
bool
_apmSendHomePositionOnEmptyList
;
int
_sendHomePositionDelayCount
;
int
_sendGPSPositionDelayCount
;
static
float
_vehicleLatitude
;
static
float
_vehicleLongitude
;
static
float
_vehicleAltitude
;
static
float
_vehicleLatitude
;
static
float
_vehicleLongitude
;
static
float
_vehicleAltitude
;
static
int
_nextVehicleSystemId
;
};
#endif
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