File tree Expand file tree Collapse file tree
flight/modules/PathPlanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,16 +222,19 @@ 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 ;
234+ } else {
235+ setWaypoint (waypointActive .Index );
234236 }
237+ return ;
235238 }
236239
237240 WaypointInstGet (waypointActive .Index , & waypoint );
You can’t perform that action at this time.
0 commit comments