From 6534b050ee1a48af7932c46a9a87277eed1cc997 Mon Sep 17 00:00:00 2001 From: Jonas Perolini <74473718+JonasPerolini@users.noreply.github.com> Date: Tue, 19 Apr 2022 10:56:42 +0200 Subject: [PATCH] ubx: disable gps heading for in RTK float fix type (#104) 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 --- src/ubx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ubx.cpp b/src/ubx.cpp index 22bc8ab..ff9e8bc 100644 --- a/src/ubx.cpp +++ b/src/ubx.cpp @@ -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]