|
|
@ -123,7 +123,7 @@ void ModeZigZag::return_to_manual_control(bool maintain_target) |
|
|
|
stage = MANUAL_REGAIN; |
|
|
|
stage = MANUAL_REGAIN; |
|
|
|
loiter_nav->clear_pilot_desired_acceleration(); |
|
|
|
loiter_nav->clear_pilot_desired_acceleration(); |
|
|
|
if (maintain_target) { |
|
|
|
if (maintain_target) { |
|
|
|
const Vector3f wp_dest = wp_nav->get_wp_destination(); |
|
|
|
const Vector3f& wp_dest = wp_nav->get_wp_destination(); |
|
|
|
loiter_nav->init_target(wp_dest); |
|
|
|
loiter_nav->init_target(wp_dest); |
|
|
|
if (wp_nav->origin_and_destination_are_terrain_alt()) { |
|
|
|
if (wp_nav->origin_and_destination_are_terrain_alt()) { |
|
|
|
copter.surface_tracking.set_target_alt_cm(wp_dest.z); |
|
|
|
copter.surface_tracking.set_target_alt_cm(wp_dest.z); |
|
|
|