fix(uavcan): keep GNSS jamming and spoofing with RelPosHeading (#28847)

The Fix2 ecef_position_velocity block also carries the node's noise, jamming and spoofing state, but it was skipped whenever a RelPosHeading was pending, so jamming and spoofing read unknown for as long as a dual-antenna heading was valid.

Assisted-by: Claude:claude-opus-5-5
This commit is contained in:
Jacob Dahl authored and GitHub committed 2026-09-25 16:41:30 -06:00
1 parent 4e91ae1c42
commit bd7d86e141
1 file changed
+3 -2
+3 -2
View File
@@ -330,8 +330,9 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
uint8_t spoofing_state = 0;
// TODO: this hack should eventually be removed now that we have the RelPosHeading message
// HACK: Use ecef_position_velocity for heading
if (!msg.ecef_position_velocity.empty() && !_rel_heading_valid) {
// HACK: Use ecef_position_velocity for heading, noise, jamming and spoofing.
// A valid RelPosHeading overrides the heading in process_fixx(), but nothing else carries the rest.
if (!msg.ecef_position_velocity.empty()) {
if (!std::isnan(msg.ecef_position_velocity[0].velocity_xyz[0])) {
heading = msg.ecef_position_velocity[0].velocity_xyz[0];
}