Copter: tighten auto_takeoff_complete checks

This commit is contained in:
Leonard Hall 2022-02-23 15:25:35 +10:30 committed by Randy Mackay
parent 6da1c20b3b
commit 14096d4eae
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ void Mode::auto_takeoff_run()
// handle takeoff completion // handle takeoff completion
bool reached_altitude = (copter.pos_control->get_pos_target_z_cm() - auto_take_off_start_alt_cm) >= ((auto_take_off_complete_alt_cm - auto_take_off_start_alt_cm) * 0.90); bool reached_altitude = (copter.pos_control->get_pos_target_z_cm() - auto_take_off_start_alt_cm) >= ((auto_take_off_complete_alt_cm - auto_take_off_start_alt_cm) * 0.90);
bool reached_climb_rate = copter.pos_control->get_vel_desired_cms().z < copter.pos_control->get_max_speed_up_cms() * 0.5; bool reached_climb_rate = copter.pos_control->get_vel_desired_cms().z < copter.pos_control->get_max_speed_up_cms() * 0.1;
auto_takeoff_complete = reached_altitude && reached_climb_rate; auto_takeoff_complete = reached_altitude && reached_climb_rate;
// calculate completion for location in case it is needed for a smooth transition to wp_nav // calculate completion for location in case it is needed for a smooth transition to wp_nav