mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
Copter: use abs() on integers; Location alts are in integer cm
This commit is contained in:
parent
96d73affae
commit
cc86011d20
@ -335,7 +335,7 @@ void Copter::rtl_descent_run()
|
|||||||
attitude_control->input_euler_angle_roll_pitch_euler_rate_yaw(wp_nav->get_roll(), wp_nav->get_pitch(), target_yaw_rate, get_smoothing_gain());
|
attitude_control->input_euler_angle_roll_pitch_euler_rate_yaw(wp_nav->get_roll(), wp_nav->get_pitch(), target_yaw_rate, get_smoothing_gain());
|
||||||
|
|
||||||
// check if we've reached within 20cm of final altitude
|
// check if we've reached within 20cm of final altitude
|
||||||
rtl_state_complete = fabsf(rtl_path.descent_target.alt - current_loc.alt) < 20.0f;
|
rtl_state_complete = abs(rtl_path.descent_target.alt - current_loc.alt) < 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rtl_loiterathome_start - initialise controllers to loiter over home
|
// rtl_loiterathome_start - initialise controllers to loiter over home
|
||||||
|
Loading…
Reference in New Issue
Block a user