Skip to content

Conversation

chfriedrich98
Copy link
Contributor

Solved Problem

Seperated DifferentialPosVelControl into DifferentialVelControl and DifferentialPosControl to bring the module into the following structure (Continuation of #24604):
rover_refactor
This introducesthis new rover specific setpoints:

  • DifferentialVelocitySetpoint: Each rover type will have its own velocity message because they differ greatly in implementation (i.e. mecanum can specify the yaw in addition to the velocity and won`t need the backwards driving flag etc.).

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 setpoint (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 Mar 31, 2025
@chfriedrich98 chfriedrich98 moved this to 🏗 In Progress in PX4 Rover Mar 31, 2025
Copy link

github-actions bot commented Mar 31, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 112 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +120  +0.0%    +120    .text
  +0.0%     +92  +0.0%     +92    [section .text]
  [NEW]     +28  [NEW]     +28    msg/topics_sources/differential_velocity_setpoint.cpp
  +0.4%     +20  +0.4%     +20    ../../src/modules/logger/logged_topics.cpp
  +0.3%      +4  +0.3%      +4    msg/topics_sources/uORBTopics.cpp
  +3.6%      +4  +3.6%      +4    stdlib/lib_srand.c
  -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
 -42.9%     -12 -42.9%     -12    msg/topics_sources/ackermann_velocity_setpoint.cpp
+0.0%    +956  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +900  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
+0.0%     +24  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +32  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
+0.0%     +48  [ = ]       0    .debug_frame
+0.0% +13.6Ki  [ = ]       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    [475 Others]
+0.0% +1.33Ki  [ = ]       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.4%     +24  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  [NEW] +1.32Ki  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
  +0.6%     +36  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.0%    +115  [ = ]       0    .debug_loc
  -0.0%     -13  [ = ]       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
  -1.1%     -96  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.cpp
  -0.0%     -16  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.cpp
  +0.9%     +92  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.1%     +16  [ = ]       0    ../../src/modules/navigator/navigator_main.cpp
  +0.0%    +132  [ = ]       0    [section .debug_loc]
+0.0%      +8  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +16  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
+0.0%    +161  [ = ]       0    .debug_str
  +0.1%     +54  [ = ]       0    
  +0.2%     +31  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  [NEW]     +70  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
  +2.8%      +6  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.0%     +72  [ = ]       0    .strtab
  +0.1%     +35  [ = ]       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]     +37  [ = ]       0    msg/topics_sources/differential_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/differential_velocity_setpoint.cpp
-0.1%    -112  [ = ]       0    [Unmapped]
-0.1%      -8  -0.1%      -8    .ramfunc
  -1.0%      -4  -1.0%      -4    ../../platforms/common/uORB/uORBManager.cpp
 -16.7%      -4 -16.7%      -4    msg/topics_sources/uORBTopics.cpp
+0.0% +16.3Ki  +0.0%    +112    TOTAL

px4_fmu-v6x [Total VM Diff: 104 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +104  +0.0%    +104    .text
  +0.0%     +80  +0.0%     +80    [section .text]
  [NEW]     +28  [NEW]     +28    msg/topics_sources/differential_velocity_setpoint.cpp
  +0.4%     +20  +0.4%     +20    ../../src/modules/logger/logged_topics.cpp
  +0.2%      +4  +0.2%      +4    ../../platforms/common/uORB/uORBDeviceMaster.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.6%      -8  -0.6%      -8    ../../platforms/common/uORB/uORBManager.cpp
 -42.9%     -12 -42.9%     -12    msg/topics_sources/ackermann_velocity_setpoint.cpp
+0.0%    +956  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +900  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
+0.0%     +24  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +32  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
+0.0%     +48  [ = ]       0    .debug_frame
+0.1% +13.4Ki  [ = ]       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.3Ki  [ = ]       0    [459 Others]
+0.0% +1.33Ki  [ = ]       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.4%     +24  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  [NEW] +1.32Ki  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
  +0.6%     +36  [ = ]       0    msg/topics_sources/uORBTopics.cpp
  -0.4%      -4  [ = ]       0    task/task_cancelpt.c
+0.0%     +70  [ = ]       0    .debug_loc
  +0.0%      +3  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.0%     +28  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.6%     +48  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.cpp
  -0.6%    -180  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  -0.0%     -16  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  -0.0%     -16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.9%     +92  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.0%    +104  [ = ]       0    [section .debug_loc]
  +0.0%      +7  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.0%      +9  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]     +16  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
  +1.6%      +1  [ = ]       0    task/task_cancelpt.c
+0.0%    +161  [ = ]       0    .debug_str
  +0.1%     +54  [ = ]       0    
  +0.2%     +31  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  [NEW]     +70  [ = ]       0    msg/topics_sources/differential_velocity_setpoint.cpp
  +2.8%      +6  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.0%     +72  [ = ]       0    .strtab
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  +0.1%     +67  [ = ]       0    [section .strtab]
  [NEW]     +37  [ = ]       0    msg/topics_sources/differential_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/differential_velocity_setpoint.cpp
-0.1%    -104  [ = ]       0    [Unmapped]
+0.0% +16.1Ki  +0.0%    +104    TOTAL

Updated: 2025-04-29T12:32:59

@chfriedrich98 chfriedrich98 force-pushed the pr-differential_velocity_control branch from cc42320 to b266381 Compare March 31, 2025 13:27
@chfriedrich98 chfriedrich98 force-pushed the pr-differential_velocity_control branch from b266381 to 1cdfb07 Compare April 8, 2025 11:54
@chfriedrich98 chfriedrich98 marked this pull request as ready for review April 8, 2025 12:25
@chfriedrich98 chfriedrich98 requested a review from sfuhrer April 8, 2025 12:26
@chfriedrich98 chfriedrich98 moved this from 🏗 In Progress to 👀 In Review in PX4 Rover Apr 8, 2025
@chfriedrich98 chfriedrich98 force-pushed the pr-differential_velocity_control branch from 1cdfb07 to cd9a2c9 Compare April 21, 2025 06:35
@chfriedrich98 chfriedrich98 force-pushed the pr-differential_velocity_control branch from cd9a2c9 to 417e1b5 Compare April 29, 2025 06:20
@chfriedrich98 chfriedrich98 requested a review from sfuhrer April 29, 2025 11:20
sfuhrer
sfuhrer previously approved these changes Apr 29, 2025
@chfriedrich98 chfriedrich98 force-pushed the pr-differential_velocity_control branch from 6047636 to 707d06f Compare April 29, 2025 12:27
@chfriedrich98 chfriedrich98 merged commit 39fa8b5 into main Apr 29, 2025
65 of 67 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in PX4 Rover Apr 29, 2025
@chfriedrich98 chfriedrich98 deleted the pr-differential_velocity_control branch April 29, 2025 12:49
@slgrobotics
Copy link
Contributor

Related issue #25157

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.

3 participants