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

Spacecraft Build and Bare Control Allocator #24221

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Pedro-Roque
Copy link
Member

Solved Problem

Provides support for spacecraft-like vehicles available in https://github.com/DISCOWER/PX4-Space-Systems . This PR introduces spacecraft board for SITL, as well as a barebones allocator for preliminary spacecraft build targets.

Solution

  • Add spacecraft SITL board
  • Add barebones spacecraft control allocator

Changelog Entry

For release notes:

Feature/Bugfix: Support for spacecraft vehicles
New parameter:
Documentation: 

Test coverage

  • Unit/integration test: on next PR
  • Simulation/hardware testing logs: on next PR

Copy link

github-actions bot commented Jan 16, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 120 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +120  +0.0%    +120    .text
  +0.1%    +118  +0.1%    +118    ROMFS/nsh_romfsimg.c
  +0.0%      +2  +0.0%      +2    [section .text]
+0.0%    +211  [ = ]       0    .debug_abbrev
  +1.2%     +24  [ = ]       0    ../../src/lib/mixer_module/actuator_test.cpp
  +1.0%     +36  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  +0.7%     +24  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +2.5%     +23  [ = ]       0    msg/topics_sources/actuator_motors.cpp
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0% +1.83Ki  [ = ]       0    .debug_info
  +0.1%     +91  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  +0.2%     +91  [ = ]       0    ../../src/drivers/pwm_out/PWMOut.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/px4io/px4io.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/uavcan/actuators/esc.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/uavcan/actuators/servo.cpp
  +0.0%     +91  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.0%     +91  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.6%    +106  [ = ]       0    ../../src/lib/mixer_module/actuator_test.cpp
  +1.3%    +977  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.0%     +15  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.0%     +27  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  +0.2%     +91  [ = ]       0    ../../src/modules/simulation/pwm_out_sim/PWMSim.cpp
  +0.0%     +15  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.1%     +14  [ = ]       0    msg/topics_sources/actuator_motors.cpp
-0.0%      -9  [ = ]       0    .debug_line
  -0.0%      -2  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  -0.0%      -2  [ = ]       0    ../../src/drivers/pwm_out/PWMOut.cpp
  +0.1%     +25  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.0%      +2  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  -0.0%      -2  [ = ]       0    ../../src/modules/simulation/pwm_out_sim/PWMSim.cpp
  -0.4%      -5  [ = ]       0    task/task_cancelpt.c
+0.0%     +29  [ = ]       0    .debug_loc
  +0.0%     +27  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.0%     +15  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  -0.1%     -15  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.0%      +2  [ = ]       0    [section .debug_loc]
-0.0%     -10  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  -3.0%      -2  [ = ]       0    task/task_cancelpt.c
+0.0%    +797  [ = ]       0    .debug_str
  +0.7%    +135  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  +7.0%    +606  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  +0.2%     +56  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
-1.0%    -120  [ = ]       0    [Unmapped]
+0.0% +2.82Ki  +0.0%    +120    TOTAL

px4_fmu-v6x [Total VM Diff: 96 byte (0 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%     +96  +0.0%     +96    .text
  +0.1%     +98  +0.1%     +98    ROMFS/nsh_romfsimg.c
  -0.0%      -2  -0.0%      -2    [section .text]
+0.0%    +211  [ = ]       0    .debug_abbrev
  +1.2%     +24  [ = ]       0    ../../src/lib/mixer_module/actuator_test.cpp
  +1.0%     +36  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  +0.7%     +24  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +2.5%     +23  [ = ]       0    msg/topics_sources/actuator_motors.cpp
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0% +1.75Ki  [ = ]       0    .debug_info
  +0.1%     +91  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  +0.2%     +91  [ = ]       0    ../../src/drivers/pwm_out/PWMOut.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/px4io/px4io.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/uavcan/actuators/esc.cpp
  +0.1%     +91  [ = ]       0    ../../src/drivers/uavcan/actuators/servo.cpp
  +0.0%     +91  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.0%     +91  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.6%    +106  [ = ]       0    ../../src/lib/mixer_module/actuator_test.cpp
  +1.3%    +977  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.0%     +15  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.0%     +27  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  +0.0%     +15  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.1%     +14  [ = ]       0    msg/topics_sources/actuator_motors.cpp
+0.0%      +2  [ = ]       0    .debug_line
  -0.0%      -2  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  -0.0%      -2  [ = ]       0    ../../src/drivers/pwm_out/PWMOut.cpp
  +0.1%     +25  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.0%      +2  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
  +0.4%      +4  [ = ]       0    task/task_cancelpt.c
-0.0%      -9  [ = ]       0    .debug_loc
  -0.1%     -15  [ = ]       0    ../../src/drivers/px4io/px4io.cpp
  -0.0%      -1  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  -0.1%     -41  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.1%     +16  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  +0.0%     +32  [ = ]       0    [section .debug_loc]
-0.0%      -8  [ = ]       0    .debug_ranges
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
+0.0%    +797  [ = ]       0    .debug_str
  +0.7%    +135  [ = ]       0    ../../src/drivers/dshot/DShot.cpp
  +6.9%    +606  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  +0.2%     +56  [ = ]       0    ../../src/modules/control_allocator/ControlAllocator.cpp
-0.1%     -96  [ = ]       0    [Unmapped]
+0.0% +2.71Ki  +0.0%     +96    TOTAL

Updated: 2025-01-30T16:06:56

@Pedro-Roque Pedro-Roque marked this pull request as ready for review January 20, 2025 12:35
@Pedro-Roque
Copy link
Member Author

@dagar @sfuhrer Inputs are welcome on this - Should I start by adding build target followed by the control modules, or should I go the other way around?

@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 20, 2025

@dagar @sfuhrer Inputs are welcome on this - Should I start by adding build target followed by the control modules, or should I go the other way around?

You mean what to work on next? Should we clean up the build target / airframe side, then add SITL, then the low level control module (rate, possibly attitude)?
You'll also need to rebase since #24199 caused diffs. How do you plan to enable the metric allocation, hard-coded per vehicle type or configurable per parameter(s)?

.vscode/settings.json Outdated Show resolved Hide resolved
@Pedro-Roque
Copy link
Member Author

@dagar @sfuhrer Inputs are welcome on this - Should I start by adding build target followed by the control modules, or should I go the other way around?

You mean what to work on next? Should we clean up the build target / airframe side, then add SITL, then the low level control module (rate, possibly attitude)? You'll also need to rebase since #24199 caused diffs. How do you plan to enable the metric allocation, hard-coded per vehicle type or configurable per parameter(s)?

Thanks for the prompt reply @sfuhrer ! Ok great, I was planning on proceeding exactly in that order, so its a perfect since. Currently I've added a build target with airframe and SITL, as well as a control allocator (just so that I could have the build target configure the sc_apps and sc_defaults.

Let me know if I should remove control allocator and just proceed with airframe. The issue is that none of the apps are then loaded, but that could go together with ca_allocator. What do you think?

@Pedro-Roque Pedro-Roque force-pushed the pr-spacecraft-allocator-and-board branch from 660d2bb to d4b6d75 Compare January 20, 2025 14:57
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-sync-q-a-jan-29-2025/43479/4

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-sync-q-a-jan-29-2025/43479/1

@Pedro-Roque Pedro-Roque requested a review from MaEtUgR January 30, 2025 15:06
@Pedro-Roque
Copy link
Member Author

@MaEtUgR I've pushed CA_AIRFRAME to control_allocator, as suggested. Should we keep this PR as is and I add control allocation on the next PR?

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.

4 participants