|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <MissionController.h>
Inheritance diagram for MissionController:
Collaboration diagram for MissionController:Public Types | |
| enum | SendToVehiclePreCheckState { SendToVehiclePreCheckStateOk , SendToVehiclePreCheckStateNoActiveVehicle , SendToVehiclePreCheckStateFirwmareVehicleMismatch , SendToVehiclePreCheckStateActiveMission } |
| using | MissionFlightStatus_t = ::MissionFlightStatus_t |
| Default to use for newly created items. | |
Public Member Functions | |
| MissionController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~MissionController () | |
| Q_INVOKABLE void | removeVisualItem (int viIndex) |
| Q_INVOKABLE int | visualItemIndexForObject (QObject *object) const |
| Returns the visual item index for the given VisualMissionItem object, or -1 if not found. | |
| Q_INVOKABLE void | setHomePosition (QGeoCoordinate coordinate) |
| Set the planned home position from a map click. | |
| Q_INVOKABLE VisualMissionItem * | insertSimpleMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertTakeoffItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertLandItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertROIMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertCancelROIMissionItem (int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertComplexMissionItem (QString itemName, QGeoCoordinate mapCenterCoordinate, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE VisualMissionItem * | insertComplexMissionItemFromKMLOrSHP (QString itemName, QString file, int visualItemIndex, bool makeCurrentItem=false) |
| Q_INVOKABLE void | resumeMission (int resumeIndex) |
| Q_INVOKABLE void | applyDefaultMissionAltitude (void) |
| Updates the altitudes of the items in the current mission to the new default altitude. | |
| Q_INVOKABLE void | setCurrentPlanViewSeqNum (int sequenceNumber, bool force) |
| Q_INVOKABLE void | repositionMission (const QGeoCoordinate &newHome, bool repositionTakeoffItems=true, bool repositionLandingItems=true) |
| Q_INVOKABLE void | offsetMission (double eastMeters, double northMeters, double upMeters=0.0, bool offsetTakeoffItems=false, bool offsetLandingItems=false) |
| Q_INVOKABLE void | rotateMission (double degreesCW, bool rotateTakeoffItems=false, bool rotateLandingItems=false) |
| Q_INVOKABLE 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 |
| QPersistentModelIndex | transformGroupIndex (void) const |
| QmlObjectListModel * | simpleFlightPathSegments (void) |
| QmlObjectListModel * | directionArrows (void) |
| QVariantList | complexMissionItems (void) const |
| QGeoCoordinate | plannedHomePosition (void) const |
| bool | homePositionSet (void) const |
| VisualMissionItem * | currentPlanViewItem (void) const |
| TakeoffMissionItem * | takeoffMissionItem (void) const |
| double | progressPct (void) const |
| bool | isInsertTakeoffValid (void) const |
| bool | multipleLandPatternsAllowed (void) const |
| double | minAMSLAltitude (void) const |
| double | maxAMSLAltitude (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::AltitudeFrame | globalAltitudeFrame (void) |
| QGroundControlQmlGlobal::AltitudeFrame | globalAltitudeFrameDefault (void) |
| void | setGlobalAltitudeFrame (QGroundControlQmlGlobal::AltitudeFrame altFrame) |
Public Member Functions inherited from PlanElementController | |
| PlanElementController (PlanMasterController *masterController, QObject *parent=nullptr) | |
| ~PlanElementController () | |
| true: unsaved/sent changes are present, false: no changes since last save/send | |
| PlanMasterController * | masterController (void) |
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 | kTransformGroupRow = 5 |
| static constexpr int | kGroupCount = 6 |
Additional Inherited Members | |
Protected Attributes inherited from PlanElementController | |
| PlanMasterController * | _masterController |
| bool | _flyView |
Definition at line 36 of file MissionController.h.
Default to use for newly created items.
Definition at line 50 of file MissionController.h.
| Enumerator | |
|---|---|
| SendToVehiclePreCheckStateOk | |
| SendToVehiclePreCheckStateNoActiveVehicle | |
| SendToVehiclePreCheckStateFirwmareVehicleMismatch | |
| SendToVehiclePreCheckStateActiveMission | |
Definition at line 209 of file MissionController.h.
| MissionController::MissionController | ( | PlanMasterController * | masterController, |
| QObject * | parent = nullptr |
||
| ) |
Definition at line 38 of file MissionController.cc.
References _recalcFlightPathSegmentsSignal(), _recalcMissionFlightStatusSignal(), PlanMasterController::managerVehicleChanged(), missionPlannedDistanceChanged(), multipleLandPatternsAllowedChanged(), qgcApp, Fact::rawValueChanged(), and recalcTerrainProfile().
| MissionController::~MissionController | ( | ) |
Definition at line 66 of file MissionController.cc.
|
signal |
Referenced by LandingComplexItem::_init(), and MissionController().
|
signal |
Referenced by MissionController().
| void MissionController::addMissionToKML | ( | KMLPlanDomDocument & | planKML | ) |
Definition at line 234 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 1847 of file MissionController.cc.
References VisualMissionItem::applyNewAltitude(), QmlObjectListModel::count(), and QmlObjectListModel::value().
|
inline |
-1 for not supported
Definition at line 288 of file MissionController.h.
References MissionFlightStatus_t::batteriesRequired.
|
signal |
|
inline |
-1 for not supported, 0 for not needed
Definition at line 287 of file MissionController.h.
References MissionFlightStatus_t::batteryChangePoint.
|
signal |
| QVariantList MissionController::complexMissionItems | ( | void | ) | const |
Definition at line 1813 of file MissionController.cc.
References QGCCorePlugin::complexMissionItemNames(), and QGCCorePlugin::instance().
|
signal |
|
finalvirtual |
Implements PlanElementController.
Definition at line 1796 of file MissionController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::containsItems().
| int MissionController::currentMissionIndex | ( | void | ) | const |
Definition at line 1717 of file MissionController.cc.
References PlanElementController::_flyView, MissionManager::currentIndex(), Vehicle::firmwarePlugin(), and FirmwarePlugin::sendHomePositionToVehicle().
|
signal |
|
inline |
Definition at line 265 of file MissionController.h.
|
inline |
Definition at line 275 of file MissionController.h.
|
inline |
Definition at line 276 of file MissionController.h.
|
inline |
Definition at line 255 of file MissionController.h.
|
inline |
Definition at line 261 of file MissionController.h.
|
finalvirtual |
Implements PlanElementController.
Definition at line 1750 of file MissionController.cc.
References ObjectItemModelBase::dirty().
Referenced by setDirty().
|
inline |
Definition at line 257 of file MissionController.h.
| QGroundControlQmlGlobal::AltitudeFrame MissionController::globalAltitudeFrame | ( | void | ) |
Definition at line 2392 of file MissionController.cc.
Referenced by insertComplexMissionItem().
|
signal |
Referenced by setGlobalAltitudeFrame().
| QGroundControlQmlGlobal::AltitudeFrame MissionController::globalAltitudeFrameDefault | ( | void | ) |
Definition at line 2397 of file MissionController.cc.
References QGroundControlQmlGlobal::AltitudeFrameMixed, and QGroundControlQmlGlobal::AltitudeFrameRelative.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
| bool MissionController::homePositionSet | ( | void | ) | const |
Definition at line 1835 of file MissionController.cc.
References MissionSettingsItem::coordinate().
|
signal |
| 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 379 of file MissionController.cc.
References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLinkTypes::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 (canonicalName from complexMissionItems) |
| 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 390 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, QGroundControlQmlGlobal::AltitudeFrameMixed, ComplexMissionItem::applyPreviousAltitudeFrame(), QGCCorePlugin::createComplexMissionItem(), globalAltitudeFrame(), QGCCorePlugin::instance(), 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 (canonicalName from complexMissionItems) |
| 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 411 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, QGCCorePlugin::createComplexMissionItem(), and QGCCorePlugin::instance().
| 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 355 of file MissionController.cc.
References FixedWingLandingComplexItem::canonicalName, VTOLLandingComplexItem::canonicalName, Vehicle::fixedWing(), insertComplexMissionItem(), 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 368 of file MissionController.cc.
References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLinkTypes::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 309 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 314 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, SimpleMissionItem::altitude(), QmlObjectListModel::append(), QmlObjectListModel::insert(), SimpleMissionItem::sequenceNumber(), SimpleMissionItem::setAltitudeFrame(), setCurrentPlanViewSeqNum(), Fact::setRawValue(), SimpleMissionItem::setSequenceNumber(), SimpleMissionItem::specifiesAltitude(), and Vehicle::vtol().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), and SurveyPlanCreator::createPlan().
| bool MissionController::isEmpty | ( | void | ) | const |
Definition at line 2353 of file MissionController.cc.
References QmlObjectListModel::count().
Referenced by PlanMasterController::isEmpty().
| bool MissionController::isFirstLandingComplexItem | ( | const LandingComplexItem * | item | ) | const |
Definition at line 2338 of file MissionController.cc.
References QmlObjectListModel::count(), and QmlObjectListModel::get().
Referenced by FixedWingLandingComplexItem::patternName(), and VTOLLandingComplexItem::patternName().
| bool MissionController::isInsertTakeoffValid | ( | void | ) | const |
|
finalvirtual |
Implements PlanElementController.
Definition at line 820 of file MissionController.cc.
References errorString.
Referenced by PlanMasterController::loadFromFile().
|
finalvirtual |
Implements PlanElementController.
Definition at line 170 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 835 of file MissionController.cc.
References QGroundControlQmlGlobal::AltitudeFrameMixed, errorString, and setGlobalAltitudeFrame().
Referenced by PlanMasterController::loadFromFile().
|
inline |
Definition at line 271 of file MissionController.h.
|
signal |
|
inline |
Definition at line 270 of file MissionController.h.
|
signal |
|
signal |
|
inline |
Definition at line 283 of file MissionController.h.
References MissionFlightStatus_t::cruiseDistance.
|
signal |
|
inline |
Definition at line 284 of file MissionController.h.
References MissionFlightStatus_t::cruiseTime.
|
signal |
|
inline |
Definition at line 256 of file MissionController.h.
|
inline |
Definition at line 281 of file MissionController.h.
References MissionFlightStatus_t::hoverDistance.
|
signal |
|
inline |
Definition at line 282 of file MissionController.h.
References MissionFlightStatus_t::hoverTime.
|
signal |
|
inline |
Definition at line 285 of file MissionController.h.
References MissionFlightStatus_t::maxTelemetryDistance.
|
signal |
|
inline |
Definition at line 279 of file MissionController.h.
References MissionFlightStatus_t::plannedDistance.
|
signal |
Referenced by MissionController().
|
inline |
Definition at line 280 of file MissionController.h.
References MissionFlightStatus_t::totalTime.
|
signal |
|
inline |
Definition at line 278 of file MissionController.h.
References MissionFlightStatus_t::totalDistance.
|
signal |
| bool MissionController::multipleLandPatternsAllowed | ( | void | ) | const |
Definition at line 347 of file MissionController.cc.
References PlanElementController::_masterController, 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.
| 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 2144 of file MissionController.cc.
References VisualMissionItem::applyNewAltitude(), VisualMissionItem::coordinate(), QmlObjectListModel::count(), VisualMissionItem::editableAlt(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isStandaloneCoordinate(), VisualMissionItem::isTakeoffItem(), VisualMissionItem::setCoordinate(), setDirty(), VisualMissionItem::specifiesAltitudeOnly(), and VisualMissionItem::specifiesCoordinate().
|
inline |
Definition at line 254 of file MissionController.h.
| QGeoCoordinate MissionController::plannedHomePosition | ( | void | ) | const |
Definition at line 1826 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 |
All plan-view properties are recomputed together in setCurrentPlanViewSeqNum, so one signal covers them all.
Referenced by setCurrentPlanViewSeqNum().
|
inline |
Definition at line 267 of file MissionController.h.
|
signal |
|
inline |
Definition at line 258 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 855 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 578 of file MissionController.cc.
References setDirty().
Referenced by PlanMasterController::removeAll().
|
finalvirtual |
Removes all from vehicle and controller Signals removeAllComplete when done
Implements PlanElementController.
Definition at line 1801 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::offline(), PlanManager::removeAll(), and syncInProgress().
Referenced by PlanMasterController::removeAllFromVehicle().
| void MissionController::removeVisualItem | ( | int | viIndex | ) |
Definition at line 485 of file MissionController.cc.
References CameraSection::cameraMode(), CameraSection::cameraModeSupported(), MissionSettingsItem::cameraSection(), QmlObjectListModel::count(), Vehicle::firmwarePlugin(), CameraSection::gimbalPitch(), CameraSection::gimbalYaw(), FirmwarePlugin::hasGimbal(), Fact::rawValue(), QmlObjectListModel::removeAt(), VisualMissionItem::sequenceNumber(), setCurrentPlanViewSeqNum(), setDirty(), CameraSection::setSpecifyCameraMode(), CameraSection::setSpecifyGimbal(), CameraSection::specifyCameraMode(), CameraSection::specifyGimbal(), and QmlObjectListModel::value().
| 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 2102 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().
| void MissionController::resumeMission | ( | int | resumeIndex | ) |
Definition at line 1818 of file MissionController.cc.
References Vehicle::firmwarePlugin(), MissionManager::generateResumeMission(), and FirmwarePlugin::sendHomePositionToVehicle().
| int MissionController::resumeMissionIndex | ( | void | ) | const |
Definition at line 1699 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 2205 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 867 of file MissionController.cc.
References MissionSettingsItem::coordinate(), QmlObjectListModel::count(), Vehicle::defaultCruiseSpeed(), Vehicle::defaultHoverSpeed(), Vehicle::firmwareType(), QmlObjectListModel::get(), JsonParsing::jsonVersionKey, VisualMissionItem::save(), MissionItem::save(), GeoJsonHelper::saveGeoCoordinate(), QmlObjectListModel::value(), and Vehicle::vehicleType().
Referenced by PlanMasterController::saveToJson().
|
static |
Sends the mission items to the specified vehicle.
Definition at line 244 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 182 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 2378 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 1927 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::controllerVehicle(), SimpleMissionItem::coordinate(), QmlObjectListModel::count(), QmlObjectListModel::get(), hasLandItemChanged(), VisualMissionItem::isStandaloneCoordinate(), SimpleMissionItem::isStandaloneCoordinate(), SimpleMissionItem::mavCommand(), multipleLandPatternsAllowed(), VisualMissionItem::parentItem(), planViewStateChanged(), VisualMissionItem::sequenceNumber(), VisualMissionItem::setHasCurrentChildItem(), VisualMissionItem::setIsCurrentItem(), VisualMissionItem::specifiesCoordinate(), SimpleMissionItem::specifiesCoordinate(), splitSegmentChanged(), Vehicle::supports(), and VehicleSupports::takeoffMissionCommand().
Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), SurveyPlanCreator::createPlan(), insertTakeoffItem(), and removeVisualItem().
|
finalvirtual |
Implements PlanElementController.
Definition at line 1756 of file MissionController.cc.
References dirty(), and QmlObjectListModel::setDirty().
Referenced by offsetMission(), PlanMasterController::removeAll(), removeAll(), removeVisualItem(), repositionMission(), rotateMission(), and sendToVehicle().
| void MissionController::setGlobalAltitudeFrame | ( | QGroundControlQmlGlobal::AltitudeFrame | altFrame | ) |
Definition at line 2406 of file MissionController.cc.
References globalAltitudeFrameChanged().
Referenced by loadTextFile().
| void MissionController::setHomePosition | ( | QGeoCoordinate | coordinate | ) |
Set the planned home position from a map click.
Definition at line 1840 of file MissionController.cc.
References MissionSettingsItem::setCoordinate().
|
finalvirtual |
Implements PlanElementController.
Definition at line 1871 of file MissionController.cc.
References PlanElementController::_flyView, PlanElementController::_masterController, Vehicle::initialPlanRequestComplete(), PlanMasterController::offline(), and syncInProgress().
|
inline |
Definition at line 260 of file MissionController.h.
|
signal |
Referenced by setCurrentPlanViewSeqNum().
|
finalvirtual |
Should be called immediately upon Component.onCompleted.
Reimplemented from PlanElementController.
Definition at line 87 of file MissionController.cc.
References PlanElementController::_masterController, PlanMasterController::managerVehicleChanged(), and PlanElementController::start().
Referenced by PlanMasterController::start(), and PlanMasterController::startStaticActiveVehicle().
|
inlinefinalvirtual |
true: controller is waiting for the current load to complete
Implements PlanElementController.
Definition at line 233 of file MissionController.h.
|
finalvirtual |
Implements PlanElementController.
Definition at line 1745 of file MissionController.cc.
References PlanManager::inProgress().
Referenced by loadFromVehicle(), removeAllFromVehicle(), sendToVehicle(), showPlanFromManagerVehicle(), and PlanMasterController::syncInProgress().
|
inline |
Definition at line 230 of file MissionController.h.
|
inline |
Definition at line 266 of file MissionController.h.
Referenced by LandingComplexItem::setLandingHeadingToTakeoffHeading().
|
signal |
|
inline |
Definition at line 259 of file MissionController.h.
|
inline |
Definition at line 229 of file MissionController.h.
| int MissionController::visualItemIndexForObject | ( | QObject * | object | ) | const |
Returns the visual item index for the given VisualMissionItem object, or -1 if not found.
Definition at line 480 of file MissionController.cc.
References QmlObjectListModel::indexOf().
|
inline |
Definition at line 252 of file MissionController.h.
Referenced by TerrainProfile::setMissionController().
|
signal |
Referenced by TerrainProfile::setMissionController().
|
inline |
Definition at line 253 of file MissionController.h.
|
staticconstexpr |
Definition at line 299 of file MissionController.h.
|
staticconstexpr |
Definition at line 301 of file MissionController.h.
|
staticconstexpr |
Definition at line 304 of file MissionController.h.
|
staticconstexpr |
Definition at line 300 of file MissionController.h.
|
staticconstexpr |
Definition at line 298 of file MissionController.h.
|
staticconstexpr |
Definition at line 302 of file MissionController.h.
|
staticconstexpr |
Definition at line 303 of file MissionController.h.