Skip to content

Comments

Added support for colored navigation lights and hybrid light functions.#26513

Open
Claudio-Chies wants to merge 2 commits intomainfrom
pr-uavcan_led_fix
Open

Added support for colored navigation lights and hybrid light functions.#26513
Claudio-Chies wants to merge 2 commits intomainfrom
pr-uavcan_led_fix

Conversation

@Claudio-Chies
Copy link
Member

Extends the functionality of #26253

Adds option for colored navigation lights, and also hybrid setup where depending on UAVCAN_LGT_MODE the behaviour of the RGB leds change from Status lights to navigation lights.

@github-actions
Copy link

No broken links found in changed files.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 192 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +176  +0.0%    +176    .text
  +0.1%    +116  +0.1%    +116    g_cromfs_image
  [NEW]     +84  [NEW]     +84    UavcanRGBController::is_light_on()
  [NEW]     +76  [NEW]     +76    UavcanRGBController::color_to_rgb565()
 -99.6%     +36 -99.6%     +36    [16 Others]
  +0.5%      +8  +0.5%      +8    UavcanNode::Run()
  +1.6%      +8  +1.6%      +8    UavcanNode::~UavcanNode()
   +33%      +4   +33%      +4    ConstLayer::contains()
   +17%      +4   +17%      +4    ConstLayer::get()
  +4.8%      +4  +4.8%      +4    UavcanNode::param_opcode()
   +50%      +4   +50%      +4    Zero
  +2.6%      +4  +2.6%      +4    param_find_internal()
   +25%      +4   +25%      +4    param_for_index
  +4.8%      +4  +4.8%      +4    param_for_used_index
  -2.4%      -4  -2.4%      -4    Commander::handleCommandsFromModeExecutors()
  -4.5%      -4  -4.5%      -4    FlightTask
  -0.7%      -4  -0.7%      -4    UavcanRGBController::periodic_update()
  -1.8%      -8  -1.8%      -8    UavcanNode::handle_time_sync()
  -5.3%     -12  -5.3%     -12    UavcanRGBController::UavcanRGBController()
  -0.1%     -16  -0.1%     -16    px4::parameters
  -0.0%     -48  -0.0%     -48    [section .text]
  [DEL]     -84  [DEL]     -84    UavcanRGBController::is_anticolision_on()
+0.1%     +16  +0.1%     +16    .ramfunc
  +1.7%      +4  +1.7%      +4    param_get
  +1.4%      +4  +1.4%      +4    param_get_default_value
   +33%      +4   +33%      +4    param_get_index
  +9.1%      +4  +9.1%      +4    param_get_system_default_value
   +14%      +1   +14%      +1    __stm32_ep0out_setup_veneer
 -12.5%      -1 -12.5%      -1    __arp_ipin_veneer
+0.0%     +43  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +32  [ = ]       0    .debug_frame
-0.0% -3.38Ki  [ = ]       0    .debug_info
+0.0%    +110  [ = ]       0    .debug_line
-0.0%    -211  [ = ]       0    .debug_loclists
+0.0%     +60  [ = ]       0    .debug_rnglists
  [NEW]      +2  [ = ]       0    [Unmapped]
  +0.0%     +58  [ = ]       0    [section .debug_rnglists]
+0.0%     +99  [ = ]       0    .debug_str
-0.8%      -2  [ = ]       0    .shstrtab
+0.0%     +38  [ = ]       0    .strtab
  [NEW]     +45  [ = ]       0    UavcanRGBController::color_to_rgb565()
  [DEL]     -47  [ = ]       0    UavcanRGBController::is_anticolision_on()
  [NEW]     +40  [ = ]       0    UavcanRGBController::is_light_on()
+0.0%     +64  [ = ]       0    .symtab
 -33.3%     -16  [ = ]       0    ConstLayer::contains()
   +50%     +16  [ = ]       0    ConstLayer::store()
  [NEW]     +64  [ = ]       0    UavcanRGBController::color_to_rgb565()
  [DEL]     -32  [ = ]       0    UavcanRGBController::is_anticolision_on()
  [NEW]     +32  [ = ]       0    UavcanRGBController::is_light_on()
  +0.6%     +64  [ = ]       0    [section .symtab]
   +33%     +16  [ = ]       0    ___ZNK3px46atomicIbE4loadEv_veneer
 -33.3%     -16  [ = ]       0    __arp_ipin_veneer
   +50%     +16  [ = ]       0    __stm32_ep0out_setup_veneer
 -25.0%     -16  [ = ]       0    __stm32_usbreset.constprop.0_veneer
 -50.0%     -16  [ = ]       0    param_for_index
  -7.1%     -16  [ = ]       0    param_get_cplusplus()
 -50.0%     -16  [ = ]       0    param_get_index
 -50.0%     -32  [ = ]       0    param_hash_check
   +50%     +16  [ = ]       0    px4::parameters_volatile
   +50%     +16  [ = ]       0    uavcan::CanFrame::CanFrame()
  +0.4%     +16  [ = ]       0    uavcan::GenericSubscriber<>::~GenericSubscriber()
  -2.7%     -16  [ = ]       0    uavcan::ServiceServer<>::~ServiceServer()
 -33.3%     -16  [ = ]       0    uavcan::fill<>()
-1.9%    -192  [ = ]       0    [Unmapped]
-0.0% -3.14Ki  +0.0%    +192    TOTAL

px4_fmu-v6x [Total VM Diff: 8 byte (0 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%      +8  +0.0%      +8    .text
  +0.1%    +116  +0.1%    +116    g_cromfs_image
  [NEW]     +84  [NEW]     +84    UavcanRGBController::is_light_on()
  [NEW]     +76  [NEW]     +76    UavcanRGBController::color_to_rgb565()
  +0.5%      +8  +0.5%      +8    UavcanNode::Run()
  +1.6%      +8  +1.6%      +8    UavcanNode::~UavcanNode()
  +4.8%      +4  +4.8%      +4    FlightTask
  +4.8%      +4  +4.8%      +4    UavcanNode::param_opcode()
  -2.4%      -4  -2.4%      -4    Commander::handleCommandsFromModeExecutors()
  -5.6%      -4  -5.6%      -4    ConstLayer::containedAsBitset()
 -25.0%      -4 -25.0%      -4    ConstLayer::contains()
 -14.3%      -4 -14.3%      -4    ConstLayer::get()
  -0.7%      -4  -0.7%      -4    UavcanRGBController::periodic_update()
 -33.3%      -4 -33.3%      -4    Zero
  -1.8%      -8  -1.8%      -8    UavcanNode::handle_time_sync()
  -2.6%      -8  -2.6%      -8    param_hash_check
  -5.3%     -12  -5.3%     -12    UavcanRGBController::UavcanRGBController()
  -0.1%     -16  -0.1%     -16    px4::parameters
  -4.5%     -20  -4.5%     -20    param_reset_specific
  -0.0%     -32  -0.0%     -32    [section .text]
  [DEL]     -84  [DEL]     -84    UavcanRGBController::is_anticolision_on()
 -100.9%     -88 -100.9%     -88    [25 Others]
+0.0%     +43  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +12  [ = ]       0    .debug_frame
-0.0% -3.26Ki  [ = ]       0    .debug_info
-0.0%     -22  [ = ]       0    .debug_line
   +67%      +2  [ = ]       0    [Unmapped]
  -0.0%     -24  [ = ]       0    [section .debug_line]
-0.0%    -201  [ = ]       0    .debug_loclists
+0.0%     +38  [ = ]       0    .debug_rnglists
  [DEL]      -3  [ = ]       0    [Unmapped]
  +0.0%     +41  [ = ]       0    [section .debug_rnglists]
+0.0%     +99  [ = ]       0    .debug_str
+0.9%      +2  [ = ]       0    .shstrtab
+0.0%     +38  [ = ]       0    .strtab
  [NEW]     +45  [ = ]       0    UavcanRGBController::color_to_rgb565()
  [DEL]     -47  [ = ]       0    UavcanRGBController::is_anticolision_on()
  [NEW]     +40  [ = ]       0    UavcanRGBController::is_light_on()
+0.0%     +64  [ = ]       0    .symtab
  +100%     +16  [ = ]       0    ConstLayer::containedAsBitset()
  +100%     +16  [ = ]       0    ConstLayer::contains()
 -33.3%     -16  [ = ]       0    ConstLayer::store()
   +25%     +16  [ = ]       0    DynamicSparseLayer::DynamicSparseLayer()
  [NEW]     +64  [ = ]       0    UavcanRGBController::color_to_rgb565()
  [DEL]     -32  [ = ]       0    UavcanRGBController::is_anticolision_on()
  [NEW]     +32  [ = ]       0    UavcanRGBController::is_light_on()
  -0.7%     -80  [ = ]       0    [section .symtab]
  +100%     +16  [ = ]       0    param_for_index
  +100%     +16  [ = ]       0    param_get_index
  +100%     +32  [ = ]       0    param_hash_check
 -25.0%     -16  [ = ]       0    param_import_internal()
   +50%     +16  [ = ]       0    uavcan::CanFrame::CanFrame()
  +0.4%     +16  [ = ]       0    uavcan::GenericSubscriber<>::~GenericSubscriber()
  -2.7%     -16  [ = ]       0    uavcan::ServiceServer<>::~ServiceServer()
 -33.3%     -16  [ = ]       0    uavcan::fill<>()
-0.1%      -8  [ = ]       0    [Unmapped]
-0.0% -3.18Ki  +0.0%      +8    TOTAL

Updated: 2026-02-18T19:41:59

@MaEtUgR MaEtUgR marked this pull request as ready for review February 18, 2026 19:34
@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 18, 2026

What was the difference between anti-collision and white navigation? 👀 There was some dead code added back and some duplication of color handling. Docs are not corrected yet. @Claudio-Chies could you double-check this still does what you intended?

Comment on lines +67 to +74
0: Status
1: White Navigation
2: Red Navigation
3: Green Navigation
4: Status / White Navigation
5: Status / Red Navigation
6: Status / Green Navigation
7: Status / Off
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. What are the different navigation types? I.e. does white navigation mean anything vs red navigation? Is this standard aircraft terminology?
  2. What does anti-collision mean - is it just a warning that something is in anti collision mode?
  3. For 4-7 does this mean "nromally in colour navigation but perhaps display a status warning under some conditions? What status are possible.

It seems to me that we need a Led status harware section under https://docs.px4.io/main/en/hardware/drone_parts explaining all this, linking to UAVCAN, listing models that have been tested.

Copy link
Member

Choose a reason for hiding this comment

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

@hamishwillee Thanks for the feedback!

What are the different navigation types?

  1. Good point, it's meant for "navigation lights" that are either white red or green in color. But "Navigation" is confusing here I agree. Let's just specify the color and write navigation light in the description. ⚙️

anti-collision mean

  1. I removed it, was doing the exact same thing as the white LED, need to update docs.
    Background: There is a UAVCAN LED ID for "anti-collision lights" but with UAVCAN: Configurable LED Light Control with Flexible Addressing #26253 you can set any ID you want including that one and we don't need to carry any of this spcifically. I think the users per light ID are really sparse.

For 4-7

  1. Let me try to make a table that we can then put in docs:
    On or off is determined by UAVCAN_LGT_MODE (default when armed = on). And then it follows the table:
UAVCAN_LGT_FNx Off On
0 Off Status
1 Off White
2 Off Red
3 Off Green
4 Status White
5 Status Red
6 Status Green
7 Status Off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants