Commit 19506a7a authored by Bryant's avatar Bryant

Merge branch 'master' of https://github.com/mavlink/qgroundcontrol into restyling

Conflicts:
	src/ui/MainWindow.cc
parents 9619b503 a23be949
......@@ -114,6 +114,9 @@ signals:
/** @brief Selected sim version changed */
void versionChanged(const QString& version);
/** @brief Selected sim version changed */
void versionChanged(const int version);
/** @brief Sensor leve HIL state changed */
void sensorHilChanged(bool enabled);
};
......
......@@ -54,7 +54,7 @@ QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress
simUpdateLast(QGC::groundTimeMilliseconds()),
simUpdateLastText(QGC::groundTimeMilliseconds()),
simUpdateHz(0),
_sensorHilEnabled(true)
_sensorHilEnabled(false)
{
this->localHost = localHost;
this->localPort = localPort/*+mav->getUASID()*/;
......
......@@ -11,7 +11,7 @@
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 1.0.9 (beta)"
#define QGC_APPLICATION_VERSION "v. 1.0.9 (beta RC1)"
namespace QGC
......
This diff is collapsed.
......@@ -33,7 +33,7 @@ This file is part of the QGROUNDCONTROL project
#define UASWAYPOINTMANAGER_H
#include <QObject>
#include <QVector>
#include <QList>
#include <QTimer>
#include "Waypoint.h"
#include "QGCMAVLink.h"
......@@ -44,7 +44,7 @@ class UASInterface;
* @brief Implementation of the MAVLINK waypoint protocol
*
* This class handles the communication with a waypoint manager on the MAV.
* All waypoints are stored in the QVector waypoints, modifications can be done with the WaypointList widget.
* All waypoints are stored in the QList waypoints, modifications can be done with the WaypointList widget.
* Notice that currently the access to the internal waypoint storage is not guarded nor thread-safe. This works as long as no other widget alters the data.
*
* See http://qgroundcontrol.org/waypoint_protocol for more information about the protocol and the states.
......@@ -91,15 +91,15 @@ public:
/** @name Waypoint list operations */
/*@{*/
const QVector<Waypoint *> &getWaypointEditableList(void) {
const QList<Waypoint *> &getWaypointEditableList(void) {
return waypointsEditable; ///< Returns a const reference to the waypoint list.
}
const QVector<Waypoint *> &getWaypointViewOnlyList(void) {
const QList<Waypoint *> &getWaypointViewOnlyList(void) {
return waypointsViewOnly; ///< Returns a const reference to the waypoint list.
}
const QVector<Waypoint *> getGlobalFrameWaypointList(); ///< Returns a global waypoint list
const QVector<Waypoint *> getGlobalFrameAndNavTypeWaypointList(); ///< Returns a global waypoint list containing only waypoints suitable for navigation. Actions and other mission items are filtered out.
const QVector<Waypoint *> getNavTypeWaypointList(); ///< Returns a waypoint list containing only waypoints suitable for navigation. Actions and other mission items are filtered out.
const QList<Waypoint *> getGlobalFrameWaypointList(); ///< Returns a global waypoint list
const QList<Waypoint *> getGlobalFrameAndNavTypeWaypointList(); ///< Returns a global waypoint list containing only waypoints suitable for navigation. Actions and other mission items are filtered out.
const QList<Waypoint *> getNavTypeWaypointList(); ///< Returns a waypoint list containing only waypoints suitable for navigation. Actions and other mission items are filtered out.
int getIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list
int getGlobalFrameIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only global waypoints
int getGlobalFrameAndNavTypeIndexOf(Waypoint* wp); ///< Get the index of a waypoint in the list, counting only global AND navigation mode waypoints
......@@ -112,9 +112,11 @@ public:
int getLocalFrameCount(); ///< Get the count of local waypoints in the list
/*@}*/
UAS* getUAS() {
return this->uas; ///< Returns the owning UAS
}
UAS* getUAS();
float getAltitudeRecommendation();
int getFrameRecommendation();
float getAcceptanceRadiusRecommendation();
float getHomeAltitudeOffsetDefault();
private:
/** @name Message send functions */
......@@ -169,13 +171,16 @@ private:
quint8 current_partner_compid; ///< The current protocol communication target component
bool read_to_edit; ///< If true, after readWaypoints() incoming waypoints will be copied both to "edit"-tab and "view"-tab. Otherwise, only to "view"-tab.
QVector<Waypoint *> waypointsViewOnly; ///< local copy of current waypoint list on MAV
QVector<Waypoint *> waypointsEditable; ///< local editable waypoint list
QList<Waypoint *> waypointsViewOnly; ///< local copy of current waypoint list on MAV
QList<Waypoint *> waypointsEditable; ///< local editable waypoint list
Waypoint* currentWaypointEditable; ///< The currently used waypoint
QVector<mavlink_mission_item_t *> waypoint_buffer; ///< buffer for waypoints during communication
QList<mavlink_mission_item_t *> waypoint_buffer; ///< buffer for waypoints during communication
QTimer protocol_timer; ///< Timer to catch timeouts
bool standalone; ///< If standalone is set, do not write to UAS
quint16 uasid;
// XXX export to settings
static const float defaultAltitudeHomeOffset = 30.0f; ///< Altitude offset in meters from home for new waypoints
};
#endif // UASWAYPOINTMANAGER_H
......@@ -854,6 +854,9 @@ void HSIDisplay::setMetricWidth(double width)
*/
void HSIDisplay::setActiveUAS(UASInterface* uas)
{
if (!uas)
return;
if (this->uas != NULL) {
disconnect(this->uas, SIGNAL(gpsSatelliteStatusChanged(int,int,float,float,float,bool)), this, SLOT(updateSatellite(int,int,float,float,float,bool)));
disconnect(this->uas, SIGNAL(localPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateLocalPosition(UASInterface*,double,double,double,quint64)));
......@@ -1231,7 +1234,7 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
if (uas)
{
// Grab all waypoints.
const QVector<Waypoint*>& list = uas->getWaypointManager()->getWaypointEditableList();
const QList<Waypoint*>& list = uas->getWaypointManager()->getWaypointEditableList();
const int numWaypoints = list.size();
// Do not work on empty lists
......
This diff is collapsed.
......@@ -233,7 +233,7 @@ public slots:
void closeEvent(QCloseEvent* event);
/** @brief Load data view, allowing to plot flight data */
void loadDataView(QString fileName);
// void loadDataView(QString fileName);
/**
* @brief Shows a Docked Widget based on the action sender
......@@ -354,7 +354,7 @@ protected:
QPointer<SubMainWindow> plannerView;
QPointer<SubMainWindow> pilotView;
QPointer<SubMainWindow> configView;
QPointer<SubMainWindow> dataView;
QPointer<SubMainWindow> mavlinkView;
QPointer<SubMainWindow> engineeringView;
QPointer<SubMainWindow> simView;
......
......@@ -22,9 +22,9 @@ QGCHilConfiguration::QGCHilConfiguration(UAS *mav, QWidget *parent) :
int i = settings.value("SIMULATOR_INDEX", -1).toInt();
if (i > 0) {
ui->simComboBox->blockSignals(true);
// ui->simComboBox->blockSignals(true);
ui->simComboBox->setCurrentIndex(i);
ui->simComboBox->blockSignals(false);
// ui->simComboBox->blockSignals(false);
on_simComboBox_currentIndexChanged(i);
}
......@@ -46,6 +46,11 @@ QGCHilConfiguration::~QGCHilConfiguration()
delete ui;
}
void QGCHilConfiguration::setVersion(QString version)
{
}
void QGCHilConfiguration::on_simComboBox_currentIndexChanged(int index)
{
//clean up
......
......@@ -21,6 +21,7 @@ public:
public slots:
/** @brief Receive status message */
void receiveStatusMessage(const QString& message);
void setVersion(QString version);
protected:
UAS* mav;
......
......@@ -32,12 +32,19 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QWidget *
ui->sensorHilCheckBox->setChecked(link->sensorHilEnabled());
connect(link, SIGNAL(sensorHilChanged(bool)), ui->sensorHilCheckBox, SLOT(setChecked(bool)));
connect(ui->sensorHilCheckBox, SIGNAL(clicked(bool)), link, SLOT(enableSensorHIL(bool)));
connect(link, SIGNAL(versionChanged(int)), this, SLOT(setVersion(int)));
}
ui->hostComboBox->clear();
ui->hostComboBox->addItem(link->getRemoteHost());
}
void QGCHilXPlaneConfiguration::setVersion(int version)
{
}
void QGCHilXPlaneConfiguration::toggleSimulation(bool connect)
......
......@@ -20,6 +20,8 @@ public:
public slots:
/** @brief Start / stop simulation */
void toggleSimulation(bool connect);
/** @brief Set X-Plane version */
void setVersion(int version);
protected:
QGCHilLink* link;
......
......@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<height>148</height>
<width>570</width>
<height>238</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,100" columnstretch="40,10,10,40">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,100" columnstretch="20,40,40,20">
<property name="margin">
<number>0</number>
</property>
......
......@@ -3,6 +3,7 @@
#include <QDesktopServices>
#include "MainWindow.h"
#include "SerialLink.h"
#include "QGCMAVLinkLogPlayer.h"
#include "QGC.h"
#include "ui_QGCMAVLinkLogPlayer.h"
......@@ -361,6 +362,22 @@ bool QGCMAVLinkLogPlayer::loadLogFile(const QString& file)
// Reset current state
reset(0);
// Check if a serial link is connected
bool linkWarning = false;
foreach (LinkInterface* link, LinkManager::instance()->getLinks())
{
SerialLink* s = dynamic_cast<SerialLink*>(link);
if (s && s->isConnected())
linkWarning = true;
}
if (linkWarning)
MainWindow::instance()->showInfoMessage(tr("Active MAVLink links found"), tr("Currently other links are connected. It is recommended to disconnect any active link before replaying a log."));
play();
return true;
}
}
......
......@@ -46,6 +46,16 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
// Do not load UI, wait for actions
}
void QGCToolBar::globalPositionChanged(UASInterface* uas, double lat, double lon, double alt, quint64 usec)
{
Q_UNUSED(uas);
Q_UNUSED(lat);
Q_UNUSED(lon);
Q_UNUSED(usec);
altitudeMSL = alt;
changed = true;
}
void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
{
// set timeout label visible
......@@ -278,6 +288,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
disconnect(mav, SIGNAL(batteryChanged(UASInterface*,double,double,int)), this, SLOT(updateBatteryRemaining(UASInterface*,double,double,int)));
disconnect(mav, SIGNAL(armingChanged(bool)), this, SLOT(updateArmingState(bool)));
disconnect(mav, SIGNAL(heartbeatTimeout(bool, unsigned int)), this, SLOT(heartbeatTimeout(bool,unsigned int)));
disconnect(active, SIGNAL(globalPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(globalPositionChanged(UASInterface*,double,double,double,quint64)));
if (mav->getWaypointManager())
{
disconnect(mav->getWaypointManager(), SIGNAL(currentWaypointChanged(quint16)), this, SLOT(updateCurrentWaypoint(quint16)));
......@@ -295,6 +306,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
connect(active, SIGNAL(batteryChanged(UASInterface*,double,double,int)), this, SLOT(updateBatteryRemaining(UASInterface*,double,double,int)));
connect(active, SIGNAL(armingChanged(bool)), this, SLOT(updateArmingState(bool)));
connect(active, SIGNAL(heartbeatTimeout(bool, unsigned int)), this, SLOT(heartbeatTimeout(bool,unsigned int)));
connect(active, SIGNAL(globalPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(globalPositionChanged(UASInterface*,double,double,double,quint64)));
if (active->getWaypointManager())
{
connect(active->getWaypointManager(), SIGNAL(currentWaypointChanged(quint16)), this, SLOT(updateCurrentWaypoint(quint16)));
......@@ -311,6 +323,7 @@ void QGCToolBar::setActiveUAS(UASInterface* active)
toolBarStateLabel->setText(mav->getShortState());
toolBarTimeoutLabel->setStyleSheet(QString(""));
toolBarTimeoutLabel->setText("");
toolBarDistLabel->setText("");
setSystemType(mav, mav->getSystemType());
}
......@@ -330,7 +343,9 @@ void QGCToolBar::updateArmingState(bool armed)
void QGCToolBar::updateView()
{
if (!changed) return;
toolBarDistLabel->setText(tr("%1 m").arg(wpDistance, 6, 'f', 2, '0'));
//toolBarDistLabel->setText(tr("%1 m").arg(wpDistance, 6, 'f', 2, '0'));
// XXX add also rel altitude
toolBarDistLabel->setText(QString("%1 m MSL").arg(altitudeMSL, 6, 'f', 2, '0'));
toolBarWpLabel->setText(tr("WP%1").arg(wpId));
toolBarBatteryBar->setValue(batteryPercent);
if (batteryPercent < 30 && toolBarBatteryBar->value() >= 30) {
......
......@@ -74,6 +74,8 @@ public slots:
void updateView();
/** @brief Update connection timeout time */
void heartbeatTimeout(bool timeout, unsigned int ms);
/** @brief Update global position */
void globalPositionChanged(UASInterface* uas, double lat, double lon, double alt, quint64 usec);
/** @brief Create or connect link */
void connectLink(bool connect);
/** @brief Clear status string */
......@@ -106,6 +108,8 @@ protected:
float batteryVoltage;
int wpId;
double wpDistance;
float altitudeMSL;
float altitudeRel;
QString state;
QString mode;
QString systemName;
......
......@@ -39,6 +39,7 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
systemTypeToParamMap["FIXED_WING"] = new QMap<QString,QGCToolWidget*>();
systemTypeToParamMap["QUADROTOR"] = new QMap<QString,QGCToolWidget*>();
systemTypeToParamMap["GROUND_ROVER"] = new QMap<QString,QGCToolWidget*>();
systemTypeToParamMap["BOAT"] = new QMap<QString,QGCToolWidget*>();
libParamToWidgetMap = new QMap<QString,QGCToolWidget*>();
setObjectName("QGC_VEHICLECONFIG");
......@@ -726,6 +727,8 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
{
//Indication that we have no meta data for this system type.
qDebug() << "No parameters defined for system type:" << mav->getSystemTypeName();
systemTypeToParamMap[mav->getSystemTypeName()] = new QMap<QString,QGCToolWidget*>();
paramToWidgetMap = systemTypeToParamMap[mav->getSystemTypeName()];
}
if (!paramTooltips.isEmpty())
......
......@@ -12,7 +12,7 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(systemCreated(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(systemSetActive(int)));
WaypointList* list = new WaypointList(ui->stackedWidget, NULL);
WaypointList* list = new WaypointList(ui->stackedWidget, UASManager::instance()->getActiveUASWaypointManager());
lists.insert(offline_uas_id, list);
ui->stackedWidget->addWidget(list);
......@@ -40,7 +40,7 @@ void QGCWaypointListMulti::systemDeleted(QObject* uas)
void QGCWaypointListMulti::systemCreated(UASInterface* uas)
{
WaypointList* list = new WaypointList(ui->stackedWidget, uas);
WaypointList* list = new WaypointList(ui->stackedWidget, uas->getWaypointManager());
lists.insert(uas->getUASID(), list);
ui->stackedWidget->addWidget(list);
// Ensure widget is deleted when system is deleted
......
......@@ -218,6 +218,9 @@ void SerialConfigurationWindow::setupPortList()
// Get the ports available on this system
QVector<QString>* ports = link->getCurrentPorts();
QString storedName = this->link->getPortName();
bool storedFound = false;
// Add the ports in reverse order, because we prepend them to the list
for (int i = ports->size() - 1; i >= 0; --i)
{
......@@ -227,9 +230,14 @@ void SerialConfigurationWindow::setupPortList()
ui.portName->insertItem(0, ports->at(i));
if (!userConfigured) ui.portName->setEditText(ports->at(i));
}
// Check if the stored link name is still present
if (ports->at(i).contains(storedName) || storedName.contains(ports->at(i)))
storedFound = true;
}
ui.portName->setEditText(this->link->getPortName());
if (storedFound)
ui.portName->setEditText(storedName);
}
void SerialConfigurationWindow::enableFlowControl(bool flow)
......
This diff is collapsed.
......@@ -56,7 +56,7 @@ class WaypointList : public QWidget
Q_OBJECT
Q_DISABLE_COPY(WaypointList)
public:
WaypointList(QWidget* parent = NULL, UASInterface* uas = NULL);
WaypointList(QWidget* parent = NULL, UASWaypointManager* wpm = NULL);
virtual ~WaypointList();
public slots:
......@@ -77,9 +77,11 @@ public slots:
/** @brief Read the remote waypoint list to "view"-tab only*/
void refresh();
/** @brief Add a waypoint to "edit"-tab */
void addEditable();
void addEditable();
/** @brief Add a waypoint to "edit"-tab on current MAV position or on generic position (home) */
void addEditable(bool onCurrentPosition);
/** @brief Add a waypoint at the current MAV position */
int addCurrentPositionWaypoint();
void addCurrentPositionWaypoint();
/** @brief Add a waypoint by mouse click over the map */
//Update events
......
......@@ -260,11 +260,7 @@ void QGCParamSlider::endEditMode()
switch (parameterValue.type())
{
case QVariant::Char:
ui->intValueSpinBox->show();
break;
case QVariant::Int:
ui->intValueSpinBox->show();
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
break;
......@@ -378,14 +374,6 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->editSelectParamComboBox->addItem(parameterName, paramIndex);
}
if (this->parameterName == "RC5_MIN")
{
int stopper = 1;
}
if (parameterName == "RC5_MIN")
{
int stpoper = 1;
}
if (visibleParam != "")
{
if (parameterName == visibleParam)
......@@ -424,51 +412,51 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setRange(0, UINT8_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(255);
ui->editMaxSpinBox->setValue(UINT8_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QVariant::Int:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toInt());
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->intValueSpinBox->setRange(INT32_MIN, INT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMinSpinBox->setValue(0);
ui->editMaxSpinBox->setValue(INT32_MAX);
ui->editMinSpinBox->setValue(INT32_MIN);
}
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setMinimum(0);
ui->intValueSpinBox->setRange(0, UINT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMaxSpinBox->setValue(UINT32_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QMetaType::Float:
ui->doubleValueSpinBox->setValue(value.toFloat());
ui->doubleValueSpinBox->show();
ui->doubleValueSpinBox->setEnabled(true);
ui->intValueSpinBox->hide();
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(10000);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
break;
default:
qCritical() << "ERROR: NO VALID PARAM TYPE";
......
This diff is collapsed.
......@@ -834,7 +834,7 @@ Pixhawk3DWidget::moveWaypointPosition(void)
return;
}
const QVector<Waypoint *> waypoints =
const QList<Waypoint *> waypoints =
mActiveUAS->getWaypointManager()->getWaypointEditableList();
Waypoint* waypoint = waypoints.at(mSelectedWpIndex);
......@@ -882,7 +882,7 @@ Pixhawk3DWidget::moveWaypointHeading(void)
return;
}
const QVector<Waypoint *> waypoints =
const QList<Waypoint *> waypoints =
mActiveUAS->getWaypointManager()->getWaypointEditableList();
Waypoint* waypoint = waypoints.at(mSelectedWpIndex);
......@@ -929,7 +929,7 @@ Pixhawk3DWidget::setWaypointAltitude(void)
}
bool ok;
const QVector<Waypoint *> waypoints =
const QList<Waypoint *> waypoints =
mActiveUAS->getWaypointManager()->getWaypointEditableList();
Waypoint* waypoint = waypoints.at(mSelectedWpIndex);
......@@ -960,7 +960,7 @@ Pixhawk3DWidget::clearAllWaypoints(void)
{
if (mActiveUAS)
{
const QVector<Waypoint *> waypoints =
const QList<Waypoint *> waypoints =
mActiveUAS->getWaypointManager()->getWaypointEditableList();
for (int i = waypoints.size() - 1; i >= 0; --i)
{
......
......@@ -265,7 +265,7 @@ void QGCGoogleEarthView::updateWaypointList(int uas)
if (uasInstance)
{
// Get all waypoints, including non-global waypoints
QVector<Waypoint*> wpList = uasInstance->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
QList<Waypoint*> wpList = uasInstance->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
// Trim internal list to number of global waypoints in the waypoint manager list
javaScript(QString("updateWaypointListLength(%1,%2);").arg(uas).arg(wpList.count()));
......@@ -712,7 +712,7 @@ void QGCGoogleEarthView::updateState()
// Update waypoint or symbol
if (mav)
{
QVector<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
QList<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
bool ok;
int index = idText.toInt(&ok);
......
......@@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include <osg/ShapeDrawable>
#include "Imagery.h"
#include "UASManager.h"
WaypointGroupNode::WaypointGroupNode(const QColor& color)
: mColor(color)
......@@ -70,6 +71,16 @@ WaypointGroupNode::update(UASInterface* uas, MAV_FRAME frame)
Imagery::LLtoUTM(latitude, longitude, robotX, robotY, utmZone);
robotZ = -altitude;
}
else if (frame == MAV_FRAME_GLOBAL_RELATIVE_ALT)
{
double latitude = uas->getLatitude();
double longitude = uas->getLongitude();
double altitude = uas->getAltitude() + UASManager::instance()->getHomeAltitude();
QString utmZone;
Imagery::LLtoUTM(latitude, longitude, robotX, robotY, utmZone);
robotZ = -altitude;
}
else if (frame == MAV_FRAME_LOCAL_NED)
{
robotX = uas->getLocalX();
......@@ -82,7 +93,7 @@ WaypointGroupNode::update(UASInterface* uas, MAV_FRAME frame)
removeChild(0, getNumChildren());
}
const QVector<Waypoint *>& list = uas->getWaypointManager()->getWaypointEditableList();
const QList<Waypoint *>& list = uas->getWaypointManager()->getWaypointEditableList();
for (int i = 0; i < list.size(); i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment