Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable gps heading for UBX driver in RTK float fix type #104

Merged
merged 5 commits into from
Apr 19, 2022

Conversation

JonasPerolini
Copy link
Contributor

@JonasPerolini JonasPerolini commented Apr 12, 2022

I've been testing the dual GPS heading using the ublox F9P chip. I get big angles spikes (yellow vertical lines in the attached file) as the gps fix_type changes from float RTK to fixed RTK. Furthermore, I see no changes in the heading accuracy.

RTKFloatFixType

Finally, as expected, I've observed that the heading estimates are always more precise in RTK fixed:

FixTypeResults

A simple solution, for now, is to disable the GPS heading when we are in RTK float fix type.

Note: I believe that @dagar and @bresch have also experienced drops in accuracy when switching from RTK float to RTK fixed fix type.

@dagar dagar self-requested a review April 12, 2022 18:05
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this for now but I can imagine u-blox improves this with a firmware update or in the next hardware.
Which firmware version do you use?

src/ubx.cpp Outdated Show resolved Hide resolved
src/ubx.cpp Outdated Show resolved Hide resolved
@JonasPerolini
Copy link
Contributor Author

We can do this for now but I can imagine u-blox improves this with a firmware update or in the next hardware. Which firmware version do you use?

HPG 1.30

@JonasPerolini
Copy link
Contributor Author

Thank you for the review @bkueng. I've pushed your suggestions.

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good apart from the small style issue.

src/ubx.cpp Outdated
@@ -2038,6 +2038,12 @@ GPSDriverUBX::payloadRxDone()
bool rel_pos_valid = _buf.payload_rx_nav_relposned.flags & (1 << 2);
(void)rel_length_acc;

// RTK float fix type is not accurate enough
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of depending on the fix_type being set I would directly check the carrier_solution_floating flag in NAV-RELPOSNED here.

See the carrier_solution_floating and carrier_solution_fixed handling below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the code, please let me know if this is what you meant @dagar

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would roll carrier_solution_fixed right into the conditional below, but otherwise this looks good.

src/ubx.cpp Outdated
@@ -2097,6 +2104,11 @@ GPSDriverUBX::payloadRxDone()
gps_rel.heading_valid = _buf.payload_rx_nav_relposned.flags & (1 << 8);
gps_rel.relative_position_normalized = _buf.payload_rx_nav_relposned.flags & (1 << 9);

if (!gps_rel.carrier_solution_fixed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would drop this for now, at the moment we're just passing on the "heading_valid" flag as reported in NAV-RELPOSNED. For the heading field in sensor_gps we can have a higher standard.

@dagar
Copy link
Member

dagar commented Apr 13, 2022

This looks good to me, but let's verify in a log with sensor_gnss_relative that this is the right thing to do.

@bkueng
Copy link
Member

bkueng commented Apr 19, 2022

@JonasPerolini did you test the changes?

@JonasPerolini
Copy link
Contributor Author

JonasPerolini commented Apr 19, 2022

Overview:

  1. As observed before, RTK fixed is excellent whereas RTK float is generally bad
  2. The heading accuracy is generally not representative of the quality of the heading
  3. Disabling the sensor_gps.00/heading in RTK float worked

Setup:

  • Two F9P GNSS units with software HPG 1.30
  • Baseline: 82.2 cm

DualGNSS

GNSS

Experiment:

Benchmark (in Green): Move the rigid bar 3 times 45 deg back and forth in RTK fixed

Temper main GPS (in blue) Repeat the following 3 times:

  1. Wait 20sec in RTK fixed
  2. Place hand in front of main GPS antenna until we are in RTK float
  3. Once in RTK float, move the rigid bar of 45 deg (clockwise or counterclockwise depending on the current position)
  4. Wait 20 sec in RTK float
  5. Remove hand to get into RTK fixed and
  6. Once in RTK fixed go back to 1.

Temper secondary GPS (in red): same experiment as 2 but tempering the secondary GPS.

Results:

45degAnalysisTest3

  • Red curve: sensor_gnss_relative/heading
  • Blue curve: sensor_gps.00/heading
  1. As expected, in RTK float there are no sensor_gps.00/heading values (see straight-line interpolation in the plot)
  2. When in RTK fixed we have excellent results: around 0.1-degree absolute error.
  3. When passing from RTK float to RTK fixed, we sometimes observe jumps in the heading estimate (see purple vertical lines)
  4. When tempering with the second GPS, we sometimes go into DGPS fix type (so we lose heading). Once we recover the heading in RTK float, it is generally unusable. Once we pass back to RTK fixed, the heading is precise

Note:

  1. The heading accuracy is usually not representative of the quality of the heading. For instance, during the 6.6-degree jump, the heading accuracy passes from 0.013 to 0.012.
  2. I've repeated the whole experiment 3 times and I obtain the same results.

@bkueng bkueng merged commit 6534b05 into PX4:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants