mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 13:10:35 +08:00
Fix ADSB heading angle obtained from driver by removing +pi. Adjusted downstream accordingly
This commit is contained in:
committed by
Silvan Fuhrer
parent
310cbbedb1
commit
75e4047f2a
@@ -2548,7 +2548,7 @@ MavlinkReceiver::handle_message_adsb_vehicle(mavlink_message_t *msg)
|
||||
t.lon = adsb.lon * 1e-7;
|
||||
t.altitude_type = adsb.altitude_type;
|
||||
t.altitude = adsb.altitude / 1000.0f;
|
||||
t.heading = adsb.heading / 100.0f / 180.0f * M_PI_F - M_PI_F;
|
||||
t.heading = adsb.heading / 100.0f / 180.0f * M_PI_F;
|
||||
t.hor_velocity = adsb.hor_velocity / 100.0f;
|
||||
t.ver_velocity = adsb.ver_velocity / 100.0f;
|
||||
memcpy(&t.callsign[0], &adsb.callsign[0], sizeof(t.callsign));
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
msg.lon = pos.lon * 1e7;
|
||||
msg.altitude_type = pos.altitude_type;
|
||||
msg.altitude = pos.altitude * 1e3f;
|
||||
msg.heading = (pos.heading + M_PI_F) / M_PI_F * 180.0f * 100.0f;
|
||||
msg.heading = pos.heading / M_PI_F * 180.0f * 100.0f;
|
||||
msg.hor_velocity = pos.hor_velocity * 100.0f;
|
||||
msg.ver_velocity = pos.ver_velocity * 100.0f;
|
||||
memcpy(&msg.callsign[0], &pos.callsign[0], sizeof(msg.callsign));
|
||||
|
||||
Reference in New Issue
Block a user