Correct all ADSB heading related field to be in positive range (#25128)

This commit is contained in:
QiTao Weng 2025-07-02 14:10:28 -05:00 committed by GitHub
parent cb71aea7fa
commit 30c8c23716
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -614,7 +614,7 @@ void SagetechMXS::handle_svr(sg_svr_t svr)
}
if (svr.validity.surfHeading) {
t.heading = matrix::wrap_pi((float)svr.surface.heading * (M_PI_F / 180.0f));
t.heading = matrix::wrap_2pi((float)svr.surface.heading * (M_PI_F / 180.0f));
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_HEADING;
}
}
@ -622,7 +622,7 @@ void SagetechMXS::handle_svr(sg_svr_t svr)
if (svr.type == svrAirborne) {
if (svr.validity.airSpeed) {
t.hor_velocity = (svr.airborne.speed * SAGETECH_SCALE_KNOTS_TO_M_PER_SEC); //Convert from knots to meters/second
t.heading = matrix::wrap_pi((float)svr.airborne.heading * (M_PI_F / 180.0f));
t.heading = matrix::wrap_2pi((float)svr.airborne.heading * (M_PI_F / 180.0f));
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_HEADING;
t.flags |= transponder_report_s::PX4_ADSB_FLAGS_VALID_VELOCITY;
}