Commit 3cf3cf3a authored by Thomas Gubler's avatar Thomas Gubler

use getAcceptanceRadiusRecommendation function to set default radius based on...

use getAcceptanceRadiusRecommendation function to set default radius based on airframe. With this commit airframe based radius setting now works for + button and double click in map and also for all waypoints (also the first one)
parent 8fe1a6ae
......@@ -1063,11 +1063,23 @@ int UASWaypointManager::getFrameRecommendation()
float UASWaypointManager::getAcceptanceRadiusRecommendation()
{
if (waypointsEditable.count() > 0) {
if (waypointsEditable.count() > 0)
{
return waypointsEditable.last()->getAcceptanceRadius();
} else {
return 10.0f;
}
else
{
if (uas->isRotaryWing())
{
return UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING;
}
else if (uas->isFixedWing())
{
return UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING;
}
}
return 10.0f;
}
float UASWaypointManager::getHomeAltitudeOffsetDefault()
......
......@@ -269,16 +269,6 @@ void WaypointList::addEditable(bool onCurrentPosition)
// Create waypoint with last frame
Waypoint *last = waypoints.last();
wp = WPM->createWaypoint();
if (uas)
{
if (uas->isRotaryWing()) {
wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING);
}
else if (uas->isFixedWing())
{
wp->setAcceptanceRadius(UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING);
}
}
// wp->blockSignals(true);
MAV_FRAME frame = (MAV_FRAME)last->getFrame();
wp->setFrame(frame);
......
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