mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
FlightTaskOrbit: Avoid sending NAN altitude in status telemetry while it's changed by stick
This commit is contained in:
parent
a737036633
commit
0381e14822
@ -140,9 +140,11 @@ bool FlightTaskOrbit::sendTelemetry()
|
||||
orbit_status.yaw_behaviour = _yaw_behaviour;
|
||||
|
||||
if (_geo_projection.isInitialized()) {
|
||||
// While chainging altitude by stick _position_setpoint(2) is not set (NAN)
|
||||
float local_altitude = PX4_ISFINITE(_position_setpoint(2)) ? _position_setpoint(2) : _position(2);
|
||||
// local -> global
|
||||
_geo_projection.reproject(_center(0), _center(1), orbit_status.x, orbit_status.y);
|
||||
orbit_status.z = _global_local_alt0 - _position_setpoint(2);
|
||||
orbit_status.z = _global_local_alt0 - local_altitude;
|
||||
|
||||
} else {
|
||||
return false; // don't send the message if the transformation failed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user