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,10 +122,14 @@ void ModeZigZag::return_to_manual_control(bool maintain_target)
|
|||||||
if (stage == AUTO) {
|
if (stage == AUTO) {
|
||||||
stage = MANUAL_REGAIN;
|
stage = MANUAL_REGAIN;
|
||||||
loiter_nav->clear_pilot_desired_acceleration();
|
loiter_nav->clear_pilot_desired_acceleration();
|
||||||
const Vector3f wp_dest = wp_nav->get_wp_destination();
|
if (maintain_target) {
|
||||||
loiter_nav->init_target(wp_dest);
|
const Vector3f wp_dest = wp_nav->get_wp_destination();
|
||||||
if (maintain_target && wp_nav->origin_and_destination_are_terrain_alt()) {
|
loiter_nav->init_target(wp_dest);
|
||||||
copter.surface_tracking.set_target_alt_cm(wp_dest.z);
|
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");
|
gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: manual control");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user