Skip to content

Commit

Permalink
vtol_takeoff: reset reposition triplet before handing over to loiter …
Browse files Browse the repository at this point in the history
…mode

Signed-off-by: RomanBapst <[email protected]>
  • Loading branch information
RomanBapst authored and sfuhrer committed Jul 25, 2022
1 parent d6488fa commit 97f632a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/navigator/vtol_takeoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ VtolTakeoff::on_active()

case vtol_takeoff_state::CLIMB: {

// reset any potentially valid reposition triplet which was not handled
// we do this to avoid random loiter locations after switching to loiter mode after this
position_setpoint_triplet_s *reposition_triplet = _navigator->get_reposition_triplet();
_navigator->reset_position_setpoint(reposition_triplet->previous);
_navigator->reset_position_setpoint(reposition_triplet->current);
_navigator->reset_position_setpoint(reposition_triplet->next);

// the VTOL takeoff is done, proceed loitering and upate the navigation state to LOITER
_navigator->get_mission_result()->finished = true;
_navigator->set_mission_result_updated();
Expand Down

0 comments on commit 97f632a

Please sign in to comment.