|
|
@ -340,7 +340,10 @@ int MissionController::insertSimpleMissionItem(QGeoCoordinate coordinate, int i) |
|
|
|
newItem->setCommand(MavlinkQmlSingleton::MAV_CMD_NAV_WAYPOINT); |
|
|
|
newItem->setCommand(MavlinkQmlSingleton::MAV_CMD_NAV_WAYPOINT); |
|
|
|
_initVisualItem(newItem); |
|
|
|
_initVisualItem(newItem); |
|
|
|
if (_visualItems->count() == 1) { |
|
|
|
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(); |
|
|
|
newItem->setDefaultsForCommand(); |
|
|
|
if ((MAV_CMD)newItem->command() == MAV_CMD_NAV_WAYPOINT) { |
|
|
|
if ((MAV_CMD)newItem->command() == MAV_CMD_NAV_WAYPOINT) { |
|
|
@ -1033,7 +1036,8 @@ 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 we still haven't found the first coordinate item and we hit a takeoff command, link back to home
|
|
|
|
if (firstCoordinateItem && |
|
|
|
if (firstCoordinateItem && |
|
|
|
item->isSimpleItem() && |
|
|
|
item->isSimpleItem() && |
|
|
|
(qobject_cast<SimpleMissionItem*>(item)->command() == MavlinkQmlSingleton::MAV_CMD_NAV_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)) { |
|
|
|
qobject_cast<SimpleMissionItem*>(item)->command() == MavlinkQmlSingleton::MAV_CMD_NAV_VTOL_TAKEOFF)) { |
|
|
|
linkStartToHome = true; |
|
|
|
linkStartToHome = true; |
|
|
|
} |
|
|
|
} |
|
|
|