Skip to content

Commit 6364bb8

Browse files
committed
LP-605 call setWaypoint() on PathPlan resume
1 parent aba11f0 commit 6364bb8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

flight/modules/PathPlanner/pathplanner.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,20 @@ static void pathPlannerTask()
222222
}
223223

224224
// the transition from pathplanner to another flightmode back to pathplanner
225-
// triggers a reset back to 0 index in the waypoint list
225+
// triggers a reset back either to 0 index in the waypoint list,
226+
// or to current index in the waypoint list, depending on FlightModeChangeRestartsPathPlan setting
226227
if (pathplanner_active == false) {
227228
pathplanner_active = true;
228229

229230
FlightModeSettingsFlightModeChangeRestartsPathPlanOptions restart;
230231
FlightModeSettingsFlightModeChangeRestartsPathPlanGet(&restart);
231232
if (restart == FLIGHTMODESETTINGS_FLIGHTMODECHANGERESTARTSPATHPLAN_TRUE) {
232233
setWaypoint(0);
233-
return;
234234
}
235+
else {
236+
setWaypoint(waypointActive.Index);
237+
}
238+
return;
235239
}
236240

237241
WaypointInstGet(waypointActive.Index, &waypoint);

0 commit comments

Comments
 (0)