Commit 46978c3e authored by Valentin Platzgummer's avatar Valentin Platzgummer

working on DefaultManager.cpp

parent bff9eea2
This diff is collapsed.
This diff is collapsed.
......@@ -237,9 +237,10 @@ void CircularSurveyComplexItem::_buildAndAppendMissionItems(QList<MissionItem*>&
MissionItem* item;
int seqNum = _sequenceNumber;
MAV_FRAME mavFrame = followTerrain() || !_cameraCalc.distanceToSurfaceRelative() ? MAV_FRAME_GLOBAL : MAV_FRAME_GLOBAL_RELATIVE_ALT;
MAV_FRAME mavFrame = followTerrain() || !_cameraCalc.distanceToSurfaceRelative()
? MAV_FRAME_GLOBAL : MAV_FRAME_GLOBAL_RELATIVE_ALT;
for (const QList<TransectStyleComplexItem::CoordInfo_t>& transect: _transects) {
for (const QList<TransectStyleComplexItem::CoordInfo_t>& transect : _transects) {
//bool transectEntry = true;
for (const CoordInfo_t& transectCoordInfo: transect) {
......@@ -392,7 +393,7 @@ void CircularSurveyComplexItem::_rebuildTransectsSlow()
if (!_rebuildTransectsInputCheck(surveyPolygon))
return;
// If the transects are getting rebuilt then any previously loaded mission items are now invalid
// If the transects are getting rebuilt then any previously loaded mission items are now invalid.
if (_loadedMissionItemsParent) {
_loadedMissionItems.clear();
_loadedMissionItemsParent->deleteLater();
......@@ -446,7 +447,10 @@ void CircularSurveyComplexItem::_rebuildTransectsSlow()
reversePath ^= true; // toggle
optimizedPath.append(connectorPath);
connectorPath.pop_front();
connectorPath.pop_back();
if (connectorPath.size() > 0)
optimizedPath.append(connectorPath);
optimizedPath.append(currentSection);
}
if (optimizedPath.size() > _maxWaypoints.rawValue().toInt())
......
......@@ -3,6 +3,8 @@
#include "Wima/Geometry/PolygonCalculus.h"
#include "MissionSettingsItem.h"
#include "SimpleMissionItem.h"
WaypointManager::DefaultManager::DefaultManager(Settings &settings,
AreaInterface &interface)
......@@ -67,11 +69,11 @@ bool WaypointManager::DefaultManager::_insertMissionItem(const QGeoCoordinate &c
list,
_settings->vehicle(),
_settings->isFlyView(),
&_currentMissionItems /*parent*/,
&list /*parent*/,
doUpdate /*do update*/) )
{
Q_ASSERT(false);
qWarning("WaypointManager::DefaultManager::next(): insertMissionItem failed.");
Q_ASSERT(false);
return false;
}
return true;
......@@ -115,34 +117,37 @@ bool WaypointManager::DefaultManager::_worker()
if (_dirty) {
_missionItems.clearAndDeleteContents();
_waypointsVariant.clear();
initialize(_missionItems, _settings->vehicle(), _settings->isFlyView());
// No initialization of _missionItems, don't need MissionSettingsItem here.
for (size_t i = 0; i < size_t(_waypoints.size()); ++i) {
const QGeoCoordinate &c = _waypoints.at(i);
auto &c = _waypoints.at(i);
_insertMissionItem(c, _missionItems.count(), _missionItems, false /*update list*/);
_waypointsVariant.push_back(QVariant::fromValue(c));
}
Q_ASSERT(_missionItems.value<MissionSettingsItem*>(0) != nullptr);
doUpdate(_missionItems);
updateHirarchy(_missionItems);
updateSequenceNumbers(_missionItems, 1); // Start with 1, since MissionSettingsItem missing.
_dirty = false;
}
_currentMissionItems.clearAndDeleteContents();
initialize(_currentMissionItems, _settings->vehicle(), _settings->isFlyView());
// calculate path from home to first waypoint
QVector<QGeoCoordinate> arrivalPath;
// Precondition.
if (!_settings->homePosition().isValid()){
qWarning("WaypointManager::DefaultManager::next(): home position invalid.");
Q_ASSERT(false);
return false;
}
// Calculate path from home to first waypoint.
QVector<QGeoCoordinate> arrivalPath;
if ( !_calcShortestPath(_settings->homePosition(), _currentWaypoints.first(), arrivalPath) ) {
qWarning("WaypointManager::DefaultManager::next(): Not able to calc path from home position to first waypoint.");
return false;
}
arrivalPath.removeFirst();
if (!arrivalPath.empty())
arrivalPath.removeFirst();
if (!arrivalPath.empty())
arrivalPath.removeLast();
// calculate path from last waypoint to home
QVector<QGeoCoordinate> returnPath;
......@@ -150,8 +155,10 @@ bool WaypointManager::DefaultManager::_worker()
qWarning("WaypointManager::DefaultManager::next(): Not able to calc path from home position to last waypoint.");
return false;
}
returnPath.removeFirst();
returnPath.removeLast();
if (!returnPath.empty())
returnPath.removeFirst();
if (!returnPath.empty())
returnPath.removeLast();
......@@ -165,28 +172,25 @@ bool WaypointManager::DefaultManager::_worker()
}
settingsItem->setCoordinate(_settings->homePosition());
// Set takeoff position for first mission item (bug).
// First mission item is takeoff command.
_insertMissionItem(_settings->homePosition(), 1 /*insertion index*/, false /*do update*/);
SimpleMissionItem *takeoffItem = _currentMissionItems.value<SimpleMissionItem*>(1);
if (takeoffItem == nullptr) {
Q_ASSERT(false);
qWarning("WaypointManager::DefaultManager::next(): nullptr.");
Q_ASSERT(takeoffItem != nullptr);
return false;
}
takeoffItem->setCoordinate(_settings->homePosition());
makeTakeOffCmd(takeoffItem, _settings->masterController()->managerVehicle());
// Create change speed item.
_insertMissionItem(_settings->homePosition(), 2 /*insertion index*/, false /*do update*/);
SimpleMissionItem *speedItem = _currentMissionItems.value<SimpleMissionItem*>(2);
if (speedItem == nullptr) {
Q_ASSERT(false);
qWarning("WaypointManager::DefaultManager::next(): nullptr.");
Q_ASSERT(speedItem != nullptr);
return false;
}
speedItem->setCommand(MAV_CMD_DO_CHANGE_SPEED);
// Set coordinate must be after setCommand (setCommand sets coordinate to zero).
speedItem->setCoordinate(_settings->homePosition());
speedItem->missionItem().setParam2(_settings->arrivalReturnSpeed());
makeSpeedCmd(speedItem, _settings->arrivalReturnSpeed());
// insert arrival path
for (auto coordinate : arrivalPath) {
......@@ -204,9 +208,7 @@ bool WaypointManager::DefaultManager::_worker()
qWarning("WaypointManager::DefaultManager::next(): nullptr.");
return false;
}
speedItem->setCommand(MAV_CMD_DO_CHANGE_SPEED); // set coordinate must be after setCommand (setCommand sets coordinate to zero)
speedItem->setCoordinate(_currentWaypoints.first());
speedItem->missionItem().setParam2(_settings->flightSpeed());
makeSpeedCmd(speedItem, _settings->flightSpeed());
// Insert slice.
for (auto coordinate : _currentWaypoints) {
......
......@@ -15,7 +15,11 @@ typedef GenericWaypointManager<QGeoCoordinate,
QmlObjectListModel,
Settings>
ManagerBase;
//!
//! \brief The DefaultManager class is used to manage SimpleMissionItems.
//!
//! @note The \class QmlObjectList returned by \fn missionItems doesn't contain a MissionSettingsItem.
//! This list is supposed to be used for display purposes only.
class DefaultManager : public ManagerBase
{
public:
......
......@@ -38,11 +38,6 @@ int Slicer::startIndex()
return _idxStart;
}
Slicer &Slicer::operator=(const Slicer &other)
{
}
void Slicer::_updateIdx(std::size_t size)
{
_idxValid = true;
......
......@@ -46,8 +46,6 @@ public:
//! @return Returns the start index.
int startIndex ();
Slicer &operator=(const Slicer &other);
private:
void _updateIdx(std::size_t size);
......
#include "Utils.h"
#include "MissionSettingsItem.h"
#include <iostream>
#include <QGeoCoordinate>
template<>
......@@ -28,25 +31,12 @@ bool WaypointManager::Utils::insertMissionItem(const QGeoCoordinate &coordinate,
int sequenceNumber = detail::nextSequenceNumber(list);
newItem->setSequenceNumber(sequenceNumber);
newItem->setCoordinate(coordinate);
// Set command (takeoff if first command).
newItem->setCommand(MAV_CMD_NAV_WAYPOINT);
if (list.count() == 1
&& ( vehicle->fixedWing()
|| vehicle->vtol()
|| vehicle->multiRotor() ) ) {
MAV_CMD takeoffCmd = vehicle->vtol()
? MAV_CMD_NAV_VTOL_TAKEOFF
: MAV_CMD_NAV_TAKEOFF;
if (vehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
newItem->setCommand(takeoffCmd);
}
}
// Set altitude and altitude mode from previous item.
if (newItem->specifiesAltitude()) {
double altitude;
int altitudeMode;
double altitude = 10;
int altitudeMode = QGroundControlQmlGlobal::AltitudeModeRelative;
if (detail::previousAltitude(list, index-1, altitude, altitudeMode)) {
newItem->altitude()->setRawValue(altitude);
......@@ -59,9 +49,9 @@ bool WaypointManager::Utils::insertMissionItem(const QGeoCoordinate &coordinate,
list.insert(index, newItem);
if ( doUpdates ) {
detail::updateSequenceNumbers(list, index);
detail::updateHirarchy(list);
detail::updateHomePosition(list);
updateSequenceNumbers(list);
updateHirarchy(list);
updateHomePosition(list);
}
}
return true;
......@@ -104,30 +94,27 @@ bool WaypointManager::Utils::detail::previousAltitude(QmlObjectListModel &list,
return false;
}
bool WaypointManager::Utils::detail::updateSequenceNumbers(QmlObjectListModel &list, size_t startIdx)
bool WaypointManager::Utils::updateSequenceNumbers(QmlObjectListModel &list, size_t firstSeqNumber)
{
using namespace WaypointManager::Utils;
if ( list.count() < 1 || startIdx >= size_t(list.count()) )
if ( list.count() < 1)
return false;
// Setup ascending sequence numbers for all visual items.
VisualMissionItem* startItem = list.value<VisualMissionItem*>(
std::max(long(startIdx)-1,long(0)) );
if (list.count() == 1){
startItem->setSequenceNumber(0);
} else {
int sequenceNumber = startItem->lastSequenceNumber() + 1;
for (int i=startIdx; i < list.count(); ++i) {
VisualMissionItem* item = list.value<VisualMissionItem*>(i);
item->setSequenceNumber(sequenceNumber);
sequenceNumber = item->lastSequenceNumber() + 1;
}
VisualMissionItem* startItem = list.value<VisualMissionItem*>(0);
assert(startItem != nullptr); // list empty?
startItem->setSequenceNumber(firstSeqNumber);
int sequenceNumber = startItem->lastSequenceNumber() + 1;
for (int i=1; i < list.count(); ++i) {
VisualMissionItem* item = list.value<VisualMissionItem*>(i);
item->setSequenceNumber(sequenceNumber);
sequenceNumber = item->lastSequenceNumber() + 1;
}
return true;
}
bool WaypointManager::Utils::detail::updateHirarchy(QmlObjectListModel &list)
bool WaypointManager::Utils::updateHirarchy(QmlObjectListModel &list)
{
if ( list.count() < 1)
return false;
......@@ -150,7 +137,7 @@ bool WaypointManager::Utils::detail::updateHirarchy(QmlObjectListModel &list)
return true;
}
bool WaypointManager::Utils::detail::updateHomePosition(QmlObjectListModel &list)
bool WaypointManager::Utils::updateHomePosition(QmlObjectListModel &list)
{
MissionSettingsItem *settingsItem = list.value<MissionSettingsItem *>(0);
assert(settingsItem); // list not initialized?
......@@ -161,7 +148,7 @@ bool WaypointManager::Utils::detail::updateHomePosition(QmlObjectListModel &list
assert(item);
if (item->specifiesCoordinate() && item->coordinate().isValid()) {
QGeoCoordinate c = item->coordinate().atDistanceAndAzimuth(30, 0);
QGeoCoordinate c = item->coordinate().atDistanceAndAzimuth(3, 0);
c.setAltitude(0);
settingsItem->setCoordinate(c);
return true;
......@@ -179,13 +166,55 @@ void WaypointManager::Utils::initialize(QmlObjectListModel &list,
list.insert(0, settingsItem);
}
bool WaypointManager::Utils::doUpdate(QmlObjectListModel &list)
bool WaypointManager::Utils::updateList(QmlObjectListModel &list)
{
using namespace WaypointManager::Utils;
bool ret = detail::updateSequenceNumbers(list, 0);
ret = detail::updateHirarchy(list) == false ? false : ret;
(void)detail::updateHomePosition(list);
bool ret = updateSequenceNumbers(list);
ret = updateHirarchy(list) == false ? false : ret;
(void)updateHomePosition(list);
return ret;
}
void WaypointManager::Utils::printList(QmlObjectListModel &list)
{
for (int i = 0; i < list.count(); ++i) {
auto item = list.value<VisualMissionItem*>(i);
qWarning() << "list index: " << i << "\n"
<< "coordinate: " << item->coordinate() << "\n"
<< "seq: " << item->sequenceNumber() << "\n"
<< "last seq: " << item->lastSequenceNumber() << "\n"
<< "is simple item: " << item->isSimpleItem() << "\n\n";
}
}
bool WaypointManager::Utils::makeTakeOffCmd(SimpleMissionItem *item, Vehicle *vehicle)
{
if ( vehicle->fixedWing()
|| vehicle->vtol()
|| vehicle->multiRotor()
)
{
MAV_CMD takeoffCmd = vehicle->vtol()
? MAV_CMD_NAV_VTOL_TAKEOFF
: MAV_CMD_NAV_TAKEOFF;
if (vehicle->firmwarePlugin()->supportedMissionCommands().contains(takeoffCmd)) {
auto c = item->coordinate();
item->setCommand(takeoffCmd);
item->setCoordinate(c);
return true;
}
}
return false;
}
void WaypointManager::Utils::makeSpeedCmd(SimpleMissionItem *item, double speed)
{
assert(speed > 0);
auto c = item->coordinate();
item->setCommand(MAV_CMD_DO_CHANGE_SPEED);
// Set coordinate must be after setCommand (setCommand sets coordinate to zero).
item->setCoordinate(c);
item->missionItem().setParam2(speed);
}
#pragma once
#include "SimpleMissionItem.h"
#include "QmlObjectListModel.h"
#include "SimpleMissionItem.h"
#include <QVariant>
class Vehicle;
class QGeoCoordinate;
namespace WaypointManager {
namespace Utils {
......@@ -104,6 +110,21 @@ bool extract(const ContainerType<CoordinateType> &source,
return true;
}
//!
//! \brief Makes the SimpleMissionItem \p item a takeoff command.
//! \param item SimpleMissionItem
//! \param vehilce Vehicle.
//! \return Returns true if successfull, false either.
//!
bool makeTakeOffCmd(SimpleMissionItem *item, Vehicle *vehicle);
//!
//! \brief Makes the SimpleMissionItem \p item a MAV_CMD_DO_CHANGE_SPEED item.
//! \param item SimpleMissionItem.
//! \param speed Speed (must be greater zero).
//!
void makeSpeedCmd(SimpleMissionItem *item, double speed);
//!
//! \brief Initializes the list \p list.
......@@ -116,7 +137,7 @@ void initialize(QmlObjectListModel &list,
Vehicle *vehicle,
bool flyView=true);
//! @brief Creates (from QGeoCoordinate) and Inserts a SimpleMissionItem at the given index to list.
//! @brief Creates (from QGeoCoordinate) and inserts a SimpleMissionItem at the given index to list.
//! \param coordinate Coordinate of the SimpleMissionItem.
//! \param index Index to insert SimpleMissionItem.
//! \param list List of SimpleMissionItems.
......@@ -137,8 +158,42 @@ bool insertMissionItem(const QGeoCoordinate &coordinate,
bool flyView=true,
QObject *parent=nullptr,
bool doUpdates=true);
//!
//! \brief Performs a list update.
//!
//! Updates the home position of the MissionSettingsItem, the parent child hirarchy and the sequence numbers.
//! \param list List containing VisualMissionItems.
//! \return Returns true if no errors occured, false either.
bool updateList(QmlObjectListModel &list);
//! @brief Updates the sequence numbers of the VisualMissionItems inside \p list.
//!
//! \param list List containing VisualMissionItems.
//! \param firstSeqNumber The sequence number of the fisrt list entry (defaul = 0).
//! \return Returns true if successfull, false either.
//!
//! \note If the list \p list contains only one VisualMissionItem it's sequence number is
//! set to 0.
bool updateSequenceNumbers(QmlObjectListModel &list, size_t firstSeqNumber = 0);
//! @brief Update the parent child item hierarchy of the VisualMissionItems inside \p list.
//!
//! \param list List containing VisualMissionItems.
//! \return Returns true if successfull, false either.
//!
//! \note Returns true on success, false either.
bool updateHirarchy(QmlObjectListModel &list);
//! @brief Updates the home position to the first valid coordinate of the VisualMissionItems inside \p list.
//!
//! \param list List containing VisualMissionItems.
//! \return Returns true if the home position was updated, false either.
bool updateHomePosition(QmlObjectListModel &list);
bool doUpdate(QmlObjectListModel &list);
//!
//! \brief Prints the \p list.
//! \param list List containing VisualMissionItems.
void printList(QmlObjectListModel &list);
namespace detail {
size_t nextSequenceNumber(QmlObjectListModel &list);
......@@ -147,33 +202,6 @@ namespace detail {
double &altitude,
int &altitudeMode);
//! @brief Updates the sequence numbers of the VisualMissionItems inside \p list beginning from \p startIdx.
//!
//! Updates the sequence numbers of the VisualMissionItems inside \p list beginning from \pstartIdx.
//! \param list List containing VisualMissionItems.
//! \param startIdx Start index.
//! \return Returns true if successfull, false either.
//!
//! \note The function returns false immediatelly if the list \p list ist empty or
//! the \p startIdx is out of bounds.
//! \note If the list \p list contains only one VisualMissionItem it's sequence number is
//! set to 0.
bool updateSequenceNumbers(QmlObjectListModel &list, size_t startIdx=0);
//! @brief Update the parent child item hierarchy of the VisualMissionItems inside \p list.
//!
//! \param list List containing VisualMissionItems.
//! \return Returns true if successfull, false either.
//!
//! \note Returns true on success, false either.
bool updateHirarchy(QmlObjectListModel &list);
//! @brief Updates the home position to the first valid coordinate of the VisualMissionItems inside \p list.
//!
//! \param list List containing VisualMissionItems.
//! \return Returns true if the home position was updated, false either.
bool updateHomePosition(QmlObjectListModel &list);
} // namespace detail
} // namespace Utils
} // namespace WaypointManager
......@@ -128,6 +128,10 @@ QmlObjectListModel *WimaController::visualItems() {
return &_areas;
}
WimaDataContainer *WimaController::dataContainer() {
return _container;
}
QmlObjectListModel *WimaController::missionItems() {
return const_cast<QmlObjectListModel*>(&_currentManager.missionItems());
}
......@@ -146,6 +150,42 @@ QVariantList WimaController::currentWaypointPath()
return const_cast<QVariantList&>(_currentManager.currentWaypointsVariant());
}
Fact *WimaController::enableWimaController() {
return &_enableWimaController;
}
Fact *WimaController::overlapWaypoints() {
return &_overlapWaypoints;
}
Fact *WimaController::maxWaypointsPerPhase() {
return &_maxWaypointsPerPhase;
}
Fact *WimaController::startWaypointIndex() {
return &_nextPhaseStartWaypointIndex;
}
Fact *WimaController::showAllMissionItems() {
return &_showAllMissionItems;
}
Fact *WimaController::showCurrentMissionItems() {
return &_showCurrentMissionItems;
}
Fact *WimaController::flightSpeed() {
return &_flightSpeed;
}
Fact *WimaController::arrivalReturnSpeed() {
return &_arrivalReturnSpeed;
}
Fact *WimaController::altitude() {
return &_altitude;
}
//QStringList WimaController::loadNameFilters() const
//{
// QStringList filters;
......@@ -170,12 +210,12 @@ bool WimaController::uploadOverrideRequired() const
double WimaController::phaseDistance() const
{
return _phaseDistance;
return 0.0;
}
double WimaController::phaseDuration() const
{
return _phaseDuration;
return 0.0;
}
bool WimaController::vehicleHasLowBattery() const
......@@ -331,7 +371,7 @@ bool WimaController::calcReturnPath()
// qgcApp()->showMessage(errorString);
// return false;
// }
// return true;
return true;
}
void WimaController::executeSmartRTL()
......@@ -483,18 +523,19 @@ bool WimaController::_fetchContainerData()
// extract mission items
QList<MissionItem> tempMissionItems = planData.missionItems();
if (tempMissionItems.size() < 1) {
assert(false);
qWarning("WimaController: Mission items from WimaPlaner empty!");
return false;
}
for (auto item : tempMissionItems)
for (auto item : tempMissionItems) {
_defaultManager.push_back(item.coordinate());
}
_managerSettings.setHomePosition( QGeoCoordinate(_serviceArea.center().latitude(),
_serviceArea.center().longitude(),
0) );
if( !_defaultManager.update() ){
if( !_defaultManager.reset() ){
assert(false);
return false;
}
......@@ -586,13 +627,13 @@ bool WimaController::_calcNextPhase()
<< "overlap=" << _currentManager.overlap()
<< "N=" << _currentManager.N()
<< "startIndex=" << _currentManager.startIndex();
bool value;
_currentManager.setStartIndex(_nextPhaseStartWaypointIndex.rawValue().toUInt(&value));
Q_ASSERT(value);
(void)value;
qDebug() << "overlap=" << _currentManager.overlap()
<< "N=" << _currentManager.N()
<< "startIndex=" << _currentManager.startIndex();
// bool value;
// _currentManager.setStartIndex(_nextPhaseStartWaypointIndex.rawValue().toUInt(&value));
// Q_ASSERT(value);
// (void)value;
// qDebug() << "overlap=" << _currentManager.overlap()
// << "N=" << _currentManager.N()
// << "startIndex=" << _currentManager.startIndex();
if ( !_currentManager.next() ) {
assert(false);
......@@ -755,6 +796,7 @@ void WimaController::_eventTimerHandler()
void WimaController::_smartRTLCleanUp(bool flying)
{
(void)flying;
// if ( !flying) { // vehicle has landed
// if (_executingSmartRTL) {
......@@ -781,20 +823,22 @@ void WimaController::_enableDisableLowBatteryHandling(QVariant enable)
void WimaController::_setPhaseDistance(double distance)
{
if (!qFuzzyCompare(distance, _phaseDistance)) {
_phaseDistance = distance;
(void)distance;
// if (!qFuzzyCompare(distance, _phaseDistance)) {
// _phaseDistance = distance;
emit phaseDistanceChanged();
}
// emit phaseDistanceChanged();
// }
}
void WimaController::_setPhaseDuration(double duration)
{
if (!qFuzzyCompare(duration, _phaseDuration)) {
_phaseDuration = duration;
(void)duration;
// if (!qFuzzyCompare(duration, _phaseDuration)) {
// _phaseDuration = duration;
emit phaseDurationChanged();
}
// emit phaseDurationChanged();
// }
}
bool WimaController::_checkSmartRTLPreCondition(QString &errorString)
......@@ -977,9 +1021,3 @@ void WimaController::_progressFromJson(JsonDocUPtr pDoc,
emit WimaController::nemoProgressChanged();
}
template<>
QVariant getCoordinate<QVariant>(const SimpleMissionItem* item)
{
return QVariant::fromValue(item->coordinate());
}
......@@ -213,20 +213,20 @@ public:
// QStringList saveNameFilters (void) const;
// QString fileExtension (void) const { return wimaFileExtension; }
QGCMapPolygon joinedArea (void) const;
WimaDataContainer* dataContainer (void) { return _container; }
WimaDataContainer* dataContainer (void);
QmlObjectListModel* missionItems (void);
QmlObjectListModel* currentMissionItems (void);
QVariantList waypointPath (void);
QVariantList currentWaypointPath (void);
Fact* enableWimaController (void) { return &_enableWimaController; }
Fact* overlapWaypoints (void) { return &_overlapWaypoints; }
Fact* maxWaypointsPerPhase (void) { return &_maxWaypointsPerPhase; }
Fact* startWaypointIndex (void) { return &_nextPhaseStartWaypointIndex; }
Fact* showAllMissionItems (void) { return &_showAllMissionItems; }
Fact* showCurrentMissionItems(void) { return &_showCurrentMissionItems; }
Fact* flightSpeed (void) { return &_flightSpeed; }
Fact* arrivalReturnSpeed (void) { return &_arrivalReturnSpeed; }
Fact* altitude (void) { return &_altitude; }
Fact* enableWimaController (void);
Fact* overlapWaypoints (void);
Fact* maxWaypointsPerPhase (void);
Fact* startWaypointIndex (void);
Fact* showAllMissionItems (void);
Fact* showCurrentMissionItems(void);
Fact* flightSpeed (void);
Fact* arrivalReturnSpeed (void);
Fact* altitude (void);
Fact* enableSnake (void) { return &_enableSnake; }
Fact* snakeTileWidth (void) { return &_snakeTileWidth;}
......@@ -260,9 +260,9 @@ public:
Q_INVOKABLE bool uploadToVehicle();
Q_INVOKABLE bool forceUploadToVehicle();
Q_INVOKABLE void removeFromVehicle();
Q_INVOKABLE bool checkSmartRTLPreCondition(); // wrapper for _checkSmartRTLPreCondition(QString &errorString)
Q_INVOKABLE bool calcReturnPath(); // wrapper for _calcReturnPath(QString &errorSring)#
Q_INVOKABLE void executeSmartRTL(); // wrapper for _executeSmartRTL(QString &errorSring)
Q_INVOKABLE bool checkSmartRTLPreCondition();
Q_INVOKABLE bool calcReturnPath();
Q_INVOKABLE void executeSmartRTL();
Q_INVOKABLE void initSmartRTL();
Q_INVOKABLE void removeVehicleTrajectoryHistory();
......@@ -446,81 +446,4 @@ private:
};
/*
* The following explains the structure of
* _missionController.visualItems().
*
* Index Description
* --------------------------------------------
* 0 MissionSettingsItem
* 1 Takeoff Command
* 2 Speed Command: arrivalReturnSpeed
* 3 Arrival Path Waypoint 0
* ...
* 3+n-1 Arrival Path Waypoint n-1
* 3+n Speed Command: flightSpeed
* 3+n+1 Circular Survey Waypoint 0
* ...
* 3+n+m Circular Survey Waypoint m-1
* 3+n+m+1 Speed Command: arrivalReturnSpeed
* 3+n+m+2 Return Path Waypoint 0
* ...
* 3+n+m+2+l Return Path Waypoint l-1
<