Skip to content

fix(mavlink): update TransponderReport flag bitmask#27878

Open
anilkir wants to merge 1 commit into
mainfrom
ak/fix-transponder-adsb-flags
Open

fix(mavlink): update TransponderReport flag bitmask#27878
anilkir wants to merge 1 commit into
mainfrom
ak/fix-transponder-adsb-flags

Conversation

@anilkir

@anilkir anilkir commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Solved Problem

TransponderReport.msg is missing MAVLink's SIMULATED, VERTICAL_VELOCITY_VALID, BARO_VALID, and SOURCE_UAT flags entirely (mavlink msg definition). The PX4_ADSB_FLAGS_RETRANSLATE bit (256) also collides with MAVLink's ADSB_FLAGS_BARO_VALID bit at the same value.

Solution

  • Moved PX4_ADSB_FLAGS_RETRANSLATE to bit 512 (unused by MAVLink's ADSB_FLAGS enum), resolving the collision
  • Added the missing flags with correct bit values.
  • Forwarded the new flags in both directions: (uORB → MAVLink) and (MAVLink → uORB).

Changelog Entry

For release notes:

Fix TransponderReport ADS-B flag bitmask to match MAVLink ADSB_FLAGS.

Alternatives

Test coverage

Context

Related links, screenshot before/after, video

@anilkir anilkir requested a review from MaEtUgR July 13, 2026 02:35
@anilkir anilkir self-assigned this Jul 13, 2026
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:uorb uORB messages, generated interfaces, or message translation. labels Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 136 byte (0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +136  +0.0%    +136    .text
     +20%     +72   +20%     +72    MavlinkReceiver::handle_message_adsb_vehicle()
     +15%     +64   +15%     +64    MavlinkStreamADSBVehicle::send()
  +0.0%     +65  [ = ]       0    .debug_abbrev
  +0.0%    +335  [ = ]       0    .debug_info
  +0.0%    +136  [ = ]       0    .debug_line
     +33%      +1  [ = ]       0    [Unmapped]
    +0.0%    +135  [ = ]       0    [section .debug_line]
  -0.0%     -10  [ = ]       0    .debug_loclists
  -0.0%      -2  [ = ]       0    .debug_rnglists
  +0.0%    +244  [ = ]       0    .debug_str
  -1.6%    -136  [ = ]       0    [Unmapped]
  +0.0%    +768  +0.0%    +136    TOTAL

px4_fmu-v6x [Total VM Diff: 144 byte (0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +144  +0.0%    +144    .text
     +20%     +72   +20%     +72    MavlinkReceiver::handle_message_adsb_vehicle()
     +15%     +64   +15%     +64    MavlinkStreamADSBVehicle::send()
    +0.0%      +8  +0.0%      +8    [section .text]
  +0.0%     +65  [ = ]       0    .debug_abbrev
  +0.0%    +335  [ = ]       0    .debug_info
  +0.0%    +128  [ = ]       0    .debug_line
    [DEL]      -7  [ = ]       0    [Unmapped]
    +0.0%    +135  [ = ]       0    [section .debug_line]
  +0.0%     +12  [ = ]       0    .debug_loclists
  +0.0%    +244  [ = ]       0    .debug_str
  -2.7%    -144  [ = ]       0    [Unmapped]
  +0.0%    +784  +0.0%    +144    TOTAL

Updated: 2026-07-13T02:40:42

Comment thread msg/TransponderReport.msg
uint16 PX4_ADSB_FLAGS_SOURCE_UAT = 32768

# PX4-internal flag, not part of the MAVLink ADSB_FLAGS bitmask: uses a bit MAVLink leaves unused
uint16 PX4_ADSB_FLAGS_RETRANSLATE = 512

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could make it the last bit (32768) for now to not change value until there's a conflict with the last bit in MAVLink.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The last bit is used in MAVLink 🤯 Someone else had the same broken strategy 👀
https://github.com/mavlink/mavlink/blob/f9cb1f9e482977446c3dd953a16368d4834c6aa5/message_definitions/v1.0/common.xml#L3665

Should we make it a separate field to avoid future conflicts or is that overengineered? Let me check 👀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Separate field works for me as it avoids any future conflicts with the MAVLink enum. Let me know your final recommendation

@dakejahl dakejahl requested a review from JonasPerolini July 14, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. scope:mavlink MAVLink module, streams, commands, or protocol handling. scope:offboard Offboard mode, external setpoints, companion-computer control, or offboard failsafe behavior. scope:uorb uORB messages, generated interfaces, or message translation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants