1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

LP-605 call setWaypoint() on PathPlan resume

This commit is contained in:
U-karat-jdl\karat 2018-11-29 12:20:53 +02:00
parent aba11f0e10
commit 6364bb8566

View File

@ -222,7 +222,8 @@ static void pathPlannerTask()
}
// the transition from pathplanner to another flightmode back to pathplanner
// triggers a reset back to 0 index in the waypoint list
// triggers a reset back either to 0 index in the waypoint list,
// or to current index in the waypoint list, depending on FlightModeChangeRestartsPathPlan setting
if (pathplanner_active == false) {
pathplanner_active = true;
@ -230,8 +231,11 @@ static void pathPlannerTask()
FlightModeSettingsFlightModeChangeRestartsPathPlanGet(&restart);
if (restart == FLIGHTMODESETTINGS_FLIGHTMODECHANGERESTARTSPATHPLAN_TRUE) {
setWaypoint(0);
return;
}
else {
setWaypoint(waypointActive.Index);
}
return;
}
WaypointInstGet(waypointActive.Index, &waypoint);