Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control allocation: make heli rpm control an optional build flag disabled by default #24217

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jan 15, 2025

Solved Problem

After I merged #24096 @bresch reminded me that v6x now overflows flash.

Solution

Make heli rpm control a separate optional build flag (for now).
The rpm capture driver is also disabled on default releases.

Changelog Entry

Save flash by removing helicopter rpm control from default builds

Alternatives

Test coverage

For me locally make px4_fmu-v6x comes down from 1744 bytes to 304 bytes overflowed 😬
so it doesn't free enough flash because it seems we were exactly at the limit before that pr or added more flash use since.

…bled by default

to save flash.
The rpm capture dirver is also disabled on default releases
@MaEtUgR MaEtUgR requested a review from bresch January 15, 2025 13:14
@MaEtUgR MaEtUgR self-assigned this Jan 15, 2025
Copy link

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: -1432 byte (-0.07 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
-0.2% -3.69Ki  [ = ]       0    .debug_abbrev
  [DEL] -1.15Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  -3.5%    -106  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -2.50Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1%    -208  [ = ]       0    .debug_aranges
  [DEL]     -56  [ = ]       0    ../../src/lib/pid/PID.cpp
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  -9.7%     -24  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -120  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1%    -524  [ = ]       0    .debug_frame
-0.2% -47.0Ki  [ = ]       0    .debug_info
  [DEL] -8.47Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  -4.7% -2.63Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -35.9Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1% -5.69Ki  [ = ]       0    .debug_line
  [DEL] -1.19Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
 -13.2%    -891  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -3.61Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.2%      +2  [ = ]       0    task/task_cancelpt.c
-0.1% -6.53Ki  [ = ]       0    .debug_loc
  [DEL]    -516  [ = ]       0    ../../src/lib/pid/PID.cpp
 -24.4% -1.92Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  +0.8%     +10  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessRoverAckermann.cpp
  [DEL] -3.41Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.2%    -719  [ = ]       0    [section .debug_loc]
-0.2% -2.46Ki  [ = ]       0    .debug_ranges
  [DEL]     -64  [ = ]       0    ../../src/lib/pid/PID.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
 -28.2%    -784  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -1.42Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.4%    -208  [ = ]       0    [section .debug_ranges]
  +1.5%      +1  [ = ]       0    task/task_cancelpt.c
-0.0% -1.34Ki  [ = ]       0    .debug_str
  -0.2%    -106  [ = ]       0    
  +3.2%      +5  [ = ]       0    ../../platforms/nuttx/src/px4/common/print_load.cpp
  [DEL]     -45  [ = ]       0    ../../src/lib/pid/PID.cpp
 -38.0%    -961  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -276  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.2%      +9  [ = ]       0    ../../src/modules/sensors/vehicle_imu/VehicleIMU.cpp
  +0.6%      +1  [ = ]       0    msg/topics_sources/rover_ackermann_status.cpp
-0.1%    -424  [ = ]       0    .strtab
  -1.1%      -9  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocationPseudoInverse.cpp
  [DEL]     -96  [ = ]       0    ../../src/lib/pid/PID.cpp
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  -7.8%     -96  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -183  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.0%      -8  [ = ]       0    [section .strtab]
-0.1%    -640  [ = ]       0    .symtab
  +1.3%     +16  [ = ]       0    ../../src/drivers/power_monitor/ina228/ina228.cpp
  -2.3%     -16  [ = ]       0    ../../src/drivers/uavcan/libdronecan/libuavcan/src/transport/uc_can_io.cpp
  +0.4%     +16  [ = ]       0    ../../src/drivers/uavcan/sensors/sensor_bridge.cpp
  -3.1%     -16  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocationPseudoInverse.cpp
  [DEL]    -176  [ = ]       0    ../../src/lib/pid/PID.cpp
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
 -19.6%    -144  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -240  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.1%     -32  [ = ]       0    [section .symtab]
 +15% +1.40Ki  [ = ]       0    [Unmapped]
-0.1% -1.40Ki  -0.1% -1.40Ki    .text
   +40%      +8   +40%      +8    msg/topics_sources/rc_parameter_map.cpp
   +14%      +4   +14%      +4    msg/topics_sources/rpm.cpp
  +0.2%      +3  +0.2%      +3    ../../src/systemcmds/ver/ver.cpp
 -37.5%     -12 -37.5%     -12    msg/topics_sources/rover_mecanum_status.cpp
  -0.1%    -163  -0.1%    -163    [section .text]
  [DEL]    -252  [DEL]    -252    ../../src/lib/pid/PID.cpp
 -15.3%    -380 -15.3%    -380    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -640  [DEL]    -640    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1% -68.4Ki  -0.1% -1.40Ki    TOTAL

px4_fmu-v6x [Total VM Diff: -1432 byte (-0.07 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
-0.2% -3.69Ki  [ = ]       0    .debug_abbrev
  [DEL] -1.15Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  -3.5%    -106  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -2.50Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1%    -208  [ = ]       0    .debug_aranges
  [DEL]     -56  [ = ]       0    ../../src/lib/pid/PID.cpp
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  -9.7%     -24  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -120  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1%    -524  [ = ]       0    .debug_frame
-0.2% -46.5Ki  [ = ]       0    .debug_info
  [DEL] -8.47Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  -4.7% -2.63Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -35.4Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1% -5.69Ki  [ = ]       0    .debug_line
  [DEL] -1.19Ki  [ = ]       0    ../../src/lib/pid/PID.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
 -13.2%    -891  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -3.61Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.3%      +3  [ = ]       0    task/task_cancelpt.c
-0.1% -6.53Ki  [ = ]       0    .debug_loc
  [DEL]    -516  [ = ]       0    ../../src/lib/pid/PID.cpp
 -24.4% -1.92Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  +0.8%     +10  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessRoverAckermann.cpp
  [DEL] -3.41Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.2%    -719  [ = ]       0    [section .debug_loc]
-0.2% -2.46Ki  [ = ]       0    .debug_ranges
  [DEL]     -64  [ = ]       0    ../../src/lib/pid/PID.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
 -28.2%    -784  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL] -1.42Ki  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.4%    -208  [ = ]       0    [section .debug_ranges]
  +1.5%      +1  [ = ]       0    task/task_cancelpt.c
-0.0% -1.34Ki  [ = ]       0    .debug_str
  -0.2%    -106  [ = ]       0    
  +3.2%      +5  [ = ]       0    ../../platforms/nuttx/src/px4/common/print_load.cpp
  [DEL]     -45  [ = ]       0    ../../src/lib/pid/PID.cpp
 -38.1%    -961  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -276  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.1%      +9  [ = ]       0    ../../src/modules/sensors/vehicle_imu/VehicleIMU.cpp
  +0.6%      +1  [ = ]       0    msg/topics_sources/rover_ackermann_status.cpp
-0.1%    -424  [ = ]       0    .strtab
  -1.1%      -9  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocationPseudoInverse.cpp
  [DEL]     -96  [ = ]       0    ../../src/lib/pid/PID.cpp
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  -7.8%     -96  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -183  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  -0.0%      -8  [ = ]       0    [section .strtab]
-0.1%    -640  [ = ]       0    .symtab
  +1.2%     +16  [ = ]       0    ../../src/drivers/pwm_out/PWMOut.cpp
  -2.3%     -16  [ = ]       0    ../../src/drivers/uavcan/libdronecan/libuavcan/src/transport/uc_can_io.cpp
  -3.1%     -16  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocationPseudoInverse.cpp
  [DEL]    -176  [ = ]       0    ../../src/lib/pid/PID.cpp
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
 -19.6%    -144  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -240  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
 -25.0%     -16  [ = ]       0    msg/topics_sources/rpm.cpp
+2.1% +1.40Ki  [ = ]       0    [Unmapped]
-0.1% -1.40Ki  -0.1% -1.40Ki    .text
   +40%      +8   +40%      +8    msg/topics_sources/rc_parameter_map.cpp
   +14%      +4   +14%      +4    msg/topics_sources/rpm.cpp
  +0.2%      +3  +0.2%      +3    ../../src/systemcmds/ver/ver.cpp
 -37.5%     -12 -37.5%     -12    msg/topics_sources/rover_mecanum_status.cpp
  -0.1%    -163  -0.1%    -163    [section .text]
  [DEL]    -252  [DEL]    -252    ../../src/lib/pid/PID.cpp
 -15.3%    -380 -15.3%    -380    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp
  [DEL]    -640  [DEL]    -640    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/RpmControl.cpp
-0.1% -68.0Ki  -0.1% -1.40Ki    TOTAL

Updated: 2025-01-15T13:19:41

@bresch bresch merged commit e01fef7 into main Jan 15, 2025
60 of 61 checks passed
@bresch bresch deleted the optional-heli-rpm-control branch January 15, 2025 13:35
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.

2 participants