Commit 6ba4def6 authored by Lorenz Meier's avatar Lorenz Meier

Adding waypoints also works without position

parent 9f94fef5
...@@ -246,12 +246,22 @@ void WaypointList::addEditable() ...@@ -246,12 +246,22 @@ void WaypointList::addEditable()
if (uas) if (uas)
{ {
// Create first waypoint at current MAV position // Create first waypoint at current MAV position
addCurrentPositionWaypoint(); if (uas->localPositionKnown() || uas->globalPositionKnown())
{
addCurrentPositionWaypoint();
}
else
{
// MAV connected, but position unknown, add default waypoint
updateStatusLabel(tr("WARNING: No position known. Adding default LOCAL (NED) waypoint"));
wp = new Waypoint(0, 0, 0, -0.50, 0, 0.20, 0, 0,true, true, MAV_FRAME_LOCAL_NED, MAV_CMD_NAV_WAYPOINT);
WPM->addWaypointEditable(wp);
}
} }
else else
{ {
//Since no UAV available, create first default waypoint. //Since no UAV available, create first default waypoint.
updateStatusLabel(tr("No UAV. Added default LOCAL (NED) waypoint")); updateStatusLabel(tr("No UAV connected. Adding default LOCAL (NED) waypoint"));
wp = new Waypoint(0, 0, 0, -0.50, 0, 0.20, 0, 0,true, true, MAV_FRAME_LOCAL_NED, MAV_CMD_NAV_WAYPOINT); wp = new Waypoint(0, 0, 0, -0.50, 0, 0.20, 0, 0,true, true, MAV_FRAME_LOCAL_NED, MAV_CMD_NAV_WAYPOINT);
WPM->addWaypointEditable(wp); WPM->addWaypointEditable(wp);
//create a popup notifying the user about the limitations of offline editing //create a popup notifying the user about the limitations of offline editing
......
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