Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
bbff4468
Commit
bbff4468
authored
Dec 11, 2017
by
Patrick José Pereira
Browse files
MissionController: Add takeoff only with supported vehicles
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
79b32cc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/MissionController.cc
View file @
bbff4468
...
...
@@ -340,7 +340,10 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i)
newItem
->
setCommand
(
MavlinkQmlSingleton
::
MAV_CMD_NAV_WAYPOINT
);
_initVisualItem
(
newItem
);
if
(
_visualItems
->
count
()
==
1
)
{
newItem
->
setCommand
(
_controllerVehicle
->
vtol
()
?
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
:
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
);
MavlinkQmlSingleton
::
Qml_MAV_CMD
takeoffCmd
=
_controllerVehicle
->
vtol
()
?
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
:
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
;
if
(
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
((
MAV_CMD
)
takeoffCmd
))
{
newItem
->
setCommand
(
takeoffCmd
);
}
}
newItem
->
setDefaultsForCommand
();
if
((
MAV_CMD
)
newItem
->
command
()
==
MAV_CMD_NAV_WAYPOINT
)
{
...
...
@@ -1033,8 +1036,9 @@ void MissionController::_recalcWaypointLines(void)
// If we still haven't found the first coordinate item and we hit a takeoff command, link back to home
if
(
firstCoordinateItem
&&
item
->
isSimpleItem
()
&&
(
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
))
{
(
!
_controllerVehicle
->
firmwarePlugin
()
->
supportedMissionCommands
().
contains
(
MAV_CMD_NAV_TAKEOFF
)
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_TAKEOFF
||
qobject_cast
<
SimpleMissionItem
*>
(
item
)
->
command
()
==
MavlinkQmlSingleton
::
MAV_CMD_NAV_VTOL_TAKEOFF
))
{
linkStartToHome
=
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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