-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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 Support: adding modules for Space Robotics and Thruster Based platforms #23117
base: main
Are you sure you want to change the base?
Conversation
…tems/discower/1.14'
Add space world make target
This commit adds a space systems rate control module
Update sitl_gazebo submodule hash
Add Space Systems Rate controller
2a2687d
to
697bcde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only had a quick glance to see if I can spot any high level things but didn't go through everything to be honest. Style check is failing. Let's work through step by step.
@@ -68,6 +68,14 @@ if(CONFIG_MODULES_MC_RATE_CONTROL) | |||
) | |||
endif() | |||
|
|||
if(CONFIG_MODULES_SC_RATE_CONTROL) | |||
px4_add_romfs_files( | |||
rc.heli_defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rc.heli_defaults |
I guess that's not used for thruster robots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Removed.
CMakeLists.txt
Outdated
PATTERN ".svn" EXCLUDE) | ||
else() | ||
message(STATUS "No PX4 build files to install.") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endif() | |
endif() | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
ROMFS/px4fmu_common/init.d-posix/airframes/10019_gazebo-classic_omnicopter
Outdated
Show resolved
Hide resolved
@@ -38,6 +38,10 @@ px4_add_romfs_files( | |||
18001_TF-B1 | |||
|
|||
# [22000, 22999] Reserve for custom models | |||
|
|||
# [70000, 79999] Spacecraft-type platforms | |||
70000_kth_space_robot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditionally included based on CONFIG_MODULES_SC_RATE_CONTROL
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
sc_pos_control start | ||
|
||
# Start Space Robot Thruster Controller | ||
sc_thruster_controller start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sc_thruster_controller start | |
sc_thruster_controller start | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed format.
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y | ||
CONFIG_MODULES_FW_ATT_CONTROL=y | ||
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y | ||
CONFIG_MODULES_FW_POS_CONTROL=y | ||
CONFIG_MODULES_FW_RATE_CONTROL=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's currently not an option to remove these modules from the default build. I suggest there to be a thruster robot build similar to rover. Otherwise this will not scale further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, will look into that.
float32 x1 # duty cycle of thruster-pair x1 [-1;1] | ||
float32 x2 # duty cycle of thruster-pair x2 [-1;1] | ||
float32 y1 # duty cycle of thruster-pair y1 [-1;1] | ||
float32 y2 # duty cycle of thruster-pair y2 [-1;1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to the thruster_controller module, that then publishes motor controls that get translated to actuator outputs. The x's and y's are relative to body frame, but this should probably be removed since we don't need this to be upstream.
EDIT: I'll keep it for now. Might remove later.
msg/MyMessage.msg
Outdated
uint64 timestamp # time since system start (microseconds) | ||
|
||
char[127] text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually no clue why this is here - will remove. Thanks for the catch!
float32[4] attitude # in quaternions | ||
float32[3] angular_velocity # in rad/s^2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what attitude setpoint and rate setpoint are for. We shouldn't combine those for all use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But since the pipeline is pos_ctl sending an attitude setpoint to the att controller, how do you combine trajectories that require both? Because one of the commands gets ignored in that case... or will get jittered?
@@ -87,7 +87,9 @@ static int io_timer_handler7(int irq, void *context, void *arg); | |||
* taken into account | |||
*/ | |||
#if !defined(BOARD_PWM_FREQ) | |||
#define BOARD_PWM_FREQ 1000000 | |||
// #define BOARD_PWM_FREQ 1000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't stay commented out. Could the downscaling be something board-specific that breaks other boards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably make this configurable. It's mostly for thruster based systems that require a smaller frequency
Thanks Matt, I'll start pushing on this now! :) |
Should sync with PX4/PX4-SITL_gazebo-classic#1039 |
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: |
@@ -86,8 +86,11 @@ static int io_timer_handler7(int irq, void *context, void *arg); | |||
* We also allow for overrides here but all timer register usage need to be | |||
* taken into account | |||
*/ | |||
#if !defined(BOARD_PWM_FREQ) | |||
#if !defined(BOARD_PWM_FREQ) && !defined(CONFIG_MODULES_SC_RATE_CONTROL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a minimum let's do this via kconfig and not introduce module specific ifdefs.
@@ -663,7 +666,8 @@ int io_timer_init_timer(unsigned timer, io_timer_channel_mode_t mode) | |||
* default to updating at 50Hz | |||
*/ | |||
|
|||
timer_set_rate(timer, 50); | |||
timer_set_rate(timer, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pedro-Roque big mess, change this
Solved Problem
This PR addresses support on PX4 for Spacecrafts or other space systems that use Thrusters as their main actuators. These are particularly relevant for space robotics applications.
Modules for control (with appendix sc_ ) and Thruster actuation compatibility were added.
This PR aims at integrating these additions, which will soon be published and updated on the source code, into the PX4 ecosystem to support space robotics facilities.
Solution
Changelog Entry
For release notes:
Alternatives
Reusing multicopter code. However, there are multiple problems associated with it:
Test coverage
To-Do
Context
Currently being integrated in https://github.com/DISCOWER/PX4-Space-Systems/tree/dev-metric_control_allocator, as part of the DISCOWER project (a publication documenting this contribution as well as the entire lab facilities will be published by the end of August). Pictures and videos will be added soon. Continued from #23098