mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-28 18:53:57 -04:00
Cotper: RTL correct height for RTL_ALT_FINAL
> 0.
This commit is contained in:
parent
54eb396e23
commit
2091ca11c3
@ -312,7 +312,7 @@ void ModeRTL::descent_run()
|
|||||||
attitude_control->input_thrust_vector_heading(pos_control->get_thrust_vector(), auto_yaw.get_heading());
|
attitude_control->input_thrust_vector_heading(pos_control->get_thrust_vector(), auto_yaw.get_heading());
|
||||||
|
|
||||||
// check if we've reached within 20cm of final altitude
|
// check if we've reached within 20cm of final altitude
|
||||||
_state_complete = labs(rtl_path.descent_target.alt - copter.current_loc.alt) < 20;
|
_state_complete = labs(rtl_path.descent_target.alt - copter.inertial_nav.get_position_z_up_cm()) < 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
// land_start - initialise controllers to loiter over home
|
// land_start - initialise controllers to loiter over home
|
||||||
@ -389,6 +389,9 @@ void ModeRTL::build_path()
|
|||||||
// descent target is below return target at rtl_alt_final
|
// descent target is below return target at rtl_alt_final
|
||||||
rtl_path.descent_target = Location(rtl_path.return_target.lat, rtl_path.return_target.lng, g.rtl_alt_final, Location::AltFrame::ABOVE_HOME);
|
rtl_path.descent_target = Location(rtl_path.return_target.lat, rtl_path.return_target.lng, g.rtl_alt_final, Location::AltFrame::ABOVE_HOME);
|
||||||
|
|
||||||
|
// Target altitude is passed directly to the position controller so must be relative to origin
|
||||||
|
rtl_path.descent_target.change_alt_frame(Location::AltFrame::ABOVE_ORIGIN);
|
||||||
|
|
||||||
// set land flag
|
// set land flag
|
||||||
rtl_path.land = g.rtl_alt_final <= 0;
|
rtl_path.land = g.rtl_alt_final <= 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user