Copter: LAND at stopping point instead of curr pos

This commit is contained in:
Randy Mackay 2014-01-25 13:41:17 +09:00 committed by Andrew Tridgell
parent cdc935b66d
commit bd88ed8a53

View File

@ -10,8 +10,10 @@ static bool land_init(bool ignore_checks)
// check if we have GPS and decide which LAND we're going to do // check if we have GPS and decide which LAND we're going to do
land_with_gps = GPS_ok(); land_with_gps = GPS_ok();
if (land_with_gps) { if (land_with_gps) {
// set target to current position // set target to stopping point
wp_nav.init_loiter_target(); Vector3f stopping_point;
wp_nav.get_loiter_stopping_point_xy(stopping_point);
wp_nav.set_loiter_target(stopping_point);
} }
// initialise altitude target to stopping point // initialise altitude target to stopping point
pos_control.set_target_to_stopping_point_z(); pos_control.set_target_to_stopping_point_z();