Skip to content

Commit

Permalink
ubx: disable gps heading for in RTK float fix type (#104)
Browse files Browse the repository at this point in the history
RTK fixed is excellent whereas RTK float is generally bad.
The heading accuracy is generally not representative of the quality of the heading.

Setup:
- Two F9P GNSS units with software HPG 1.30
- Baseline: 82.2 cm
  • Loading branch information
JonasPerolini committed Apr 19, 2022
1 parent ddb1825 commit 6534b05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ubx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2036,9 +2036,10 @@ GPSDriverUBX::payloadRxDone()
float rel_length_acc = _buf.payload_rx_nav_relposned.accLength * 1e-2f;
bool heading_valid = _buf.payload_rx_nav_relposned.flags & (1 << 8);
bool rel_pos_valid = _buf.payload_rx_nav_relposned.flags & (1 << 2);
bool carrier_solution_fixed = _buf.payload_rx_nav_relposned.flags & (1 << 4);
(void)rel_length_acc;

if (heading_valid && rel_pos_valid && rel_length < 1000.f) { // validity & sanity checks
if (heading_valid && rel_pos_valid && rel_length < 1000.f && carrier_solution_fixed) { // validity & sanity checks
heading *= M_PI_F / 180.0f; // deg to rad, now in range [0, 2pi]
heading -= _heading_offset; // range: [-pi, 3pi]

Expand Down

0 comments on commit 6534b05

Please sign in to comment.