Commit 277b7200 authored by pixhawk's avatar pixhawk

Added "Onboard Waypoints"-support for all loiter commands

parent 6187d71c
......@@ -34,7 +34,6 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
// CUSTOM COMMAND WIDGET
customCommand->setupUi(m_ui->customActionWidget);
// add actions
m_ui->comboBox_action->addItem(tr("NAV: Waypoint"),MAV_CMD_NAV_WAYPOINT);
m_ui->comboBox_action->addItem(tr("NAV: TakeOff"),MAV_CMD_NAV_TAKEOFF);
......@@ -43,7 +42,7 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
m_ui->comboBox_action->addItem(tr("NAV: Loiter Turns"),MAV_CMD_NAV_LOITER_TURNS);
m_ui->comboBox_action->addItem(tr("NAV: Ret. to Launch"),MAV_CMD_NAV_RETURN_TO_LAUNCH);
m_ui->comboBox_action->addItem(tr("NAV: Land"),MAV_CMD_NAV_LAND);
// m_ui->comboBox_action->addItem(tr("NAV: Target"),MAV_CMD_NAV_TARGET);
//m_ui->comboBox_action->addItem(tr("NAV: Target"),MAV_CMD_NAV_TARGET);
//m_ui->comboBox_action->addItem(tr("IF: Delay over"),MAV_CMD_CONDITION_DELAY);
//m_ui->comboBox_action->addItem(tr("IF: Yaw angle is"),MAV_CMD_CONDITION_YAW);
//m_ui->comboBox_action->addItem(tr("DO: Jump to Index"),MAV_CMD_DO_JUMP);
......
......@@ -49,7 +49,6 @@ namespace Ui
class WaypointEditableView;
}
class Ui_QGCCustomWaypointAction;
class WaypointEditableView : public QWidget
{
Q_OBJECT
......@@ -83,7 +82,7 @@ protected:
Waypoint* wp;
// Special widgets extendending the
// waypoint view to mission capabilities
Ui_QGCCustomWaypointAction* customCommand;
Ui_QGCCustomWaypointAction* customCommand;
QGC_WAYPOINTEDITABLEVIEW_MODE viewMode;
private:
......
......@@ -465,16 +465,16 @@ QPushButton:pressed {
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Loiter radius</string>
<string>Loiter radius. Negative for counter-clockwise</string>
</property>
<property name="statusTip">
<string>Loiter radius</string>
<string>Loiter radius. Negative for counter-clockwise</string>
</property>
<property name="suffix">
<string> m</string>
</property>
<property name="minimum">
<double>0.050000000000000</double>
<double>-5000.000000000000000</double>
</property>
<property name="maximum">
<double>5000.000000000000000</double>
......@@ -519,11 +519,10 @@ where to accept this waypoint as reached</string>
</sizepolicy>
</property>
<property name="toolTip">
<string>Rotaty wing and ground vehicles only:
Time to stay at this position before advancing</string>
<string>Time to stay/loiter at this position before advancing</string>
</property>
<property name="statusTip">
<string>Rotaty wing and ground vehicles only: Time to stay at this position before advancing</string>
<string>Time to stay/loiter at this position before advancing</string>
</property>
<property name="suffix">
<string> s</string>
......
......@@ -209,6 +209,110 @@ void WaypointViewOnlyView::updateValues()
} //end Frame switch
break;
}
case MAV_CMD_NAV_LOITER_UNLIM:
{
switch (wp->getFrame())
{
case MAV_FRAME_GLOBAL_RELATIVE_ALT:
case MAV_FRAME_GLOBAL:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there indefinitely (clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(wp->getParam3()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there indefinitely (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()));
}
break;
}
case MAV_FRAME_LOCAL_NED:
default:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there indefinitely (clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f',2).arg(wp->getParam3()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there indefinitely (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()));
}
break;
}
} //end Frame switch
break;
}
case MAV_CMD_NAV_LOITER_TURNS:
{
switch (wp->getFrame())
{
case MAV_FRAME_GLOBAL_RELATIVE_ALT:
case MAV_FRAME_GLOBAL:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there for %5 turns (clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(wp->getParam3()).arg(wp->getParam1()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there for %5 turns (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()).arg(wp->getParam1()));
}
break;
}
case MAV_FRAME_LOCAL_NED:
default:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there for %5 turns (clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f',2).arg(wp->getParam3()).arg(wp->getParam1()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there for %5 turns (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()).arg(wp->getParam1()));
}
break;
}
} //end Frame switch
break;
}
case MAV_CMD_NAV_LOITER_TIME:
{
switch (wp->getFrame())
{
case MAV_FRAME_GLOBAL_RELATIVE_ALT:
case MAV_FRAME_GLOBAL:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there for %5s (clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(wp->getParam3()).arg(wp->getParam1()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(</b>lat <b>%1<sup>o</sup></b>, lon <b>%2<sup>o</sup></b>, alt <b>%3)</b> and loiter there for %5s (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 7).arg(wp->getY(),0, 'f', 7).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()).arg(wp->getParam1()));
}
break;
}
case MAV_FRAME_LOCAL_NED:
default:
{
if (wp->getParam3()>=0)
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there for %5s (clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f',2).arg(wp->getParam3()).arg(wp->getParam1()));
}
else
{
m_ui->displayBar->setText(QString("Go to <b>(%1, %2, %3)</b> and loiter there for %5s (counter-clockwise); rad: %4").arg(wp->getX(),0, 'f', 2).arg(wp->getY(),0, 'f', 2).arg(wp->getZ(),0, 'f', 2).arg(-wp->getParam3()).arg(wp->getParam1()));
}
break;
}
} //end Frame switch
break;
}
case MAV_CMD_NAV_RETURN_TO_LAUNCH:
{
m_ui->displayBar->setText(QString("Return to launch location"));
break;
}
case MAV_CMD_NAV_LAND:
{
switch (wp->getFrame())
......
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