Skip to content

Commit

Permalink
AP_Landing: add AutoLand mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg committed Dec 11, 2024
1 parent 7e2d545 commit 68e88c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/AP_Landing/AP_Landing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,18 @@ void AP_Landing::setup_landing_glide_slope(const Location &prev_WP_loc, const Lo
}
}

/*
reset landing state
*/
void AP_Landing::reset(void)
{
initial_slope = 0;
slope = 0;
type_slope_flags.post_stats = false;
type_slope_flags.has_aborted_due_to_slope_recalc = false;
type_slope_stage = SlopeStage::NORMAL;
}

/*
Restart a landing by first checking for a DO_LAND_START and
jump there. Otherwise decrement waypoint so we would re-start
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Landing/AP_Landing.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class AP_Landing {

void convert_parameters(void);

void reset(void);

void do_land(const AP_Mission::Mission_Command& cmd, const float relative_altitude);
bool verify_abort_landing(const Location &prev_WP_loc, Location &next_WP_loc, const Location &current_loc,
const int32_t auto_state_takeoff_altitude_rel_cm, bool &throttle_suppressed);
Expand Down

0 comments on commit 68e88c7

Please sign in to comment.