APM:Libraries
|
Class managing ArduPlane landing methods. More...
#include <AP_Landing.h>
Public Types | |
enum | Landing_Type { TYPE_STANDARD_GLIDE_SLOPE = 0, TYPE_DEEPSTALL = 1 } |
Public Member Functions | |
FUNCTOR_TYPEDEF (set_target_altitude_proportion_fn_t, void, const Location &, float) | |
FUNCTOR_TYPEDEF (constrain_target_altitude_location_fn_t, void, const Location &, const Location &) | |
FUNCTOR_TYPEDEF (adjusted_altitude_cm_fn_t, int32_t) | |
FUNCTOR_TYPEDEF (adjusted_relative_altitude_cm_fn_t, int32_t) | |
FUNCTOR_TYPEDEF (disarm_if_autoland_complete_fn_t, void) | |
FUNCTOR_TYPEDEF (update_flight_stage_fn_t, void) | |
AP_Landing (AP_Mission &_mission, AP_AHRS &_ahrs, AP_SpdHgtControl *_SpdHgt_Controller, AP_Navigation *_nav_controller, AP_Vehicle::FixedWing &_aparm, set_target_altitude_proportion_fn_t _set_target_altitude_proportion_fn, constrain_target_altitude_location_fn_t _constrain_target_altitude_location_fn, adjusted_altitude_cm_fn_t _adjusted_altitude_cm_fn, adjusted_relative_altitude_cm_fn_t _adjusted_relative_altitude_cm_fn, disarm_if_autoland_complete_fn_t _disarm_if_autoland_complete_fn, update_flight_stage_fn_t _update_flight_stage_fn) | |
AP_Landing (const AP_Landing &other)=delete | |
AP_Landing & | operator= (const AP_Landing &)=delete |
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 ¤t_loc, const int32_t auto_state_takeoff_altitude_rel_cm, bool &throttle_suppressed) |
bool | verify_land (const Location &prev_WP_loc, Location &next_WP_loc, const Location ¤t_loc, const float height, const float sink_rate, const float wp_proportion, const uint32_t last_flying_ms, const bool is_armed, const bool is_flying, const bool rangefinder_state_in_range) |
void | adjust_landing_slope_for_rangefinder_bump (AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state, Location &prev_WP_loc, Location &next_WP_loc, const Location ¤t_loc, const float wp_distance, int32_t &target_altitude_offset_cm) |
void | setup_landing_glide_slope (const Location &prev_WP_loc, const Location &next_WP_loc, const Location ¤t_loc, int32_t &target_altitude_offset_cm) |
bool | override_servos (void) |
void | check_if_need_to_abort (const AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state) |
bool | request_go_around (void) |
bool | is_flaring (void) const |
bool | is_on_approach (void) const |
bool | is_ground_steering_allowed (void) const |
bool | is_throttle_suppressed (void) const |
bool | is_flying_forward (void) const |
void | handle_flight_stage_change (const bool _in_landing_stage) |
int32_t | constrain_roll (const int32_t desired_roll_cd, const int32_t level_roll_limit_cd) |
bool | get_target_altitude_location (Location &location) |
bool | send_landing_message (mavlink_channel_t chan) |
bool | terminate (void) |
bool | restart_landing_sequence (void) |
float | wind_alignment (const float heading_deg) |
float | head_wind (void) |
int32_t | get_target_airspeed_cm (void) |
int16_t | get_pitch_cd (void) const |
float | get_flare_sec (void) const |
int8_t | get_disarm_delay (void) const |
int8_t | get_then_servos_neutral (void) const |
int8_t | get_abort_throttle_enable (void) const |
int8_t | get_flap_percent (void) const |
int8_t | get_throttle_slewrate (void) const |
bool | is_commanded_go_around (void) const |
bool | is_complete (void) const |
void | set_initial_slope (void) |
bool | is_expecting_impact (void) const |
void | Log (void) const |
const DataFlash_Class::PID_Info * | get_pid_info (void) const |
Public Attributes | |
float | alt_offset |
bool | commanded_go_around:1 |
bool | in_progress:1 |
bool | post_stats:1 |
bool | has_aborted_due_to_slope_recalc:1 |
Static Public Attributes | |
static const struct AP_Param::GroupInfo | var_info [] |
Private Types | |
enum | { SLOPE_STAGE_NORMAL, SLOPE_STAGE_APPROACH, SLOPE_STAGE_PREFLARE, SLOPE_STAGE_FINAL } |
Private Member Functions | |
void | type_slope_do_land (const AP_Mission::Mission_Command &cmd, const float relative_altitude) |
void | type_slope_verify_abort_landing (const Location &prev_WP_loc, Location &next_WP_loc, bool &throttle_suppressed) |
bool | type_slope_verify_land (const Location &prev_WP_loc, Location &next_WP_loc, const Location ¤t_loc, const float height, const float sink_rate, const float wp_proportion, const uint32_t last_flying_ms, const bool is_armed, const bool is_flying, const bool rangefinder_state_in_range) |
void | type_slope_adjust_landing_slope_for_rangefinder_bump (AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state, Location &prev_WP_loc, Location &next_WP_loc, const Location ¤t_loc, const float wp_distance, int32_t &target_altitude_offset_cm) |
void | type_slope_setup_landing_glide_slope (const Location &prev_WP_loc, const Location &next_WP_loc, const Location ¤t_loc, int32_t &target_altitude_offset_cm) |
int32_t | type_slope_get_target_airspeed_cm (void) |
void | type_slope_check_if_need_to_abort (const AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state) |
int32_t | type_slope_constrain_roll (const int32_t desired_roll_cd, const int32_t level_roll_limit_cd) |
bool | type_slope_request_go_around (void) |
void | type_slope_log (void) const |
bool | type_slope_is_complete (void) const |
bool | type_slope_is_flaring (void) const |
bool | type_slope_is_on_approach (void) const |
bool | type_slope_is_expecting_impact (void) const |
bool | type_slope_is_throttle_suppressed (void) const |
Friends | |
class | AP_Landing_Deepstall |
Class managing ArduPlane landing methods.
Definition at line 28 of file AP_Landing.h.
|
private |
Enumerator | |
---|---|
SLOPE_STAGE_NORMAL | |
SLOPE_STAGE_APPROACH | |
SLOPE_STAGE_PREFLARE | |
SLOPE_STAGE_FINAL |
Definition at line 158 of file AP_Landing.h.
Enumerator | |
---|---|
TYPE_STANDARD_GLIDE_SLOPE | |
TYPE_DEEPSTALL |
Definition at line 53 of file AP_Landing.h.
AP_Landing::AP_Landing | ( | AP_Mission & | _mission, |
AP_AHRS & | _ahrs, | ||
AP_SpdHgtControl * | _SpdHgt_Controller, | ||
AP_Navigation * | _nav_controller, | ||
AP_Vehicle::FixedWing & | _aparm, | ||
set_target_altitude_proportion_fn_t | _set_target_altitude_proportion_fn, | ||
constrain_target_altitude_location_fn_t | _constrain_target_altitude_location_fn, | ||
adjusted_altitude_cm_fn_t | _adjusted_altitude_cm_fn, | ||
adjusted_relative_altitude_cm_fn_t | _adjusted_relative_altitude_cm_fn, | ||
disarm_if_autoland_complete_fn_t | _disarm_if_autoland_complete_fn, | ||
update_flight_stage_fn_t | _update_flight_stage_fn | ||
) |
|
delete |
void AP_Landing::adjust_landing_slope_for_rangefinder_bump | ( | AP_Vehicle::FixedWing::Rangefinder_State & | rangefinder_state, |
Location & | prev_WP_loc, | ||
Location & | next_WP_loc, | ||
const Location & | current_loc, | ||
const float | wp_distance, | ||
int32_t & | target_altitude_offset_cm | ||
) |
void AP_Landing::check_if_need_to_abort | ( | const AP_Vehicle::FixedWing::Rangefinder_State & | rangefinder_state | ) |
int32_t AP_Landing::constrain_roll | ( | const int32_t | desired_roll_cd, |
const int32_t | level_roll_limit_cd | ||
) |
void AP_Landing::do_land | ( | const AP_Mission::Mission_Command & | cmd, |
const float | relative_altitude | ||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | set_target_altitude_proportion_fn_t | , |
void | , | ||
const Location & | , | ||
float | |||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | constrain_target_altitude_location_fn_t | , |
void | , | ||
const Location & | , | ||
const Location & | |||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | adjusted_altitude_cm_fn_t | , |
int32_t | |||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | adjusted_relative_altitude_cm_fn_t | , |
int32_t | |||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | disarm_if_autoland_complete_fn_t | , |
void | |||
) |
AP_Landing::FUNCTOR_TYPEDEF | ( | update_flight_stage_fn_t | , |
void | |||
) |
|
inline |
Definition at line 96 of file AP_Landing.h.
|
inline |
Definition at line 94 of file AP_Landing.h.
|
inline |
Definition at line 97 of file AP_Landing.h.
|
inline |
Definition at line 93 of file AP_Landing.h.
Referenced by AP_TECS::update_pitch_throttle().
const DataFlash_Class::PID_Info * AP_Landing::get_pid_info | ( | void | ) | const |
Definition at line 368 of file AP_Landing.cpp.
Referenced by set_initial_slope().
|
inline |
Definition at line 92 of file AP_Landing.h.
Referenced by AP_TECS::update_pitch_throttle().
int32_t AP_Landing::get_target_airspeed_cm | ( | void | ) |
bool AP_Landing::get_target_altitude_location | ( | Location & | location | ) |
|
inline |
Definition at line 95 of file AP_Landing.h.
|
inline |
Definition at line 98 of file AP_Landing.h.
void AP_Landing::handle_flight_stage_change | ( | const bool | _in_landing_stage | ) |
float AP_Landing::head_wind | ( | void | ) |
Definition at line 497 of file AP_Landing.cpp.
Referenced by type_slope_get_target_airspeed_cm().
|
inline |
bool AP_Landing::is_complete | ( | void | ) | const |
Definition at line 565 of file AP_Landing.cpp.
Referenced by is_commanded_go_around().
bool AP_Landing::is_expecting_impact | ( | void | ) | const |
Definition at line 336 of file AP_Landing.cpp.
Referenced by set_initial_slope().
bool AP_Landing::is_flaring | ( | void | ) | const |
Definition at line 281 of file AP_Landing.cpp.
Referenced by AP_TECS::_detect_underspeed(), AP_TECS::_update_height_demand(), AP_TECS::_update_pitch(), and AP_TECS::update_pitch_throttle().
bool AP_Landing::is_flying_forward | ( | void | ) | const |
bool AP_Landing::is_ground_steering_allowed | ( | void | ) | const |
bool AP_Landing::is_on_approach | ( | void | ) | const |
Definition at line 301 of file AP_Landing.cpp.
Referenced by AP_TECS::update_pitch_throttle().
bool AP_Landing::is_throttle_suppressed | ( | void | ) | const |
void AP_Landing::Log | ( | void | ) | const |
Definition at line 577 of file AP_Landing.cpp.
Referenced by do_land(), handle_flight_stage_change(), request_go_around(), restart_landing_sequence(), set_initial_slope(), type_slope_adjust_landing_slope_for_rangefinder_bump(), verify_abort_landing(), and verify_land().
|
delete |
bool AP_Landing::override_servos | ( | void | ) |
bool AP_Landing::request_go_around | ( | void | ) |
bool AP_Landing::restart_landing_sequence | ( | void | ) |
Definition at line 405 of file AP_Landing.cpp.
Referenced by verify_abort_landing().
bool AP_Landing::send_landing_message | ( | mavlink_channel_t | chan | ) |
|
inline |
void AP_Landing::setup_landing_glide_slope | ( | const Location & | prev_WP_loc, |
const Location & | next_WP_loc, | ||
const Location & | current_loc, | ||
int32_t & | target_altitude_offset_cm | ||
) |
Definition at line 388 of file AP_Landing.cpp.
Referenced by type_slope_adjust_landing_slope_for_rangefinder_bump().
bool AP_Landing::terminate | ( | void | ) |
|
private |
Definition at line 160 of file AP_Landing_Slope.cpp.
Referenced by adjust_landing_slope_for_rangefinder_bump().
|
private |
|
private |
Definition at line 348 of file AP_Landing_Slope.cpp.
Referenced by constrain_roll().
|
private |
Definition at line 24 of file AP_Landing_Slope.cpp.
Referenced by do_land().
|
private |
Definition at line 312 of file AP_Landing_Slope.cpp.
Referenced by get_target_airspeed_cm().
|
private |
Definition at line 374 of file AP_Landing_Slope.cpp.
Referenced by is_complete().
|
private |
Definition at line 368 of file AP_Landing_Slope.cpp.
Referenced by is_expecting_impact().
|
private |
Definition at line 356 of file AP_Landing_Slope.cpp.
Referenced by is_flaring().
|
private |
Definition at line 362 of file AP_Landing_Slope.cpp.
Referenced by is_ground_steering_allowed(), is_on_approach(), and type_slope_verify_land().
|
private |
Definition at line 392 of file AP_Landing_Slope.cpp.
Referenced by is_throttle_suppressed().
|
private |
Definition at line 379 of file AP_Landing_Slope.cpp.
Referenced by Log().
|
private |
Definition at line 210 of file AP_Landing_Slope.cpp.
Referenced by request_go_around().
|
private |
Definition at line 225 of file AP_Landing_Slope.cpp.
Referenced by setup_landing_glide_slope().
|
private |
Definition at line 36 of file AP_Landing_Slope.cpp.
Referenced by verify_abort_landing().
|
private |
Definition at line 49 of file AP_Landing_Slope.cpp.
Referenced by verify_land().
float AP_Landing::wind_alignment | ( | const float | heading_deg | ) |
Definition at line 487 of file AP_Landing.cpp.
Referenced by head_wind().
|
friend |
Definition at line 29 of file AP_Landing.h.
|
private |
Definition at line 151 of file AP_Landing.h.
Referenced by get_abort_throttle_enable().
|
private |
Definition at line 133 of file AP_Landing.h.
Referenced by type_slope_adjust_landing_slope_for_rangefinder_bump().
|
private |
Definition at line 134 of file AP_Landing.h.
Referenced by verify_abort_landing().
|
private |
Definition at line 125 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::build_approach_path(), head_wind(), AP_Landing_Deepstall::override_servos(), AP_Landing_Deepstall::request_go_around(), AP_Landing_Deepstall::terminate(), type_slope_setup_landing_glide_slope(), AP_Landing_Deepstall::update_steering(), AP_Landing_Deepstall::verify_breakout(), AP_Landing_Deepstall::verify_land(), and wind_alignment().
float AP_Landing::alt_offset |
Definition at line 107 of file AP_Landing.h.
Referenced by type_slope_adjust_landing_slope_for_rangefinder_bump(), and type_slope_log().
|
private |
Definition at line 129 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::build_approach_path(), get_target_airspeed_cm(), AP_Landing_Deepstall::get_target_airspeed_cm(), type_slope_get_target_airspeed_cm(), type_slope_verify_land(), and AP_Landing_Deepstall::verify_land().
bool AP_Landing::commanded_go_around |
Definition at line 112 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::request_go_around().
|
private |
Definition at line 132 of file AP_Landing.h.
Referenced by type_slope_setup_landing_glide_slope().
|
private |
Definition at line 139 of file AP_Landing.h.
Referenced by do_land(), get_pid_info(), get_target_airspeed_cm(), get_target_altitude_location(), is_flying_forward(), is_on_approach(), is_throttle_suppressed(), Log(), override_servos(), request_go_around(), send_landing_message(), terminate(), verify_abort_landing(), and verify_land().
|
private |
Definition at line 149 of file AP_Landing.h.
Referenced by get_disarm_delay().
|
private |
Definition at line 135 of file AP_Landing.h.
Referenced by type_slope_verify_land(), and AP_Landing_Deepstall::verify_land().
struct { ... } AP_Landing::flags |
Referenced by do_land(), get_target_airspeed_cm(), get_target_altitude_location(), handle_flight_stage_change(), is_commanded_go_around(), is_expecting_impact(), is_flaring(), is_flying_forward(), is_ground_steering_allowed(), is_on_approach(), is_throttle_suppressed(), override_servos(), AP_Landing_Deepstall::request_go_around(), send_landing_message(), AP_Landing_Deepstall::terminate(), type_slope_adjust_landing_slope_for_rangefinder_bump(), type_slope_log(), and type_slope_request_go_around().
|
private |
Definition at line 152 of file AP_Landing.h.
Referenced by get_flap_percent().
|
private |
Definition at line 142 of file AP_Landing.h.
Referenced by type_slope_setup_landing_glide_slope(), and type_slope_verify_land().
|
private |
Definition at line 143 of file AP_Landing.h.
Referenced by get_flare_sec(), type_slope_setup_landing_glide_slope(), and type_slope_verify_land().
bool AP_Landing::has_aborted_due_to_slope_recalc |
Definition at line 169 of file AP_Landing.h.
bool AP_Landing::in_progress |
Definition at line 115 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::terminate().
|
private |
Definition at line 119 of file AP_Landing.h.
Referenced by set_initial_slope(), type_slope_adjust_landing_slope_for_rangefinder_bump(), type_slope_do_land(), and type_slope_log().
|
private |
Definition at line 124 of file AP_Landing.h.
Referenced by restart_landing_sequence(), type_slope_verify_land(), and verify_abort_landing().
|
private |
Definition at line 127 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::build_approach_path(), type_slope_verify_abort_landing(), type_slope_verify_land(), AP_Landing_Deepstall::verify_abort_landing(), and AP_Landing_Deepstall::verify_land().
|
private |
Definition at line 141 of file AP_Landing.h.
Referenced by get_pitch_cd().
bool AP_Landing::post_stats |
Definition at line 167 of file AP_Landing.h.
|
private |
Definition at line 144 of file AP_Landing.h.
Referenced by AP_Landing_Deepstall::get_target_airspeed_cm(), type_slope_get_target_airspeed_cm(), and type_slope_verify_land().
|
private |
Definition at line 145 of file AP_Landing.h.
Referenced by type_slope_verify_land().
|
private |
Definition at line 146 of file AP_Landing.h.
Referenced by type_slope_verify_land().
|
private |
Definition at line 131 of file AP_Landing.h.
Referenced by type_slope_setup_landing_glide_slope().
|
private |
Definition at line 122 of file AP_Landing.h.
Referenced by set_initial_slope(), type_slope_adjust_landing_slope_for_rangefinder_bump(), type_slope_do_land(), type_slope_log(), and type_slope_setup_landing_glide_slope().
|
private |
Definition at line 147 of file AP_Landing.h.
Referenced by type_slope_adjust_landing_slope_for_rangefinder_bump().
|
private |
Definition at line 148 of file AP_Landing.h.
Referenced by type_slope_adjust_landing_slope_for_rangefinder_bump().
|
private |
Definition at line 126 of file AP_Landing.h.
Referenced by get_target_airspeed_cm(), type_slope_get_target_airspeed_cm(), and type_slope_setup_landing_glide_slope().
|
private |
Definition at line 150 of file AP_Landing.h.
Referenced by get_then_servos_neutral().
|
private |
Definition at line 153 of file AP_Landing.h.
Referenced by get_throttle_slewrate().
|
private |
Definition at line 154 of file AP_Landing.h.
Referenced by adjust_landing_slope_for_rangefinder_bump(), constrain_roll(), do_land(), get_pid_info(), get_target_airspeed_cm(), get_target_altitude_location(), is_complete(), is_expecting_impact(), is_flaring(), is_flying_forward(), is_ground_steering_allowed(), is_on_approach(), is_throttle_suppressed(), Log(), override_servos(), request_go_around(), send_landing_message(), setup_landing_glide_slope(), terminate(), verify_abort_landing(), and verify_land().
struct { ... } AP_Landing::type_slope_flags |
enum { ... } AP_Landing::type_slope_stage |
Referenced by type_slope_constrain_roll(), type_slope_do_land(), type_slope_get_target_airspeed_cm(), type_slope_is_complete(), type_slope_is_expecting_impact(), type_slope_is_flaring(), type_slope_is_on_approach(), type_slope_is_throttle_suppressed(), type_slope_log(), and type_slope_verify_land().
|
private |
Definition at line 136 of file AP_Landing.h.
Referenced by restart_landing_sequence().
|
static |
Definition at line 90 of file AP_Landing.h.
Referenced by AP_Landing().