mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Copter: zigzag smoother stops on terrain failure
This commit is contained in:
parent
8e385d7453
commit
8a20d37799
@ -122,11 +122,15 @@ void ModeZigZag::return_to_manual_control(bool maintain_target)
|
||||
if (stage == AUTO) {
|
||||
stage = MANUAL_REGAIN;
|
||||
loiter_nav->clear_pilot_desired_acceleration();
|
||||
if (maintain_target) {
|
||||
const Vector3f wp_dest = wp_nav->get_wp_destination();
|
||||
loiter_nav->init_target(wp_dest);
|
||||
if (maintain_target && 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);
|
||||
}
|
||||
} else {
|
||||
loiter_nav->init_target();
|
||||
}
|
||||
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: manual control");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user