|
|
|
@ -684,24 +684,24 @@ void Mode::land_run_horizontal_control()
@@ -684,24 +684,24 @@ void Mode::land_run_horizontal_control()
|
|
|
|
|
|
|
|
|
|
void Mode::land_lock_att_control(float *p_roll,float *p_pitch,float *p_yaw_rate) |
|
|
|
|
{ |
|
|
|
|
float *target_roll = p_roll; |
|
|
|
|
float *target_pitch = p_pitch; |
|
|
|
|
float *target_yaw_rate = p_yaw_rate; |
|
|
|
|
static uint8_t prt_once; |
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL |
|
|
|
|
bool land_lock_attitude = (get_alt_above_ground_cm() < g.land_lock_alt * 2) && \
|
|
|
|
|
g.land_lock_alt && \
|
|
|
|
|
(copter.control_mode == Mode::Number::LAND || copter.control_mode == Mode::Number::RTL || copter.control_mode == Mode::Number::AUTO); |
|
|
|
|
(copter.control_mode == Mode::Number::LOITER || copter.control_mode == Mode::Number::LAND || copter.control_mode == Mode::Number::RTL || copter.control_mode == Mode::Number::AUTO); |
|
|
|
|
if(!prt_once && land_lock_attitude) |
|
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "land lock sitl mode"); |
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
bool land_lock_attitude = (get_alt_above_ground_cm() < g.land_lock_alt * 2) && \
|
|
|
|
|
copter.rangefinder_alt_ok() && g.land_lock_alt && \
|
|
|
|
|
(copter.control_mode == Mode::Number::LAND || copter.control_mode == Mode::Number::RTL || copter.control_mode == Mode::Number::AUTO); |
|
|
|
|
(copter.control_mode == Mode::Number::LOITER || copter.control_mode == Mode::Number::LAND || copter.control_mode == Mode::Number::RTL || copter.control_mode == Mode::Number::AUTO); |
|
|
|
|
#endif |
|
|
|
|
if(land_lock_attitude) |
|
|
|
|
{ |
|
|
|
|
float *target_roll = p_roll; |
|
|
|
|
float *target_pitch = p_pitch; |
|
|
|
|
float *target_yaw_rate = p_yaw_rate; |
|
|
|
|
if(prt_once == 0) |
|
|
|
|
{ |
|
|
|
|
gcs().send_text(MAV_SEVERITY_INFO, "Land ready to enter attitude lock mode"); |
|
|
|
|