|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <MissionController.h>
Inheritance diagram for MissionController:
Collaboration diagram for MissionController:Classes | |
| struct | MissionFlightStatus_t |
Public Member Functions | |
| MissionController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~MissionController () | |
| VisualMissionItem * | insertSimpleMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertTakeoffItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertLandItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertROIMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertCancelROIMissionItem (int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertComplexMissionItem (QString itemName, QGeoCoordinate mapCenterCoordinate, int visualItemIndex, bool makeCurrentItem=false) |
| VisualMissionItem * | insertComplexMissionItemFromKMLOrSHP (QString itemName, QString file, int visualItemIndex, bool makeCurrentItem=false) |
| void | resumeMission (int resumeIndex) |
| void | applyDefaultMissionAltitude (void) |
| Updates the altitudes of the items in the current mission to the new default altitude. | |
| void | setCurrentPlanViewSeqNum (int sequenceNumber, bool force) |
| void | repositionMission (const QGeoCoordinate &newHome, bool repositionTakeoffItems=true, bool repositionLandingItems=true) |
| void | offsetMission (double eastMeters, double northMeters, double upMeters=0.0, bool offsetTakeoffItems=false, bool offsetLandingItems=false) |
| void | rotateMission (double degreesCW, bool rotateTakeoffItems=false, bool rotateLandingItems=false) |
| SendToVehiclePreCheckState | sendToVehiclePreCheck (void) |
| int | readyForSaveState (void) const |
| bool | loadTextFile (QFile &file, QString &errorString) |
| QGCGeoBoundingCube * | travelBoundingCube () |
| QGeoCoordinate | takeoffCoordinate () |
| bool | supported (void) const final |
| true: controller is waiting for the current load to complete | |
| void | start (bool flyView) final |
| Should be called immediately upon Component.onCompleted. | |
| void | save (QJsonObject &json) final |
| bool | load (const QJsonObject &json, QString &errorString) final |
| void | loadFromVehicle (void) final |
| void | sendToVehicle (void) final |
| void | removeAll (void) final |
| Removes all from controller only. | |
| void | removeAllFromVehicle (void) final |
| bool | syncInProgress (void) const final |
| bool | dirty (void) const final |
| void | setDirty (bool dirty) final |
| bool | containsItems (void) const final |
| bool | showPlanFromManagerVehicle (void) final |
| void | addMissionToKML (KMLPlanDomDocument &planKML) |
| QmlObjectListModel * | visualItems (void) |
| QmlObjectTreeModel * | visualItemsTree (void) |
| QPersistentModelIndex | planFileGroupIndex (void) const |
| QPersistentModelIndex | defaultsGroupIndex (void) const |
| QPersistentModelIndex | missionGroupIndex (void) const |
| QPersistentModelIndex | fenceGroupIndex (void) const |
| QPersistentModelIndex | rallyGroupIndex (void) const |
| QmlObjectListModel * | simpleFlightPathSegments (void) |
| QmlObjectListModel * | directionArrows (void) |
| QStringList | complexMissionItemNames (void) const |
| QGeoCoordinate | plannedHomePosition (void) const |
| VisualMissionItem * | currentPlanViewItem (void) const |
| TakeoffMissionItem * | takeoffMissionItem (void) const |
| double | progressPct (void) const |
| QString | surveyComplexItemName (void) const |
| QString | corridorScanComplexItemName (void) const |
| QString | structureScanComplexItemName (void) const |
| bool | isInsertTakeoffValid (void) const |
| bool | multipleLandPatternsAllowed (void) const |
| double | minAMSLAltitude (void) const |
| double | maxAMSLAltitude (void) const |
| int | missionItemCount (void) const |
| int | currentMissionIndex (void) const |
| int | resumeMissionIndex (void) const |
| int | currentPlanViewSeqNum (void) const |
| int | currentPlanViewVIIndex (void) const |
| double | missionTotalDistance (void) const |
| double | missionPlannedDistance (void) const |
| double | missionTime (void) const |
| double | missionHoverDistance (void) const |
| double | missionHoverTime (void) const |
| double | missionCruiseDistance (void) const |
| double | missionCruiseTime (void) const |
| double | missionMaxTelemetry (void) const |
| int | batteryChangePoint (void) const |
| -1 for not supported, 0 for not needed | |
| int | batteriesRequired (void) const |
| -1 for not supported | |
| bool | isFirstLandingComplexItem (const LandingComplexItem *item) const |
| bool | isEmpty (void) const |
| QGroundControlQmlGlobal::AltMode | globalAltitudeMode (void) |
| QGroundControlQmlGlobal::AltMode | globalAltitudeModeDefault (void) |
| void | setGlobalAltitudeMode (QGroundControlQmlGlobal::AltMode altMode) |
Public Member Functions inherited from PlanElementController | |
| PlanElementController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~PlanElementController () | |
| PlanMasterController *masterController READ masterController | CONSTANT (bool supported READ supported NOTIFY supportedChanged) 1(bool containsItems READ containsItems NOTIFY containsItemsChanged) 1(bool syncInProgress READ syncInProgress NOTIFY syncInProgressChanged) 1(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) PlanMasterController *masterController(void) |
| < true: Elemement is non-empty | |
Static Public Member Functions | |
| static void | sendItemsToVehicle (Vehicle *vehicle, QmlObjectListModel *visualMissionItems) |
| Sends the mission items to the specified vehicle. | |
Static Public Attributes | |
| static constexpr int | kPlanFileGroupRow = 0 |
| static constexpr int | kDefaultsGroupRow = 1 |
| static constexpr int | kMissionGroupRow = 2 |
| static constexpr int | kFenceGroupRow = 3 |
| static constexpr int | kRallyGroupRow = 4 |
| static constexpr int | kGroupCount = 5 |
Additional Inherited Members | |
Protected Attributes inherited from PlanElementController | |
| PlanMasterController * | _masterController |
| bool | _flyView |
Definition at line 36 of file MissionController.h.
| Enumerator | |
|---|---|
| SendToVehiclePreCheckStateOk | |
| SendToVehiclePreCheckStateNoActiveVehicle | |
| SendToVehiclePreCheckStateFirwmareVehicleMismatch | |
| SendToVehiclePreCheckStateActiveMission | |
Definition at line 234 of file MissionController.h.
| MissionController::MissionController | ( | PlanMasterController * | masterController, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 36 of file MissionController.cc.
References _recalcFlightPathSegmentsSignal(), _recalcMissionFlightStatusSignal(), PlanMasterController::managerVehicleChanged(), missionPlannedDistanceChanged(), multipleLandPatternsAllowedChanged(), qgcApp, Fact::rawValueChanged(), and recalcTerrainProfile().
| MissionController::~MissionController | ( | ) |
Definition at line 64 of file MissionController.cc.
|
signal |
Referenced by LandingComplexItem::_init(), and MissionController().
|
signal |
Referenced by MissionController().
| void MissionController::addMissionToKML | ( | KMLPlanDomDocument & | planKML | ) |
Definition at line 273 of file MissionController.cc.
References KMLPlanDomDocument::addMission().
Referenced by PlanMasterController::saveToKml().
| void MissionController::applyDefaultMissionAltitude | ( | void | ) |
Updates the altitudes of the items in the current mission to the new default altitude.
Definition at line 2437 of file MissionController.cc.
References VisualMissionItem::applyNewAltitude(), QmlObjectListModel::count(), AppSettings::defaultMissionItemAltitude(), and QmlObjectListModel::value().
|
inline |
-1 for not supported
Definition at line 315 of file MissionController.h.
References MissionController::MissionFlightStatus_t::batteriesRequired.
|
signal |
|
inline |
-1 for not supported, 0 for not needed
Definition at line 314 of file MissionController.h.
References MissionController::MissionFlightStatus_t::batteryChangePoint.
|
signal |
| QStringList MissionController::complexMissionItemNames | ( | void | ) | const |
Definition at line 2405 of file MissionController.cc.
References Vehicle::multiRotor(), CorridorScanComplexItem::name, StructureScanComplexItem::name, SurveyComplexItem::name, and Vehicle::vtol().
|
signal |
|
finalvirtual |
Implements PlanElementController.
Definition at line 2388 of file MissionController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::containsItems().
| QString MissionController::corridorScanComplexItemName | ( | void | ) | const |
Definition at line 2950 of file MissionController.cc.
References CorridorScanComplexItem::name.
| int MissionController::currentMissionIndex | ( | void | ) | const |
Definition at line 2304 of file MissionController.cc.
References PlanElementController::_flyView, MissionManager::currentIndex(), Vehicle::firmwarePlugin(), and FirmwarePlugin::sendHomePositionToVehicle().
|
signal |
|
inline |
Definition at line 288 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 302 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 303 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 280 of file MissionController.h.
|
inline |
Definition at line 285 of file MissionController.h.
|
finalvirtual |
Implements PlanElementController.
Definition at line 2337 of file MissionController.cc.
Referenced by setDirty().
|
inline |
Definition at line 282 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
| QGroundControlQmlGlobal::AltMode MissionController::globalAltitudeMode | ( | void | ) |
Definition at line 2988 of file MissionController.cc.
Referenced by insertComplexMissionItem().
|
signal |
Referenced by setGlobalAltitudeMode().
| QGroundControlQmlGlobal::AltMode MissionController::globalAltitudeModeDefault | ( | void | ) |
Definition at line 2993 of file MissionController.cc.
References QGroundControlQmlGlobal::AltitudeModeMixed, and QGroundControlQmlGlobal::AltitudeModeRelative.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
| VisualMissionItem * MissionController::insertCancelROIMissionItem | ( | int | visualItemIndex, |
| bool | makeCurrentItem = false |
||
| ) |
Add a new Cancel ROI mission item to the list
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 419 of file MissionController.cc.
References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLink::VehicleClassGeneric.
| VisualMissionItem * MissionController::insertComplexMissionItem | ( | QString | itemName, |
| QGeoCoordinate | mapCenterCoordinate, | ||
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new complex mission item to the list
| itemName | Name of complex item to create (from complexMissionItemNames) |
| mapCenterCoordinate | coordinate for current center of map |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 431 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, QGroundControlQmlGlobal::AltitudeModeMixed, globalAltitudeMode(), CorridorScanComplexItem::name, FixedWingLandingComplexItem::name, StructureScanComplexItem::name, SurveyComplexItem::name, VTOLLandingComplexItem::name, and VisualMissionItem::setCoordinate().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), SurveyPlanCreator::createPlan(), and insertLandItem().
| VisualMissionItem * MissionController::insertComplexMissionItemFromKMLOrSHP | ( | QString | itemName, |
| QString | file, | ||
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new complex mission item to the list
| itemName | Name of complex item to create (from complexMissionItemNames) |
| file | kml or shp file to load from shape from |
| coordinate | Coordinate for item |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 465 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, CorridorScanComplexItem::name, StructureScanComplexItem::name, and SurveyComplexItem::name.
| VisualMissionItem * MissionController::insertLandItem | ( | QGeoCoordinate | coordinate, |
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new land item to the list
| coordinate | Coordinate for item |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 394 of file MissionController.cc.
References Vehicle::fixedWing(), insertComplexMissionItem(), FixedWingLandingComplexItem::name, VTOLLandingComplexItem::name, and Vehicle::vtol().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), and SurveyPlanCreator::createPlan().
| VisualMissionItem * MissionController::insertROIMissionItem | ( | QGeoCoordinate | coordinate, |
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new ROI mission item to the list
| coordinate | Coordinate for item |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 407 of file MissionController.cc.
References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLink::VehicleClassGeneric.
| VisualMissionItem * MissionController::insertSimpleMissionItem | ( | QGeoCoordinate | coordinate, |
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new simple mission item to the list
| coordinate | Coordinate for item |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 348 of file MissionController.cc.
| VisualMissionItem * MissionController::insertTakeoffItem | ( | QGeoCoordinate | coordinate, |
| int | visualItemIndex, | ||
| bool | makeCurrentItem = false |
||
| ) |
Add a new takeoff item to the list
| coordinate | Coordinate for item |
| visualItemIndex | index to insert at, -1 for end of list |
| makeCurrentItem | true: Make this item the current item |
Definition at line 353 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, SimpleMissionItem::altitude(), QmlObjectListModel::append(), QmlObjectListModel::insert(), SimpleMissionItem::sequenceNumber(), SimpleMissionItem::setAltitudeMode(), setCurrentPlanViewSeqNum(), SimpleMissionItem::setSequenceNumber(), SimpleMissionItem::specifiesAltitude(), and Vehicle::vtol().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), and SurveyPlanCreator::createPlan().
| bool MissionController::isEmpty | ( | void | ) | const |
Definition at line 2934 of file MissionController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::isEmpty().
| bool MissionController::isFirstLandingComplexItem | ( | const LandingComplexItem * | item | ) | const |
Definition at line 2919 of file MissionController.cc.
References QmlObjectListModel::count(), and QmlObjectListModel::get().
Referenced by FixedWingLandingComplexItem::patternName(), and VTOLLandingComplexItem::patternName().
|
signal |
Referenced by setCurrentPlanViewSeqNum().
| bool MissionController::isInsertTakeoffValid | ( | void | ) | const |
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
finalvirtual |
Implements PlanElementController.
Definition at line 1022 of file MissionController.cc.
References errorString.
Referenced by PlanMasterController::loadFromFile().
|
finalvirtual |
Implements PlanElementController.
Definition at line 209 of file MissionController.cc.
References PlanElementController::_masterController, PlanManager::loadFromVehicle(), Vehicle::missionManager(), PlanMasterController::offline(), and syncInProgress().
Referenced by PlanMasterController::loadFromVehicle().
| bool MissionController::loadTextFile | ( | QFile & | file, |
| QString & | errorString | ||
| ) |
Definition at line 1037 of file MissionController.cc.
References QGroundControlQmlGlobal::AltitudeModeMixed, errorString, and setGlobalAltitudeMode().
Referenced by PlanMasterController::loadFromFile().
|
inline |
Definition at line 297 of file MissionController.h.
Referenced by TerrainProfile::updatePaintNode().
|
signal |
|
inline |
Definition at line 296 of file MissionController.h.
Referenced by TerrainProfile::updatePaintNode().
|
signal |
|
signal |
|
inline |
Definition at line 310 of file MissionController.h.
References MissionController::MissionFlightStatus_t::cruiseDistance.
|
signal |
|
inline |
Definition at line 311 of file MissionController.h.
References MissionController::MissionFlightStatus_t::cruiseTime.
|
signal |
|
inline |
Definition at line 281 of file MissionController.h.
|
inline |
Definition at line 308 of file MissionController.h.
References MissionController::MissionFlightStatus_t::hoverDistance.
|
signal |
|
inline |
Definition at line 309 of file MissionController.h.
References MissionController::MissionFlightStatus_t::hoverTime.
|
signal |
|
inline |
Definition at line 299 of file MissionController.h.
|
signal |
|
inline |
Definition at line 312 of file MissionController.h.
References MissionController::MissionFlightStatus_t::maxTelemetryDistance.
|
signal |
|
inline |
Definition at line 306 of file MissionController.h.
References MissionController::MissionFlightStatus_t::plannedDistance.
|
signal |
Referenced by MissionController().
|
inline |
Definition at line 307 of file MissionController.h.
References MissionController::MissionFlightStatus_t::totalTime.
|
signal |
|
inline |
Definition at line 305 of file MissionController.h.
References MissionController::MissionFlightStatus_t::totalDistance.
Referenced by TerrainProfile::updatePaintNode().
|
signal |
| bool MissionController::multipleLandPatternsAllowed | ( | void | ) | const |
Definition at line 386 of file MissionController.cc.
References PlanElementController::_masterController, PlanViewSettings::allowMultipleLandingPatterns(), PlanMasterController::managerVehicle(), and Vehicle::px4Firmware().
Referenced by setCurrentPlanViewSeqNum().
|
signal |
Referenced by MissionController().
|
signal |
| void MissionController::offsetMission | ( | double | eastMeters, |
| double | northMeters, | ||
| double | upMeters = 0.0, |
||
| bool | offsetTakeoffItems = false, |
||
| bool | offsetLandingItems = false |
||
| ) |
Offsets all mission items which specify a coordinate by the specified ENU amounts in meters. Home altitude remains unchanged. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.
| eastMeters | Distance to offset items to the east, in meters |
| northMeters | Distance to offset items to the north, in meters |
| upMeters | Distance to offset items upwards, in meters |
| offsetTakeoffItems | If true, items identified as takeoff items (isTakeoffItem) will be offset |
| offsetLandingItems | If true, items identified as landing items (isLandCommand) will be offset |
Definition at line 2739 of file MissionController.cc.
References VisualMissionItem::applyNewAltitude(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), VisualMissionItem::editableAlt(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isTakeoffItem(), repositionMission(), VisualMissionItem::specifiesAltitudeOnly(), and VisualMissionItem::specifiesCoordinate().
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 279 of file MissionController.h.
| QGeoCoordinate MissionController::plannedHomePosition | ( | void | ) | const |
Definition at line 2428 of file MissionController.cc.
References MissionSettingsItem::coordinate().
Referenced by LandingComplexItem::amslEntryAlt(), SimpleMissionItem::amslEntryAlt(), StructureScanComplexItem::amslEntryAlt(), TransectStyleComplexItem::amslEntryAlt(), LandingComplexItem::amslExitAlt(), StructureScanComplexItem::maxAMSLAltitude(), TransectStyleComplexItem::maxAMSLAltitude(), StructureScanComplexItem::minAMSLAltitude(), and TransectStyleComplexItem::minAMSLAltitude().
|
signal |
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 290 of file MissionController.h.
|
signal |
|
inline |
Definition at line 283 of file MissionController.h.
| int MissionController::readyForSaveState | ( | void | ) | const |
Determines if the mission has all data needed to be saved or sent to the vehicle. IMPORTANT NOTE: The return value is a VisualMissionItem::ReadForSaveState value. It is an int here to work around a nightmare of circular header dependency problems.
Definition at line 1057 of file MissionController.cc.
References QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::ReadyForSave, and VisualMissionItem::readyForSaveState().
Referenced by PlanMasterController::readyForSaveState().
|
signal |
|
finalvirtual |
Removes all from controller only.
Implements PlanElementController.
Definition at line 609 of file MissionController.cc.
References QmlObjectListModel::clearAndDeleteContents(), and setDirty().
Referenced by PlanMasterController::removeAll().
|
finalvirtual |
Removes all from vehicle and controller Signals removeAllComplete when done
Implements PlanElementController.
Definition at line 2393 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::offline(), PlanManager::removeAll(), and syncInProgress().
Referenced by PlanMasterController::removeAllFromVehicle().
| void MissionController::repositionMission | ( | const QGeoCoordinate & | newHome, |
| bool | repositionTakeoffItems = true, |
||
| bool | repositionLandingItems = true |
||
| ) |
Repositions all mission items which specify a coordinate around a new home coordinate. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.
| newHome | New coordinate for the home item |
| repositionTakeoffItems | If true, items identified as takeoff items (isTakeoffItem) will be repositioned |
| repositionLandingItems | If true, items identified as landing items (isLandCommand) will be repositioned |
Definition at line 2697 of file MissionController.cc.
References VisualMissionItem::coordinate(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isStandaloneCoordinate(), VisualMissionItem::isTakeoffItem(), VisualMissionItem::setCoordinate(), setDirty(), and VisualMissionItem::specifiesCoordinate().
Referenced by offsetMission().
| void MissionController::resumeMission | ( | int | resumeIndex | ) |
Definition at line 2420 of file MissionController.cc.
References Vehicle::firmwarePlugin(), MissionManager::generateResumeMission(), and FirmwarePlugin::sendHomePositionToVehicle().
| int MissionController::resumeMissionIndex | ( | void | ) | const |
Definition at line 2286 of file MissionController.cc.
References PlanElementController::_flyView, QmlObjectListModel::count(), Vehicle::firmwarePlugin(), MissionManager::lastCurrentIndex(), FirmwarePlugin::sendHomePositionToVehicle(), VisualMissionItem::sequenceNumber(), and QmlObjectListModel::value().
|
signal |
|
signal |
|
signal |
| void MissionController::rotateMission | ( | double | degreesCW, |
| bool | rotateTakeoffItems = false, |
||
| bool | rotateLandingItems = false |
||
| ) |
Rotates all mission items which specify a coordinate around the up axis of the home position. Complex items are rotated by moving their reference coordinate: their geometry and orientation are not modified. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.
| degreesCW | Angle to rotate items by, in degrees clockwise |
| rotateTakeoffItems | If true, items identified as takeoff items (isTakeoffItem) will be rotated |
| rotateLandingItems | If true, items identified as landing items (isLandCommand) will be rotated |
Definition at line 2786 of file MissionController.cc.
References VisualMissionItem::coordinate(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isStandaloneCoordinate(), VisualMissionItem::isTakeoffItem(), VisualMissionItem::setCoordinate(), setDirty(), and VisualMissionItem::specifiesCoordinate().
|
finalvirtual |
Implements PlanElementController.
Definition at line 1069 of file MissionController.cc.
References MissionSettingsItem::coordinate(), QmlObjectListModel::count(), Vehicle::defaultCruiseSpeed(), Vehicle::defaultHoverSpeed(), Vehicle::firmwareType(), QmlObjectListModel::get(), JsonHelper::jsonVersionKey, VisualMissionItem::save(), MissionItem::save(), JsonHelper::saveGeoCoordinate(), QmlObjectListModel::value(), and Vehicle::vehicleType().
Referenced by PlanMasterController::saveToJson().
|
static |
Sends the mission items to the specified vehicle.
Definition at line 283 of file MissionController.cc.
References Vehicle::missionManager(), and PlanManager::writeMissionItems().
Referenced by sendToVehicle().
|
finalvirtual |
Sends the current plan element to the vehicle Signals sendComplete when done
Implements PlanElementController.
Definition at line 221 of file MissionController.cc.
References PlanElementController::_masterController, QmlObjectListModel::count(), PlanMasterController::offline(), sendItemsToVehicle(), setDirty(), and syncInProgress().
Referenced by PlanMasterController::sendToVehicle().
| MissionController::SendToVehiclePreCheckState MissionController::sendToVehiclePreCheck | ( | void | ) |
Definition at line 2974 of file MissionController.cc.
References Vehicle::armed(), Vehicle::firmwareType(), Vehicle::flightMode(), Vehicle::isOfflineEditingVehicle(), Vehicle::missionFlightMode(), SendToVehiclePreCheckStateActiveMission, SendToVehiclePreCheckStateFirwmareVehicleMismatch, SendToVehiclePreCheckStateNoActiveVehicle, SendToVehiclePreCheckStateOk, QGCMAVLink::vehicleClass(), and Vehicle::vehicleType().
| void MissionController::setCurrentPlanViewSeqNum | ( | int | sequenceNumber, |
| bool | force | ||
| ) |
Sets a new current mission item (PlanView).
| sequenceNumber | - index for new item, -1 to clear current item |
| force | - true: reset internals even if specified item is already selected |
Definition at line 2517 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::controllerVehicle(), SimpleMissionItem::coordinate(), QmlObjectListModel::count(), currentPlanViewItemChanged(), currentPlanViewSeqNumChanged(), currentPlanViewVIIndexChanged(), flyThroughCommandsAllowedChanged(), QmlObjectListModel::get(), hasLandItemChanged(), isInsertLandValidChanged(), isInsertTakeoffValidChanged(), isROIActiveChanged(), isROIBeginCurrentItemChanged(), VisualMissionItem::isStandaloneCoordinate(), SimpleMissionItem::isStandaloneCoordinate(), SimpleMissionItem::mavCommand(), multipleLandPatternsAllowed(), onlyInsertTakeoffValidChanged(), VisualMissionItem::parentItem(), previousCoordinateChanged(), VisualMissionItem::sequenceNumber(), VisualMissionItem::setHasCurrentChildItem(), VisualMissionItem::setIsCurrentItem(), VisualMissionItem::specifiesCoordinate(), SimpleMissionItem::specifiesCoordinate(), splitSegmentChanged(), Vehicle::supports(), PlanViewSettings::takeoffItemNotRequired(), and VehicleSupports::takeoffMissionCommand().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), SurveyPlanCreator::createPlan(), and insertTakeoffItem().
|
finalvirtual |
Implements PlanElementController.
Definition at line 2343 of file MissionController.cc.
References dirty(), and QmlObjectListModel::setDirty().
Referenced by PlanMasterController::removeAll(), removeAll(), repositionMission(), rotateMission(), and sendToVehicle().
| void MissionController::setGlobalAltitudeMode | ( | QGroundControlQmlGlobal::AltMode | altMode | ) |
Definition at line 3002 of file MissionController.cc.
References globalAltitudeModeChanged().
Referenced by loadTextFile().
|
finalvirtual |
Implements PlanElementController.
Definition at line 2461 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, Vehicle::initialPlanRequestComplete(), PlanMasterController::offline(), and syncInProgress().
|
inline |
Definition at line 284 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
finalvirtual |
Should be called immediately upon Component.onCompleted.
Reimplemented from PlanElementController.
Definition at line 113 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::managerVehicleChanged(), and PlanElementController::start().
Referenced by PlanMasterController::startStaticActiveVehicle().
| QString MissionController::structureScanComplexItemName | ( | void | ) | const |
Definition at line 2955 of file MissionController.cc.
References StructureScanComplexItem::name.
|
inlinefinalvirtual |
true: controller is waiting for the current load to complete
Implements PlanElementController.
Definition at line 258 of file MissionController.h.
| QString MissionController::surveyComplexItemName | ( | void | ) | const |
Definition at line 2945 of file MissionController.cc.
References SurveyComplexItem::name.
|
finalvirtual |
Implements PlanElementController.
Definition at line 2332 of file MissionController.cc.
References PlanManager::inProgress().
Referenced by loadFromVehicle(), removeAllFromVehicle(), sendToVehicle(), showPlanFromManagerVehicle(), and PlanMasterController::syncInProgress().
|
inline |
Definition at line 255 of file MissionController.h.
|
inline |
Definition at line 289 of file MissionController.h.
|
signal |
|
inline |
Definition at line 254 of file MissionController.h.
|
inline |
Definition at line 277 of file MissionController.h.
Referenced by TerrainProfile::setMissionController().
|
signal |
Referenced by TerrainProfile::setMissionController().
|
inline |
Definition at line 278 of file MissionController.h.
|
staticconstexpr |
Definition at line 326 of file MissionController.h.
|
staticconstexpr |
Definition at line 328 of file MissionController.h.
|
staticconstexpr |
Definition at line 330 of file MissionController.h.
|
staticconstexpr |
Definition at line 327 of file MissionController.h.
|
staticconstexpr |
Definition at line 325 of file MissionController.h.
|
staticconstexpr |
Definition at line 329 of file MissionController.h.
| int MissionController::visualItemIndexForObject |
< Used by Plan view only for interactive editing
< Includes AMSL altitude < Segment which show show + split ui element < True mission item command count (only valid in Fly View) < Returns the item index two which a mission should be resumed. -1 indicates resume mission not available. < Minimum altitude associated with this mission. Used to calculate percentages for terrain status. < Maximum altitude associated with this mission. Used to calculate percentages for terrain status. Returns the visual item index for the given VisualMissionItem object, or -1 if not found
Definition at line 128 of file MissionController.h.