Skip to content

Conversation

chfriedrich98
Copy link
Contributor

@chfriedrich98 chfriedrich98 commented Apr 1, 2025

Solved Problem

Seperated MecanumPosVelControl into MecanumVelControl and MecanumPosControl to bring the module into the following structure (Continuation of #24604):
rover_refactor
This introduces this new rover specific setpoint:

  • MecanumVelocitySetpoint

This PR also streamlines the flow of information between the different controllers: Each level of control will only publish the setpoint for one hierarchy level below (with the exception of the RoverThrottleSetpoint).

This is in preparation of exposing the rover setpoints (all orange uORB messages in the figure above) to DDS.

Test Coverage

Tested in SITL

Hardware tests:

  • Stab Mode:
    image
  • Position Mode:
    image
  • Auto Mode:
    image

@chfriedrich98 chfriedrich98 self-assigned this Apr 1, 2025
@chfriedrich98 chfriedrich98 moved this to 🏗 In Progress in PX4 Rover Apr 1, 2025
Copy link

github-actions bot commented Apr 1, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 144 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +136  +0.0%    +136    .text
  +0.0%     +89  +0.0%     +89    [section .text]
  [NEW]     +16  [NEW]     +16    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +0.2%     +12  +0.2%     +12    ../../src/modules/logger/logged_topics.cpp
  +2.6%      +4  +2.6%      +4    ../../platforms/common/uORB/Subscription.cpp
  +0.2%      +4  +0.2%      +4    ../../platforms/common/uORB/uORBDeviceMaster.cpp
  +0.4%      +4  +0.4%      +4    ../../platforms/common/uORB/uORBManager.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/mag_bias_estimator/MagBiasEstimator.cpp
  +0.3%      +4  +0.3%      +4    msg/topics_sources/uORBTopics.cpp
  +0.2%      +3  +0.2%      +3    ../../src/systemcmds/ver/ver.cpp
  -3.4%      -4  -3.4%      -4    stdlib/lib_srand.c
+0.1%      +8  +0.1%      +8    .ramfunc
  +1.0%      +4  +1.0%      +4    ../../platforms/common/uORB/uORBManager.cpp
   +20%      +4   +20%      +4    msg/topics_sources/uORBTopics.cpp
+0.0%    +956  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +900  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +24  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +32  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +48  [ = ]       0    .debug_frame
+0.0% +13.7Ki  [ = ]       0    .debug_info
  +0.1%      +7  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.1%      +7  [ = ]       0    ../../platforms/common/uORB/SubscriptionInterval.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORB.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBDeviceMaster.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBDeviceNode.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/nuttx/src/px4/common/gpio/mcp23009/mcp23009.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/adc/board_adc/ADC.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/barometer/ms5611/ms5611.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/camera_capture/camera_capture.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/camera_trigger/camera_trigger.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/cdcacm_autostart/cdcacm_autostart.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/ms4525do/MS4525DO.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/ms5525dso/MS5525DSO.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/sdp3x/SDP3X.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/distance_sensor/cm8jl65/CM8JL65.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_serial/lightware_laser_serial.cpp
 -99.9% +13.5Ki  [ = ]       0    [476 Others]
+0.0% +1.36Ki  [ = ]       0    .debug_line
  +0.5%      +8  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.4%     +16  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.0%      +1  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.3%     +22  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  -0.0%      -1  [ = ]       0    ../../src/modules/sensors/vehicle_magnetometer/VehicleMagnetometer.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +0.5%     +31  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.0%    +368  [ = ]       0    .debug_loc
  -0.0%      -2  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.0%     +15  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.1%     +15  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  +0.6%     +48  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.cpp
  +0.7%    +186  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.1%     +32  [ = ]       0    ../../src/modules/fw_rate_control/FixedwingRateControl.cpp
  +0.9%     +92  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  -0.1%     -16  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  -0.1%     -75  [ = ]       0    ../../src/modules/sensors/vehicle_imu/VehicleIMU.cpp
  -0.1%     -30  [ = ]       0    ../../src/modules/sensors/vehicle_magnetometer/VehicleMagnetometer.cpp
  +0.0%    +114  [ = ]       0    [section .debug_loc]
  -0.0%     -11  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.0%     +10  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +16  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +3.1%      +2  [ = ]       0    task/task_cancelpt.c
+0.0%    +146  [ = ]       0    .debug_str
  +0.1%     +49  [ = ]       0    
  +0.1%     +26  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  [NEW]     +65  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +2.7%      +6  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.9%      +2  [ = ]       0    .shstrtab
+0.0%     +62  [ = ]       0    .strtab
  +0.1%     +30  [ = ]       0    ../../platforms/nuttx/src/px4/stm/stm32_common/hrt/hrt.c
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  +0.1%     +32  [ = ]       0    [section .strtab]
  [NEW]     +32  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +64  [ = ]       0    .symtab
  +0.1%     +16  [ = ]       0    ../../platforms/nuttx/src/px4/stm/stm32_common/hrt/hrt.c
  -5.4%     -48  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.1%     +48  [ = ]       0    [section .symtab]
  [NEW]     +32  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
-0.2%    -144  [ = ]       0    [Unmapped]
+0.0% +16.7Ki  +0.0%    +144    TOTAL

px4_fmu-v6x [Total VM Diff: 136 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +136  +0.0%    +136    .text
  +0.0%     +88  +0.0%     +88    [section .text]
  [NEW]     +16  [NEW]     +16    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +0.2%     +12  +0.2%     +12    ../../src/modules/logger/logged_topics.cpp
  +0.6%      +8  +0.6%      +8    ../../platforms/common/uORB/uORBManager.cpp
  +0.7%      +8  +0.7%      +8    msg/topics_sources/uORBTopics.cpp
  +2.6%      +4  +2.6%      +4    ../../platforms/common/uORB/Subscription.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/mag_bias_estimator/MagBiasEstimator.cpp
  -0.2%      -4  -0.2%      -4    ../../platforms/common/uORB/uORBDeviceMaster.cpp
+0.0%    +956  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +900  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +24  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +32  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +48  [ = ]       0    .debug_frame
+0.1% +13.5Ki  [ = ]       0    .debug_info
  +0.1%      +7  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.1%      +7  [ = ]       0    ../../platforms/common/uORB/SubscriptionInterval.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORB.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBDeviceMaster.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBDeviceNode.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  +0.0%      +7  [ = ]       0    ../../platforms/nuttx/src/px4/common/gpio/mcp23009/mcp23009.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/adc/board_adc/ADC.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/barometer/invensense/icp201xx/ICP201XX.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/barometer/ms5611/ms5611.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/camera_capture/camera_capture.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/camera_trigger/camera_trigger.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/cdcacm_autostart/cdcacm_autostart.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/ms4525do/MS4525DO.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/ms5525dso/MS5525DSO.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/differential_pressure/sdp3x/SDP3X.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/distance_sensor/cm8jl65/CM8JL65.cpp
  +0.0%      +7  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
 -99.9% +13.4Ki  [ = ]       0    [460 Others]
+0.0% +1.36Ki  [ = ]       0    .debug_line
  +0.5%      +8  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.4%     +16  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +22  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +0.5%     +31  [ = ]       0    msg/topics_sources/uORBTopics.cpp
  +0.3%      +3  [ = ]       0    task/task_cancelpt.c
+0.0%    +268  [ = ]       0    .debug_loc
  +0.0%     +26  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  -0.0%     -15  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  -0.1%     -16  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  -0.1%     -16  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
  +0.9%     +92  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.0%    +134  [ = ]       0    [section .debug_loc]
  +0.0%     +63  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.0%      +6  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +16  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  -3.0%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%    +146  [ = ]       0    .debug_str
  +0.1%     +49  [ = ]       0    
  +0.1%     +26  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  [NEW]     +65  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
  +2.7%      +6  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.9%      +2  [ = ]       0    .shstrtab
+0.0%     +62  [ = ]       0    .strtab
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  +0.1%     +62  [ = ]       0    [section .strtab]
  [NEW]     +32  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
+0.0%     +64  [ = ]       0    .symtab
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.1%     +64  [ = ]       0    [section .symtab]
  [NEW]     +48  [ = ]       0    msg/topics_sources/mecanum_velocity_setpoint.cpp
-0.2%    -136  [ = ]       0    [Unmapped]
+0.0% +16.4Ki  +0.0%    +136    TOTAL

Updated: 2025-05-05T07:10:45

@chfriedrich98 chfriedrich98 force-pushed the pr-mecanum_velocity_control branch 2 times, most recently from 3e5f3cc to f2159b0 Compare April 7, 2025 07:23
@chfriedrich98 chfriedrich98 force-pushed the pr-mecanum_velocity_control branch from f2159b0 to 1e9399a Compare April 29, 2025 12:53
@chfriedrich98 chfriedrich98 marked this pull request as ready for review April 29, 2025 13:57
@chfriedrich98 chfriedrich98 requested a review from sfuhrer April 29, 2025 13:57
@chfriedrich98 chfriedrich98 moved this from 🏗 In Progress to 👀 In Review in PX4 Rover Apr 29, 2025
@chfriedrich98 chfriedrich98 force-pushed the pr-mecanum_velocity_control branch from 1e9399a to d9d6848 Compare May 5, 2025 07:04
@chfriedrich98
Copy link
Contributor Author

Rebased on main

@chfriedrich98 chfriedrich98 requested a review from sfuhrer May 5, 2025 07:06
@chfriedrich98 chfriedrich98 merged commit 4e17c54 into main May 5, 2025
65 of 67 checks passed
@chfriedrich98 chfriedrich98 deleted the pr-mecanum_velocity_control branch May 5, 2025 09:38
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in PX4 Rover May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants