Skip to content

Commit

Permalink
fix to gps ecef conditional
Browse files Browse the repository at this point in the history
Signed-off-by: dirksavage88 <[email protected]>
  • Loading branch information
dirksavage88 committed Oct 30, 2024
1 parent 9d25e2c commit 3b936b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/drivers/uavcan/sensors/gnss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
}
}

// Invalidate the heading fields FIXME:(PX4 CANNODE)
// Invalidate the heading fields
float heading = NAN;
float heading_offset = NAN;
float heading_accuracy = NAN;
Expand All @@ -320,7 +320,7 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
uint8_t spoofing_state = 0;

// Use ecef_position_velocity for CANNODE until FIXME above resolved
if (!msg.ecef_position_velocity.empty()) {
if (!msg.ecef_position_velocity.empty() && !_rel_heading_valid) {
if (!std::isnan(msg.ecef_position_velocity[0].velocity_xyz[0])) {
heading = msg.ecef_position_velocity[0].velocity_xyz[0];
}
Expand Down

0 comments on commit 3b936b4

Please sign in to comment.