Skip to content

ubx: diff corrections age, fix quality, agc, antenna status and power#200

Open
dakejahl wants to merge 2 commits into
mainfrom
pr-ubx_quality_info
Open

ubx: diff corrections age, fix quality, agc, antenna status and power#200
dakejahl wants to merge 2 commits into
mainfrom
pr-ubx_quality_info

Conversation

@dakejahl
Copy link
Copy Markdown
Contributor

@dakejahl dakejahl commented Feb 9, 2026

Summary

Surface additional u-blox receiver state via sensor_gps:

  • diff_age — differential correction age in seconds, from UBX-NAV-PVT.flags3.lastCorrectionAge via a lookup table (binned 0-12 → 0-120 s).
  • automatic_gain_control — from UBX-MON-RF.agcCnt (0-8191, % of max gain).
  • antenna_status, antenna_power — from UBX-MON-RF.antStatus / antPower.
  • SYSTEM_ERROR_ANTENNA — set when antStatus reports SHORT or OPEN, cleared otherwise.

Also extends ubx_payload_rx_nav_pvt_t (adds flags3, magDec, magAcc) to match the ubx8+ spec and make flags3 addressable.

Not populated

Abstract quality metrics (corrections_quality, system_status_summary, gnss_signal_quality, post_processing_quality on sensor_gnss_status) are left at 255 — u-blox has no 0-10 metric equivalent to Septentrio's QualityInd. Synthesizing from fix_type would be circular.

Related

@AlexKlimaj
Copy link
Copy Markdown
Member

I don't know how many GPS boards implement the antenna sensing. We probably don't want a system error by default.

@dakejahl
Copy link
Copy Markdown
Contributor Author

I don't know how many GPS boards implement the antenna sensing.

I just checked the interface description for M9/F9/F10/M10/X20 and they all support UBX-MON-RF with antStatus, antPower, and agcCnt.

We probably don't want a system error by default.

It's already in the SensorGps.msg, we may as well populate it

@dakejahl
Copy link
Copy Markdown
Contributor Author

Ahh, the ublox modules require an additonal circuit to use the antenna status field. It has Dont Know values, so I need to test and check that it properly reports Dont Know when these are not connected
image

@dakejahl dakejahl changed the title ubx: diff corrections age, fix quality, agv, antenna status and power ubx: diff corrections age, fix quality, agc, antenna status and power Apr 8, 2026
@cuav-chen2
Copy link
Copy Markdown

Hi @dakejahl , these features are exactly what we needed. Thank you for the adaptation! This is some test data based on the CUAV positioning module—hope it proves helpful.

CUAV Neo3
image

CUAV C-RTK9Ps
image

CUAV Develop new products
image

None of the modules tested have implemented antenna sensing functionality, so the value of antStatus remains either 1 (INIT) or 2 (OK).

@dakejahl
Copy link
Copy Markdown
Contributor Author

@cuav-chen2 thanks for testing. I will work on this again, we should get it in. I'd like to also get in the DroneCAN DSDL message to support gnss quality reporting over CAN.
dronecan/DSDL#77

I think you already found the PX4 PR?
PX4/PX4-Autopilot#26438

Deriving fix_quality from fix_type is circular (consumers can already
do this themselves). u-blox provides no 0-10 quality metric aligned
with MAVLink GNSS_INTEGRITY, so leave the field unpopulated.
@cuav-chen2
Copy link
Copy Markdown

@cuav-chen2 thanks for testing. I will work on this again, we should get it in. I'd like to also get in the DroneCAN DSDL message to support gnss quality reporting over CAN. dronecan/DSDL#77

I think you already found the PX4 PR? PX4/PX4-Autopilot#26438

Yes, we will test DroneCAN messages as well, and will provide the test data later. @dakejahl

@dakejahl dakejahl marked this pull request as ready for review April 14, 2026 03:40
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