mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
Plane: fixed guided alt without terrain bit
This commit is contained in:
parent
c4047f6f11
commit
077177384d
@ -888,6 +888,7 @@ void GCS_MAVLINK::handle_guided_request(AP_Mission::Mission_Command &cmd)
|
||||
// add home alt if needed
|
||||
if (guided_WP_loc.flags.relative_alt) {
|
||||
guided_WP_loc.alt += home.alt;
|
||||
guided_WP_loc.flags.relative_alt = 0;
|
||||
}
|
||||
|
||||
set_mode(GUIDED);
|
||||
@ -902,11 +903,11 @@ void GCS_MAVLINK::handle_guided_request(AP_Mission::Mission_Command &cmd)
|
||||
*/
|
||||
void GCS_MAVLINK::handle_change_alt_request(AP_Mission::Mission_Command &cmd)
|
||||
{
|
||||
if (cmd.content.location.flags.relative_alt) {
|
||||
cmd.content.location.alt += home.alt;
|
||||
}
|
||||
|
||||
next_WP_loc.alt = cmd.content.location.alt;
|
||||
if (cmd.content.location.flags.relative_alt) {
|
||||
next_WP_loc.alt += home.alt;
|
||||
}
|
||||
next_WP_loc.flags.relative_alt = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ static void set_next_WP(const struct Location& loc)
|
||||
if (next_WP_loc.alt == 0) {
|
||||
next_WP_loc.alt = current_loc.alt;
|
||||
next_WP_loc.flags.relative_alt = false;
|
||||
next_WP_loc.flags.terrain_alt = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user