Skip to content

Commit e846b30

Browse files
jdlilovf5soh
authored andcommitted
Merged in julian_lilov/librepilot-jdl/LP-605_PathPlan_Resume_Fix (pull request #522)
LP-605 PathPlan 'Resume' Fix Approved-by: Lalanne Laurent <f5soh@free.fr>
2 parents ae1a0e9 + 6741293 commit e846b30

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

flight/modules/PathPlanner/pathplanner.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)