Skip to content

Commit

Permalink
Plane: invalidate NAVL1's cached state after a mode change
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Oct 26, 2023
1 parent 9e89c67 commit 345862c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ArduPlane/mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ bool Mode::enter()
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "In landing sequence: mission reset");
plane.mission.reset();
}

// Invalidate the nav controller's state so that any new mode that doesn't use it isn't using it's stale status data
// flag the NAV_L1 controller as stale AFTER _enter() so that when a mode starts it can know if we're in a loiter already or not.
plane.nav_controller->set_data_is_stale();
}

return enter_result;
Expand Down

0 comments on commit 345862c

Please sign in to comment.