mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 12:23:34 +08:00
Fix bug with yaw only reposition
Fix formatting
This commit is contained in:
@@ -303,12 +303,18 @@ void Navigator::run()
|
|||||||
rep->current.alt = get_global_position()->alt;
|
rep->current.alt = get_global_position()->alt;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (PX4_ISFINITE(cmd.param7)) {
|
} else if (PX4_ISFINITE(cmd.param7) || PX4_ISFINITE(cmd.param4)) {
|
||||||
// Received only a request to change altitude, thus we keep the setpoint
|
// Position is not changing, thus we keep the setpoint
|
||||||
rep->current.lat = PX4_ISFINITE(curr->current.lat) ? curr->current.lat : get_global_position()->lat;
|
rep->current.lat = PX4_ISFINITE(curr->current.lat) ? curr->current.lat : get_global_position()->lat;
|
||||||
rep->current.lon = PX4_ISFINITE(curr->current.lon) ? curr->current.lon : get_global_position()->lon;
|
rep->current.lon = PX4_ISFINITE(curr->current.lon) ? curr->current.lon : get_global_position()->lon;
|
||||||
rep->current.alt = cmd.param7;
|
|
||||||
only_alt_change_requested = true;
|
if (PX4_ISFINITE(cmd.param7)) {
|
||||||
|
rep->current.alt = cmd.param7;
|
||||||
|
only_alt_change_requested = true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
rep->current.alt = get_global_position()->alt;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// All three set to NaN - pause vehicle
|
// All three set to NaN - pause vehicle
|
||||||
|
|||||||
Reference in New Issue
Block a user