Skip to content

feat(gps): add support for UBX_MSG_MON_SPAN - #28173

Open
ThomasRigi wants to merge 5 commits into
mainfrom
pr-ubx-mon-span
Open

feat(gps): add support for UBX_MSG_MON_SPAN#28173
ThomasRigi wants to merge 5 commits into
mainfrom
pr-ubx-mon-span

Conversation

@ThomasRigi

Copy link
Copy Markdown
Member

Solved Problem

Replaces #20474

UBX_MSG_MON_SPAN has a lot of valuable information for debugging degraded GNSS reception.

Solution

Following the example of @dagar in #20474, but extending it for multi-block logging so that the data is

Changelog Entry

For release notes:

New parameter: GPS_UBX_SPECTRUM

Test coverage

tbc

Context

Not advisable to run on low baudrate. The messages are big.

@github-actions github-actions Bot added kind:feature Request or change that adds new functionality. scope:drivers Device drivers and hardware interfaces. scope:sensors Sensor pipeline, calibration, voting, or sensor validation. scope:uorb uORB messages, generated interfaces, or message translation. scope:logging ULog, logger, replay, events, or diagnostics. labels Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 1200 byte (0.06 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.16Ki  +0.1% +1.16Ki    .text
    +7.6%    +220  +7.6%    +220    GPSDriverUBX::payloadRxDone()
    +0.1%    +156  +0.1%    +156    [section .text]
    +2.9%    +108  +2.9%    +108    GPSDriverUBX::configureDevice()
    +0.5%    +108  +0.5%    +108    uORB::compressed_fields
   -98.4%     +90 -98.4%     +90    [29 Others]
    +0.0%     +72  +0.0%     +72    g_cromfs_image
    +2.0%     +72  +2.0%     +72    px4::logger::LoggedTopics::add_default_topics()
    [NEW]     +60  [NEW]     +60    GPS::publishSpectrumBlock0()
    [NEW]     +60  [NEW]     +60    GPS::publishSpectrumBlock1()
    +2.4%     +44  +2.4%     +44    GPS::run()
    +6.2%     +44  +6.2%     +44    GPSDriverUBX::payloadRxInit()
    +4.7%     +32  +4.7%     +32    GPS::GPS()
    [NEW]     +20  [NEW]     +20    GPS::publishSpectrum()
    +8.2%     +16  +8.2%     +16    GPS::callback()
    +6.0%     +16  +6.0%     +16    GPS::~GPS()
    [NEW]     +16  [NEW]     +16    __orb_sensor_gnss_spectrum_block0
    [NEW]     +16  [NEW]     +16    __orb_sensor_gnss_spectrum_block1
    +4.3%     +10  +4.3%     +10    GPSDriverUBX::cfgValset<>()
    +4.9%      +8  +4.9%      +8    GPSDriverUBX::GPSDriverUBX()
    +0.1%      +8  +0.1%      +8    px4::parameters
    +0.6%      +8  +0.6%      +8    uorb_topics_list
  +0.1%     +16  +0.1%     +16    .ramfunc
    +1.2%      +4  +1.2%      +4    Ekf::measurementUpdate()
    +1.9%      +4  +1.9%      +4    param_get
     +33%      +4   +33%      +4    param_get_index
    +9.1%      +4  +9.1%      +4    param_get_system_default_value
     +14%      +1   +14%      +1    __clock_abstime2ticks_veneer
   -12.5%      -1 -12.5%      -1    __nxsig_lowest_veneer
  +0.1% +1.24Ki  [ = ]       0    .debug_abbrev
  +0.0%     +56  [ = ]       0    .debug_aranges
  +0.0%    +124  [ = ]       0    .debug_frame
  +0.1% +27.7Ki  [ = ]       0    .debug_info
  +0.1% +2.33Ki  [ = ]       0    .debug_line
   -57.1%      -4  [ = ]       0    [Unmapped]
    +0.1% +2.33Ki  [ = ]       0    [section .debug_line]
  +0.0%    +642  [ = ]       0    .debug_loclists
  +0.0%    +186  [ = ]       0    .debug_rnglists
    +100%      +1  [ = ]       0    [Unmapped]
    +0.0%    +185  [ = ]       0    [section .debug_rnglists]
  +0.0% +1.38Ki  [ = ]       0    .debug_str
  +0.8%      +2  [ = ]       0    .shstrtab
  +0.1%    +350  [ = ]       0    .strtab
    [NEW]     +46  [ = ]       0    GPS::_is_spectrum_block0_main_advertised
    [NEW]     +46  [ = ]       0    GPS::_is_spectrum_block1_main_advertised
    [NEW]     +51  [ = ]       0    GPS::publishSpectrum()
    [NEW]     +57  [ = ]       0    GPS::publishSpectrumBlock0()
    [NEW]     +57  [ = ]       0    GPS::publishSpectrumBlock1()
    +0.1%     +25  [ = ]       0    [section .strtab]
   -26.7%     -16  [ = ]       0    ___ZL19param_get_cplusplustPf.isra.0_veneer
    [NEW]     +34  [ = ]       0    __orb_sensor_gnss_spectrum_block0
    [NEW]     +34  [ = ]       0    __orb_sensor_gnss_spectrum_block1
     +67%     +16  [ = ]       0    __uart_connected_veneer
  +0.0%    +272  [ = ]       0    .symtab
   -33.3%     -16  [ = ]       0    ConstLayer::contains()
     +50%     +16  [ = ]       0    ConstLayer::store()
    [NEW]     +32  [ = ]       0    GPS::_is_spectrum_block0_main_advertised
    [NEW]     +32  [ = ]       0    GPS::_is_spectrum_block1_main_advertised
     +50%     +16  [ = ]       0    GPS::publishRTCMCorrections()
   -50.0%     -16  [ = ]       0    GPS::publishRelativePosition()
    [NEW]     +32  [ = ]       0    GPS::publishSpectrum()
    [NEW]     +48  [ = ]       0    GPS::publishSpectrumBlock0()
    [NEW]     +48  [ = ]       0    GPS::publishSpectrumBlock1()
    +5.9%     +16  [ = ]       0    GPSDriverUBX::cfgValset<>()
   -50.0%     -16  [ = ]       0    GPSDriverUBX::cfgValsetPort()
     +50%     +16  [ = ]       0    GPSDriverUBX::initCfgValset()
   -50.0%     -16  [ = ]       0    GPSDriverUBX::payloadRxAdd()
     +14%     +16  [ = ]       0    GPSDriverUBX::payloadRxDone()
   -25.0%     -32  [ = ]       0    RcvTopicsPubs::init()
   -93.8%     +48  [ = ]       0    [12 Others]
    +0.8%     +96  [ = ]       0    [section .symtab]
   -11.8%     -32  [ = ]       0    ___ZL19param_get_cplusplustPf.isra.0_veneer
   -25.0%     -16  [ = ]       0    ___ZNK3px46atomicIbE4loadEv_veneer
     +50%     +16  [ = ]       0    __clock_abstime2ticks_veneer
   -33.3%     -16  [ = ]       0    __nxsig_lowest_veneer
 -10.4% -1.17Ki  [ = ]       0    [Unmapped]
  +0.1% +34.3Ki  +0.1% +1.17Ki    TOTAL

px4_fmu-v6x [Total VM Diff: 1152 byte (0.06 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1% +1.12Ki  +0.1% +1.12Ki    .text
    +7.6%    +220  +7.6%    +220    GPSDriverUBX::payloadRxDone()
    +0.1%    +180  +0.1%    +180    [section .text]
    +2.9%    +108  +2.9%    +108    GPSDriverUBX::configureDevice()
    +0.5%    +108  +0.5%    +108    uORB::compressed_fields
    +0.0%     +80  +0.0%     +80    g_cromfs_image
    +2.0%     +72  +2.0%     +72    px4::logger::LoggedTopics::add_default_topics()
    [NEW]     +60  [NEW]     +60    GPS::publishSpectrumBlock0()
    [NEW]     +60  [NEW]     +60    GPS::publishSpectrumBlock1()
    +2.4%     +44  +2.4%     +44    GPS::run()
    +6.2%     +44  +6.2%     +44    GPSDriverUBX::payloadRxInit()
    +4.7%     +32  +4.7%     +32    GPS::GPS()
   -99.5%     +26 -99.5%     +26    [13 Others]
    [NEW]     +20  [NEW]     +20    GPS::publishSpectrum()
    +8.2%     +16  +8.2%     +16    GPS::callback()
    +6.0%     +16  +6.0%     +16    GPS::~GPS()
    [NEW]     +16  [NEW]     +16    __orb_sensor_gnss_spectrum_block0
    [NEW]     +16  [NEW]     +16    __orb_sensor_gnss_spectrum_block1
    +4.3%     +10  +4.3%     +10    GPSDriverUBX::cfgValset<>()
    +4.9%      +8  +4.9%      +8    GPSDriverUBX::GPSDriverUBX()
    +0.1%      +8  +0.1%      +8    px4::parameters
    +0.6%      +8  +0.6%      +8    uorb_topics_list
  +0.1% +1.24Ki  [ = ]       0    .debug_abbrev
  +0.0%     +56  [ = ]       0    .debug_aranges
  +0.0%    +124  [ = ]       0    .debug_frame
  +0.1% +27.4Ki  [ = ]       0    .debug_info
  +0.1% +2.30Ki  [ = ]       0    .debug_line
    +400%      +4  [ = ]       0    [Unmapped]
    +0.1% +2.30Ki  [ = ]       0    [section .debug_line]
  +0.0%    +661  [ = ]       0    .debug_loclists
  +0.0%    +183  [ = ]       0    .debug_rnglists
    +200%      +2  [ = ]       0    [Unmapped]
    +0.0%    +181  [ = ]       0    [section .debug_rnglists]
  +0.0% +1.38Ki  [ = ]       0    .debug_str
  -0.8%      -2  [ = ]       0    .shstrtab
  +0.1%    +350  [ = ]       0    .strtab
    [NEW]     +46  [ = ]       0    GPS::_is_spectrum_block0_main_advertised
    [NEW]     +46  [ = ]       0    GPS::_is_spectrum_block1_main_advertised
    [NEW]     +51  [ = ]       0    GPS::publishSpectrum()
    [NEW]     +57  [ = ]       0    GPS::publishSpectrumBlock0()
    [NEW]     +57  [ = ]       0    GPS::publishSpectrumBlock1()
    +0.1%     +25  [ = ]       0    [section .strtab]
    [NEW]     +34  [ = ]       0    __orb_sensor_gnss_spectrum_block0
    [NEW]     +34  [ = ]       0    __orb_sensor_gnss_spectrum_block1
  +0.0%    +272  [ = ]       0    .symtab
    [NEW]     +32  [ = ]       0    GPS::_is_spectrum_block0_main_advertised
    [NEW]     +32  [ = ]       0    GPS::_is_spectrum_block1_main_advertised
     +50%     +16  [ = ]       0    GPS::publishRTCMCorrections()
   -50.0%     -16  [ = ]       0    GPS::publishRelativePosition()
    [NEW]     +32  [ = ]       0    GPS::publishSpectrum()
    [NEW]     +48  [ = ]       0    GPS::publishSpectrumBlock0()
    [NEW]     +48  [ = ]       0    GPS::publishSpectrumBlock1()
    +5.9%     +16  [ = ]       0    GPSDriverUBX::cfgValset<>()
   -50.0%     -16  [ = ]       0    GPSDriverUBX::cfgValsetPort()
     +50%     +16  [ = ]       0    GPSDriverUBX::initCfgValset()
   -50.0%     -16  [ = ]       0    GPSDriverUBX::payloadRxAdd()
     +14%     +16  [ = ]       0    GPSDriverUBX::payloadRxDone()
   -25.0%     -32  [ = ]       0    RcvTopicsPubs::init()
    +0.5%     +64  [ = ]       0    [section .symtab]
    [NEW]     +48  [ = ]       0    __orb_sensor_gnss_spectrum_block0
    [NEW]     +32  [ = ]       0    __orb_sensor_gnss_spectrum_block1
     +25%     +16  [ = ]       0    do_not_explicitly_use_this_namespace::Param<>::Param()
   -50.0%     -32  [ = ]       0    fmodf
    -7.1%     -16  [ = ]       0    px4::atomic<>::load()
    -2.0%     -16  [ = ]       0    uavcan::TimerEventForwarder<>::~TimerEventForwarder()
 -14.7% -1.12Ki  [ = ]       0    [Unmapped]
  +0.1% +34.0Ki  +0.1% +1.12Ki    TOTAL

Updated: 2026-08-06T15:22:02

Comment thread msg/SensorGnssSpectrum.msg Outdated
Comment thread msg/SensorGnssSpectrum.msg Outdated
Comment thread msg/SensorGnssSpectrum.msg Outdated
add_optional_topic_multi("sensor_temp", 100, 4);
add_optional_topic_multi("rpm", 200);
add_optional_topic_multi("sensor_gnss_spectrum_block0", 5000, 2);
add_optional_topic_multi("sensor_gnss_spectrum_block1", 5000, 2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

optional topics are finicky, they won't get added to the log if the topic hasn't been advertised by the time the logger runs

Comment thread src/drivers/gps/params.yaml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Request or change that adds new functionality. scope:drivers Device drivers and hardware interfaces. scope:logging ULog, logger, replay, events, or diagnostics. scope:sensors Sensor pipeline, calibration, voting, or sensor validation. scope:uorb uORB messages, generated interfaces, or message translation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants