File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -859,7 +859,7 @@ bool Plane::set_target_location(const Location &target_loc)
859
859
return false ;
860
860
}
861
861
// add home alt if needed
862
- if (loc.relative_alt ) {
862
+ if (loc.relative_alt && !loc. terrain_alt ) {
863
863
loc.alt += plane.home .alt ;
864
864
loc.relative_alt = 0 ;
865
865
}
Original file line number Diff line number Diff line change @@ -749,7 +749,7 @@ bool GCS_MAVLINK_Plane::handle_guided_request(AP_Mission::Mission_Command &cmd)
749
749
void GCS_MAVLINK_Plane::handle_change_alt_request (AP_Mission::Mission_Command &cmd)
750
750
{
751
751
plane.next_WP_loc .alt = cmd.content .location .alt ;
752
- if (cmd.content .location .relative_alt ) {
752
+ if (cmd.content .location .relative_alt && !cmd. content . location . terrain_alt ) {
753
753
plane.next_WP_loc .alt += plane.home .alt ;
754
754
}
755
755
plane.next_WP_loc .relative_alt = false ;
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ void ModeGuided::navigate()
109
109
bool ModeGuided::handle_guided_request (Location target_loc)
110
110
{
111
111
// add home alt if needed
112
- if (target_loc.relative_alt ) {
112
+ if (target_loc.relative_alt && !target_loc. terrain_alt ) {
113
113
target_loc.alt += plane.home .alt ;
114
114
target_loc.relative_alt = 0 ;
115
115
}
You can’t perform that action at this time.
0 commit comments