Skip to content

Conversation

niklaut
Copy link
Contributor

@niklaut niklaut commented Oct 1, 2025

Solved Problem

  • VTX protocols and robust round-robin scheduler
    • Tramp protocol
    • SmartAudio v1, v2, v2.1 protocol
  • Control of band, channel, frequency, power, pit mode.
    • CRSF MSP message parser for setting
    • RC input via aux map table
    • Parameters via Mavlink or QGC/AMC
  • RC aux map table and VTX table support saved/restored from file
  • Receiving VTX table and RX AUX map table via uORB/DDS
  • Sending VTX settings and state via uORB/DDS
  • CLI interface similar to betaflight

Depends on #25693.

Changelog Entry

For release notes:

Feature: Add VTX support with Tramp and SmartAudio protocols

Alternatives

The uORB messages are quite large, but I didn't come up with anything better.

Also proper module documentation is currently missing, it's unlikely I'll have time for this in the next two months tho.

Test coverage

  • Testing in hardware with various Tramp and SA VTXes

Copy link

github-actions bot commented Oct 1, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 2528 byte (0.12 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.1% +2.47Ki  +0.1% +2.47Ki    .text
  [NEW]    +460  [NEW]    +460    ucdr_deserialize_vehicle_global_position()
  +6.0%    +428  +6.0%    +428    on_topic_update()
  [NEW]    +404  [NEW]    +404    ucdr_deserialize_sensor_optical_flow()
  [NEW]    +324  [NEW]    +324    ucdr_deserialize_vehicle_control_mode()
  +1.3%    +248  +1.3%    +248    uORB::compressed_fields
  [NEW]    +172  [NEW]    +172    ucdr_serialize_vtx()
  +0.1%    +152  +0.1%    +152    [section .text]
  +3.9%    +124  +3.9%    +124    UxrceddsClient::run()
  +5.2%    +104  +5.2%    +104    RcvTopicsPubs::init()
  +5.6%     +52  +5.6%     +52    RcvTopicsPubs::~RcvTopicsPubs()
  [NEW]     +16  [NEW]     +16    __orb_vtx
  [NEW]     +16  [NEW]     +16    __orb_vtx_aux_map
  [NEW]     +16  [NEW]     +16    __orb_vtx_table
  +0.5%     +16  +0.5%     +16    px4::logger::LoggedTopics::add_default_topics()
  +1.0%     +12  +1.0%     +12    uorb_topics_list
 -95.0%      +4 -95.0%      +4    [1 Others]
  -1.0%      -4  -1.0%      -4    SendTopicsSubs::init()
  -1.2%      -4  -1.2%      -4    UxrceddsClient::init()
  -0.4%      -4  -0.4%      -4    two_over_pi
  -3.0%      -4  -3.0%      -4    uORB::Manager::orb_device_node_exists()
  -2.9%      -4  -2.9%      -4    uORB::Manager::orb_exists()
+0.4% +7.01Ki  [ = ]       0    .debug_abbrev
+0.1%    +128  [ = ]       0    .debug_aranges
+0.1%    +280  [ = ]       0    .debug_frame
+0.2% +43.1Ki  [ = ]       0    .debug_info
+0.1% +6.99Ki  [ = ]       0    .debug_line
   +40%      +2  [ = ]       0    [Unmapped]
  +0.1% +6.99Ki  [ = ]       0    [section .debug_line]
+0.0%    +707  [ = ]       0    .debug_loclists
+0.0%    +199  [ = ]       0    .debug_rnglists
 -33.3%      -1  [ = ]       0    [Unmapped]
  +0.0%    +200  [ = ]       0    [section .debug_rnglists]
+0.1% +2.06Ki  [ = ]       0    .debug_str
+1.3%      +3  [ = ]       0    .shstrtab
+0.1%    +373  [ = ]       0    .strtab
  +0.1%     +38  [ = ]       0    [section .strtab]
  [NEW]     +10  [ = ]       0    __orb_vtx
  [NEW]     +18  [ = ]       0    __orb_vtx_aux_map
  [NEW]     +16  [ = ]       0    __orb_vtx_table
  [NEW]     +80  [ = ]       0    ucdr_deserialize_sensor_optical_flow()
  [NEW]     +82  [ = ]       0    ucdr_deserialize_vehicle_control_mode()
  [NEW]     +88  [ = ]       0    ucdr_deserialize_vehicle_global_position()
  [NEW]     +41  [ = ]       0    ucdr_serialize_vtx()
+0.0%    +272  [ = ]       0    .symtab
  +100%     +32  [ = ]       0    UxrceddsClient::init()
  -0.1%     -16  [ = ]       0    [section .symtab]
  [NEW]     +48  [ = ]       0    __orb_vtx
  [NEW]     +48  [ = ]       0    __orb_vtx_aux_map
  [NEW]     +48  [ = ]       0    __orb_vtx_table
  [NEW]     +32  [ = ]       0    ucdr_deserialize_sensor_optical_flow()
  [NEW]     +32  [ = ]       0    ucdr_deserialize_vehicle_control_mode()
  [NEW]     +16  [ = ]       0    ucdr_deserialize_vehicle_global_position()
  [NEW]     +32  [ = ]       0    ucdr_serialize_vtx()
 +20% +1.53Ki  [ = ]       0    [Unmapped]
+0.1% +65.1Ki  +0.1% +2.47Ki    TOTAL

px4_fmu-v6x [Total VM Diff: 2512 byte (0.13 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.1% +2.45Ki  +0.1% +2.45Ki    .text
  [NEW]    +460  [NEW]    +460    ucdr_deserialize_vehicle_global_position()
  +6.0%    +428  +6.0%    +428    on_topic_update()
  [NEW]    +404  [NEW]    +404    ucdr_deserialize_sensor_optical_flow()
  [NEW]    +324  [NEW]    +324    ucdr_deserialize_vehicle_control_mode()
  +1.3%    +248  +1.3%    +248    uORB::compressed_fields
  [NEW]    +172  [NEW]    +172    ucdr_serialize_vtx()
  +0.1%    +152  +0.1%    +152    [section .text]
  +3.9%    +124  +3.9%    +124    UxrceddsClient::run()
  +5.2%    +104  +5.2%    +104    RcvTopicsPubs::init()
  +5.6%     +52  +5.6%     +52    RcvTopicsPubs::~RcvTopicsPubs()
  [NEW]     +16  [NEW]     +16    __orb_vtx
  [NEW]     +16  [NEW]     +16    __orb_vtx_aux_map
  [NEW]     +16  [NEW]     +16    __orb_vtx_table
  +0.5%     +16  +0.5%     +16    px4::logger::LoggedTopics::add_default_topics()
  +1.0%     +12  +1.0%     +12    uorb_topics_list
  -1.0%      -4  -1.0%      -4    SendTopicsSubs::init()
  -1.2%      -4  -1.2%      -4    UxrceddsClient::init()
  -1.0%      -4  -1.0%      -4    atanf
 -16.7%      -4 -16.7%      -4    get_orb_meta()
  -0.4%      -4  -0.4%      -4    two_over_pi
 -103.4%     -12 -103.4%     -12    [3 Others]
+0.4% +6.89Ki  [ = ]       0    .debug_abbrev
+0.1%    +128  [ = ]       0    .debug_aranges
+0.1%    +280  [ = ]       0    .debug_frame
+0.2% +42.9Ki  [ = ]       0    .debug_info
+0.1% +7.00Ki  [ = ]       0    .debug_line
+0.0%    +828  [ = ]       0    .debug_loclists
+0.0%    +198  [ = ]       0    .debug_rnglists
  [DEL]      -2  [ = ]       0    [Unmapped]
  +0.0%    +200  [ = ]       0    [section .debug_rnglists]
+0.1% +2.06Ki  [ = ]       0    .debug_str
+1.3%      +3  [ = ]       0    .shstrtab
+0.1%    +373  [ = ]       0    .strtab
  +0.2%     +38  [ = ]       0    [section .strtab]
  [NEW]     +10  [ = ]       0    __orb_vtx
  [NEW]     +18  [ = ]       0    __orb_vtx_aux_map
  [NEW]     +16  [ = ]       0    __orb_vtx_table
  [NEW]     +80  [ = ]       0    ucdr_deserialize_sensor_optical_flow()
  [NEW]     +82  [ = ]       0    ucdr_deserialize_vehicle_control_mode()
  [NEW]     +88  [ = ]       0    ucdr_deserialize_vehicle_global_position()
  [NEW]     +41  [ = ]       0    ucdr_serialize_vtx()
+0.0%    +272  [ = ]       0    .symtab
  +100%     +32  [ = ]       0    UxrceddsClient::init()
  -0.4%     -48  [ = ]       0    [section .symtab]
  [NEW]     +48  [ = ]       0    __orb_vtx
  [NEW]     +48  [ = ]       0    __orb_vtx_aux_map
  [NEW]     +48  [ = ]       0    __orb_vtx_table
   +50%     +16  [ = ]       0    atanf
   +33%     +16  [ = ]       0    atanlo
  [NEW]     +32  [ = ]       0    ucdr_deserialize_sensor_optical_flow()
  [NEW]     +32  [ = ]       0    ucdr_deserialize_vehicle_control_mode()
  [NEW]     +16  [ = ]       0    ucdr_deserialize_vehicle_global_position()
  [NEW]     +32  [ = ]       0    ucdr_serialize_vtx()
 +37% +1.55Ki  [ = ]       0    [Unmapped]
+0.1% +64.9Ki  +0.1% +2.45Ki    TOTAL

Updated: 2025-10-13T09:58:48

@PetervdPerk-NXP
Copy link
Member

Cool work, any chance to consolidate MSP VTX (HDZero, DJI etc) as well?
We do have MSP VTX support inside the OSD driver albeit by CLI,

int MspOsd::set_channel(char *new_channel)

@niklaut
Copy link
Contributor Author

niklaut commented Oct 1, 2025

Cool work, any chance to consolidate MSP VTX (HDZero, DJI etc) as well?

Eventually yes, but not in this PR. I see that the VTX table config is duplicated, but that can be shared later internally without impacting any public interfaces. Otherwise the OSD driver probably also wants to listen to the vtx message and relay that information later.

@niklaut niklaut force-pushed the pr-crsf-status-messages branch from 66ed0e3 to f5a0664 Compare October 2, 2025 11:11
@jsm09a
Copy link

jsm09a commented Oct 2, 2025

Does this address issue #24903 by any chance ?

@niklaut
Copy link
Contributor Author

niklaut commented Oct 2, 2025

Does this address issue #24903 by any chance ?

Edit: No, not at all. Kinda.

I've implemented support for the CRSF MSP message MSP_SET_VTX_CONFIG (89=0x59) that allows setting band/channel/frequency/power/pitmode via CRSF.
But the rest of the protocol, ie. using MSP to write the VTX table is not implemented.

@niklaut niklaut force-pushed the pr-crsf-status-messages branch from f5a0664 to 97de489 Compare October 3, 2025 10:32
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