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 Support: adding modules for Space Robotics and Thruster Based platforms #23117

Draft
wants to merge 90 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
b852d0b
rft: changed Readme for space systems setup
Pedro-Roque May 17, 2023
46e6d7f
Readme for space systems setup
E-Krantz Jun 19, 2023
f7cf8c8
Added Space Robot airframe and thruster controller (work in progress)
E-Krantz Jun 21, 2023
ddf2a5b
Added support for thruster control messages. Fixed initialization par…
E-Krantz Jun 22, 2023
892e35b
Fixed PWM to be controllable at 10 Hz by sr_thruster_controller.c
E-Krantz Jun 27, 2023
75b25a8
Patch for previous commit
E-Krantz Jun 27, 2023
b54f398
Converted sr_thruster_controller to a PX4-module
E-Krantz Jun 27, 2023
4d17c02
Merge remote-tracking branch 'PX4-Autopilot/main' into 'PX4-Space-Sys…
E-Krantz Jul 14, 2023
5929738
Update to Space Ropbot airframe params
E-Krantz Jul 14, 2023
568da60
Modified px4_fmu-v6x board defaults to use less FLASH memory
E-Krantz Jul 14, 2023
45902bf
Merge branch 'main' into discower/1.14
E-Krantz Jul 14, 2023
8cf11f8
Update to boardconfig for sitl and fmu-v6x
E-Krantz Jul 17, 2023
f1a1c28
fix: set sim build with gazebo 11 option
Pedro-Roque Jul 19, 2023
5abfb92
fix: updated README with gazebo 11 option
Pedro-Roque Jul 19, 2023
731775a
Update to read RC channels
E-Krantz Oct 26, 2023
2eb6e55
Update to use namespace spacebot#
E-Krantz Oct 26, 2023
d297a77
Add space world make target
Jaeyoung-Lim Oct 30, 2023
05cd988
Merge pull request #1 from Jaeyoung-Lim/pr-add-space-world
Pedro-Roque Oct 31, 2023
788f863
Update sitl_gazebo head
Jaeyoung-Lim Nov 7, 2023
122509f
Add space systems rate control module
Jaeyoung-Lim Nov 7, 2023
bb396b4
Use bidirectional thrust on the sticks
Jaeyoung-Lim Nov 8, 2023
e68aebb
Merge pull request #3 from DISCOWER/pr-sitl-model
Pedro-Roque Jan 14, 2024
cbd7a9c
fix: builds with sitl gazebo
Pedro-Roque Jan 14, 2024
4ac6e6a
fix: install build folder and ROMFS for ros2 launch sequence
Pedro-Roque Jan 14, 2024
5e19a9f
Merge pull request #4 from DISCOWER/pr-rate-controller
Pedro-Roque Jan 15, 2024
2d4b3d3
rft: clean CMakeLists and improved posix rcS for uxrcde connection
Pedro-Roque Jan 16, 2024
a8e85f3
rft: changing default names for space to spacecraft (sc)
Pedro-Roque Feb 10, 2024
a7046ec
feat: changing files and filenames to sc_ terminology
Pedro-Roque Feb 10, 2024
accc043
feat: update default rc_app and reduce logging. Might break SIM
Pedro-Roque Apr 3, 2024
405a468
feat: adding spacecraft airframes
Pedro-Roque Apr 4, 2024
d0d211b
featt: moved everything to sc
Pedro-Roque Apr 18, 2024
8a4906d
Merge pull request #8 from DISCOWER/dev-sc_airframes
Pedro-Roque Apr 19, 2024
ecf80c5
feat: adding thruster effectiveness
Pedro-Roque Apr 22, 2024
05fa6ff
feat: updates to module yaml and naming of classes
Pedro-Roque Apr 22, 2024
ba910a1
feat: added actator type and updated thruster effectiveness
Pedro-Roque Apr 22, 2024
7f15e73
feat: update cmake lists for added modules
Pedro-Roque Apr 22, 2024
503ea6d
fix: compiling with thrusters inside
Pedro-Roque Apr 22, 2024
12dd68e
feat: added spacecraft effectiveness - to be validated
Pedro-Roque Apr 22, 2024
f41ee2f
feat: fixed allocator bug - need to remove prints
Pedro-Roque Apr 22, 2024
f00e97b
fix: control allocator running with thrusters!
Pedro-Roque Apr 22, 2024
730d780
rft: removed prints and non-required messages
Pedro-Roque Apr 22, 2024
fc99613
feat: renamed MC_ and mc_ to SC_ and sc_, added gains on airframe for…
Pedro-Roque Apr 22, 2024
2d913e1
feat: adding attitude rate ctl
Pedro-Roque Apr 23, 2024
61b85cd
fix: actuator testing and att control. Att control needs further work
Pedro-Roque Apr 23, 2024
cc9750d
chunk: fixes towards full pipeline
Pedro-Roque Apr 24, 2024
8de434f
feat: functionThrusters in mixer module
Pedro-Roque Apr 24, 2024
251f3f8
Merge pull request #13 from DISCOWER/dev-sc_rate_ctl_checks
Pedro-Roque Apr 24, 2024
59df525
init: creating spacecraft position controller
Pedro-Roque Apr 25, 2024
2337f25
add: params
Pedro-Roque Apr 25, 2024
f246f84
fix: major changes to position control for compatibility with spacecraft
Pedro-Roque Apr 26, 2024
e097833
fix: nan on setpoints for att control
Pedro-Roque Apr 26, 2024
6207209
feat: cleaning position controller
Pedro-Roque Apr 27, 2024
71cd6ff
fix: updated empty trajectories
Pedro-Roque Apr 27, 2024
ddad102
doc: small changes to att control - will move to different branch
Pedro-Roque Apr 27, 2024
89e5b11
fix: several fixes on attitude controller cleaning
Pedro-Roque Apr 27, 2024
b8482b0
feat: updates to attidude control
Pedro-Roque Apr 29, 2024
f69b0ad
Merge pull request #15 from DISCOWER/dev-sc_pos_ctl
Pedro-Roque May 2, 2024
94c05b6
fix: remove FW_ARSP_MODE
Pedro-Roque May 2, 2024
64f1047
Merge pull request #16 from DISCOWER/dev-sc_att_ctl_cleaning
Pedro-Roque May 2, 2024
86a9970
fix: doubled topcis
Pedro-Roque May 2, 2024
aca2f09
add: manual subscription
Pedro-Roque May 2, 2024
56f5056
add: debug attitude setpoint in dds, more updates on control stack
Pedro-Roque May 2, 2024
73bce2b
fix: aiming for static position and attitude keeping
Pedro-Roque May 3, 2024
3961d27
fix: attitude setpoint updates only when needed
Pedro-Roque May 3, 2024
cbfbae1
dbg: behavior seems consistent, need to ensure it works on position mode
Pedro-Roque May 3, 2024
3ffc29d
feat: position control needs to be tested - arming pos ctl not working
Pedro-Roque May 3, 2024
50ce9b4
Merge pull request #17 from DISCOWER/dev-sc_pos_ctl_manual_sp
Pedro-Roque May 5, 2024
3476d75
feat: adding parameters to replicate hardware pwm for spacecrafts
Pedro-Roque May 6, 2024
d0b81e0
Merge pull request #18 from DISCOWER/dev-pwm_output
Pedro-Roque May 6, 2024
c890c7c
fix: added fixes for vision/mocap data.
Pedro-Roque May 6, 2024
1193723
Update submodule
Jaeyoung-Lim May 6, 2024
a670085
rft: removing undesireable prints
Pedro-Roque May 6, 2024
42e0880
Merge pull request #19 from DISCOWER/pr-add-gasthrusters
Pedro-Roque May 7, 2024
4f880a1
feat: updating thruster plugin on gazebo-classic sitl
Pedro-Roque May 9, 2024
35700c2
Merge branch 'dev-metric_control_allocator' into dev-merge_changes
Pedro-Roque May 13, 2024
697bcde
fix: format checks
Pedro-Roque May 13, 2024
206de0e
fix: disabled unit tests for spacecraft - they need to be designed
Pedro-Roque May 13, 2024
0eefd71
add: empy, might fix fails
Pedro-Roque May 13, 2024
e4ea746
fix: reverting changes to workflow
Pedro-Roque May 13, 2024
96de3d9
feat: updating Gazebo Classic submodule commit
Pedro-Roque May 13, 2024
b6169a8
fix: submodules
Pedro-Roque May 13, 2024
6a13703
fix: fixed styles and configuration files for spacecrafts based on fe…
Pedro-Roque May 14, 2024
db0ed9b
fix: init.d cmakelists
Pedro-Roque May 14, 2024
b2438d7
fix: removed MyMessage, replaced with MavlinkLog
Pedro-Roque May 14, 2024
9ee35c7
feat: 6dof spacecraft updates
Pedro-Roque May 14, 2024
3741843
feat: updated thrust of DART spacecraft
Pedro-Roque May 15, 2024
284f4a0
feat: added frictionless world
Pedro-Roque May 15, 2024
2db4428
fix: compilation issues with fmuv6x
Pedro-Roque May 20, 2024
c5278ca
fix: thruster output range to match hardware
Pedro-Roque May 21, 2024
33a10b4
fix: failsafe on invalid posctl now is stabilized mode
Pedro-Roque May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,28 @@ add_custom_target(install_python_requirements
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/cmake/finalize.cmake")
include(finalize)
endif()

# Clear target folder
set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
file(GLOB RESULT_BUILD ${INSTALL_DIR})
list(LENGTH RESULT_BUILD BUILD_RES_LEN)
if(BUILD_RES_LEN GREATER 0)
message("Deleting target folder: ${INSTALL_DIR}")
file(REMOVE_RECURSE ${INSTALL_DIR})
endif()

# Install SITL build files
file(GLOB RESULT build/*)
list(LENGTH RESULT RES_LEN)
if(RES_LEN GREATER 0)
install(DIRECTORY build/
DESTINATION share/${PROJECT_NAME}
PATTERN ".svn" EXCLUDE)
# Install ROMFS
install(DIRECTORY ROMFS/
DESTINATION share/${PROJECT_NAME}
PATTERN ".svn" EXCLUDE)
else()
message(STATUS "No PX4 build files to install.")
endif()

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @maintainer Jaeyoung Lim <[email protected]>
#

. ${R}etc/init.d/rc.mc_defaults
. ${R}etc/init.d/rc.mc_apps


param set-default CA_AIRFRAME 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/bin/sh
#
# @name 3DoF Spacecraft Model
#
# @type 2D Freeflyer with 8 thrusters - Planar motion
#
# @maintainer Pedro Roque <[email protected]>
#

. ${R}etc/init.d/rc.sc_defaults

param set-default CA_AIRFRAME 13
param set-default MAV_TYPE 24

param set-default CA_THRUSTER_CNT 8
param set-default CA_R_REV 255

# param set-default FW_ARSP_MODE 1

# Auto to be provided by Custom Airframe
param set-default CA_METHOD 0

# Set proper failsafes
param set-default COM_ACT_FAIL_ACT 0
param set-default COM_LOW_BAT_ACT 0
param set-default NAV_DLL_ACT 0
param set-default GF_ACTION 1
param set-default NAV_RCL_ACT 1
param set-default COM_POSCTL_NAVL 2

# disable attitude failure detection
param set-default FD_FAIL_P 0
param set-default FD_FAIL_R 0

param set-default CA_THRUSTER0_PX -0.12
param set-default CA_THRUSTER0_PY -0.12
param set-default CA_THRUSTER0_PZ 0.0
param set-default CA_THRUSTER0_CT 1.75
param set-default CA_THRUSTER0_AX 1.0
param set-default CA_THRUSTER0_AY 0.0
param set-default CA_THRUSTER0_AZ 0.0

param set-default CA_THRUSTER1_PX 0.12
param set-default CA_THRUSTER1_PY -0.12
param set-default CA_THRUSTER1_PZ 0.0
param set-default CA_THRUSTER1_CT 1.75
param set-default CA_THRUSTER1_AX -1.0
param set-default CA_THRUSTER1_AY 0.0
param set-default CA_THRUSTER1_AZ 0.0

param set-default CA_THRUSTER2_PX -0.12
param set-default CA_THRUSTER2_PY 0.12
param set-default CA_THRUSTER2_PZ 0.0
param set-default CA_THRUSTER2_CT 1.75
param set-default CA_THRUSTER2_AX 1.0
param set-default CA_THRUSTER2_AY 0.0
param set-default CA_THRUSTER2_AZ 0.0

param set-default CA_THRUSTER3_PX 0.12
param set-default CA_THRUSTER3_PY 0.12
param set-default CA_THRUSTER3_PZ 0.0
param set-default CA_THRUSTER3_CT 1.75
param set-default CA_THRUSTER3_AX -1.0
param set-default CA_THRUSTER3_AY 0.0
param set-default CA_THRUSTER3_AZ 0.0

param set-default CA_THRUSTER4_PX 0.12
param set-default CA_THRUSTER4_PY -0.12
param set-default CA_THRUSTER4_PZ 0.0
param set-default CA_THRUSTER4_CT 1.75
param set-default CA_THRUSTER4_AX 0.0
param set-default CA_THRUSTER4_AY 1.0
param set-default CA_THRUSTER4_AZ 0.0

param set-default CA_THRUSTER5_PX 0.12
param set-default CA_THRUSTER5_PY 0.12
param set-default CA_THRUSTER5_PZ 0.0
param set-default CA_THRUSTER5_CT 1.75
param set-default CA_THRUSTER5_AX 0.0
param set-default CA_THRUSTER5_AY -1.0
param set-default CA_THRUSTER5_AZ 0.0

param set-default CA_THRUSTER6_PX -0.12
param set-default CA_THRUSTER6_PY -0.12
param set-default CA_THRUSTER6_PZ 0.0
param set-default CA_THRUSTER6_CT 1.75
param set-default CA_THRUSTER6_AX 0.0
param set-default CA_THRUSTER6_AY 1.0
param set-default CA_THRUSTER6_AZ 0.0

param set-default CA_THRUSTER7_PX -0.12
param set-default CA_THRUSTER7_PY 0.12
param set-default CA_THRUSTER7_PZ 0.0
param set-default CA_THRUSTER7_CT 1.75
param set-default CA_THRUSTER7_AX 0.0
param set-default CA_THRUSTER7_AY -1.0
param set-default CA_THRUSTER7_AZ 0.0

param set-default PWM_MAIN_FUNC1 501
param set-default PWM_MAIN_FUNC2 502
param set-default PWM_MAIN_FUNC3 503
param set-default PWM_MAIN_FUNC4 504
param set-default PWM_MAIN_FUNC5 505
param set-default PWM_MAIN_FUNC6 506
param set-default PWM_MAIN_FUNC7 507
param set-default PWM_MAIN_FUNC8 508

# PWM Simulation
param set PWM_SIM_PWM_MAX 10000
param set PWM_SIM_PWM_MIN 0

# Controller Tunings
param set-default SC_ROLLRATE_P 0.14
param set-default SC_PITCHRATE_P 0.14
param set-default SC_ROLLRATE_I 0.3
param set-default SC_PITCHRATE_I 0.3
param set-default SC_ROLLRATE_D 0.004
param set-default SC_PITCHRATE_D 0.004
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
#!/bin/sh
#
# @name 6DoF Spacecraft Model
#
# @type Freeflyer with 8 thrusters
#
# @maintainer Pedro Roque <[email protected]>
#

. ${R}etc/init.d/rc.sc_defaults

param set-default CA_AIRFRAME 14
param set-default MAV_TYPE 25

param set-default CA_THRUSTER_CNT 12
param set-default CA_R_REV 255

# param set-default FW_ARSP_MODE 1

# Auto to be provided by Custom Airframe
param set-default CA_METHOD 0

# disable attitude failure detection
param set-default FD_FAIL_P 0
param set-default FD_FAIL_R 0

# Set proper failsafes
param set-default COM_ACT_FAIL_ACT 0
param set-default COM_LOW_BAT_ACT 0
param set-default NAV_DLL_ACT 0
param set-default GF_ACTION 1
param set-default NAV_RCL_ACT 1
param set-default COM_POSCTL_NAVL 2

# Set thrusters
param set-default CA_THRUSTER0_PX -0.50
param set-default CA_THRUSTER0_PY 0.50
param set-default CA_THRUSTER0_PZ 0.0
param set-default CA_THRUSTER0_CT 0.237
param set-default CA_THRUSTER0_AX 0.0
param set-default CA_THRUSTER0_AY -1.0
param set-default CA_THRUSTER0_AZ 0.0

param set-default CA_THRUSTER1_PX 0.50
param set-default CA_THRUSTER1_PY 0.50
param set-default CA_THRUSTER1_PZ 0.0
param set-default CA_THRUSTER1_CT 0.237
param set-default CA_THRUSTER1_AX 0.0
param set-default CA_THRUSTER1_AY -1.0
param set-default CA_THRUSTER1_AZ 0.0

param set-default CA_THRUSTER2_PX 0.50
param set-default CA_THRUSTER2_PY -0.50
param set-default CA_THRUSTER2_PZ 0.0
param set-default CA_THRUSTER2_CT 0.237
param set-default CA_THRUSTER2_AX 0.0
param set-default CA_THRUSTER2_AY 1.0
param set-default CA_THRUSTER2_AZ 0.0

param set-default CA_THRUSTER3_PX -0.50
param set-default CA_THRUSTER3_PY -0.50
param set-default CA_THRUSTER3_PZ 0.0
param set-default CA_THRUSTER3_CT 0.237
param set-default CA_THRUSTER3_AX 0.0
param set-default CA_THRUSTER3_AY 1.0
param set-default CA_THRUSTER3_AZ 0.0

param set-default CA_THRUSTER4_PX -0.50
param set-default CA_THRUSTER4_PY 0.0
param set-default CA_THRUSTER4_PZ -0.50
param set-default CA_THRUSTER4_CT 0.237
param set-default CA_THRUSTER4_AX 1.0
param set-default CA_THRUSTER4_AY 0.0
param set-default CA_THRUSTER4_AZ 0.0

param set-default CA_THRUSTER5_PX 0.50
param set-default CA_THRUSTER5_PY 0.0
param set-default CA_THRUSTER5_PZ -0.50
param set-default CA_THRUSTER5_CT 0.237
param set-default CA_THRUSTER5_AX -1.0
param set-default CA_THRUSTER5_AY 0.0
param set-default CA_THRUSTER5_AZ 0.0

param set-default CA_THRUSTER6_PX 0.50
param set-default CA_THRUSTER6_PY 0.0
param set-default CA_THRUSTER6_PZ 0.50
param set-default CA_THRUSTER6_CT 0.237
param set-default CA_THRUSTER6_AX -1.0
param set-default CA_THRUSTER6_AY 0.0
param set-default CA_THRUSTER6_AZ 0.0

param set-default CA_THRUSTER7_PX -0.50
param set-default CA_THRUSTER7_PY 0.0
param set-default CA_THRUSTER7_PZ 0.50
param set-default CA_THRUSTER7_CT 0.237
param set-default CA_THRUSTER7_AX 1.0
param set-default CA_THRUSTER7_AY 0.0
param set-default CA_THRUSTER7_AZ 0.0

param set-default CA_THRUSTER8_PX 0.0
param set-default CA_THRUSTER8_PY -0.50
param set-default CA_THRUSTER8_PZ -0.50
param set-default CA_THRUSTER8_CT 0.237
param set-default CA_THRUSTER8_AX 0.0
param set-default CA_THRUSTER8_AY 0.0
param set-default CA_THRUSTER8_AZ 1.0

param set-default CA_THRUSTER9_PX 0.0
param set-default CA_THRUSTER9_PY 0.50
param set-default CA_THRUSTER9_PZ -0.50
param set-default CA_THRUSTER9_CT 0.237
param set-default CA_THRUSTER9_AX 0.0
param set-default CA_THRUSTER9_AY 0.0
param set-default CA_THRUSTER9_AZ 1.0

param set-default CA_THRUSTER10_PX 0.0
param set-default CA_THRUSTER10_PY 0.50
param set-default CA_THRUSTER10_PZ 0.50
param set-default CA_THRUSTER10_CT 0.237
param set-default CA_THRUSTER10_AX 0.0
param set-default CA_THRUSTER10_AY 0.0
param set-default CA_THRUSTER10_AZ -1.0

param set-default CA_THRUSTER11_PX 0.0
param set-default CA_THRUSTER11_PY -0.50
param set-default CA_THRUSTER11_PZ 0.50
param set-default CA_THRUSTER11_CT 0.237
param set-default CA_THRUSTER11_AX 0.0
param set-default CA_THRUSTER11_AY 0.0
param set-default CA_THRUSTER11_AZ -1.0

param set-default PWM_MAIN_FUNC1 501
param set-default PWM_MAIN_FUNC2 502
param set-default PWM_MAIN_FUNC3 503
param set-default PWM_MAIN_FUNC4 504
param set-default PWM_MAIN_FUNC5 505
param set-default PWM_MAIN_FUNC6 506
param set-default PWM_MAIN_FUNC7 507
param set-default PWM_MAIN_FUNC8 508
param set-default PWM_MAIN_FUNC9 509
param set-default PWM_MAIN_FUNC10 510
param set-default PWM_MAIN_FUNC11 511
param set-default PWM_MAIN_FUNC12 512

# PWM Simulation
param set PWM_SIM_PWM_MAX 10000
param set PWM_SIM_PWM_MIN 0

# Controller Tunings
param set-default SC_ROLLRATE_P 0.14
param set-default SC_PITCHRATE_P 0.14
param set-default SC_ROLLRATE_I 0.3
param set-default SC_PITCHRATE_I 0.3
param set-default SC_ROLLRATE_D 0.004
param set-default SC_PITCHRATE_D 0.004
2 changes: 2 additions & 0 deletions ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ px4_add_romfs_files(
6011_gazebo-classic_typhoon_h480.post

8011_gz_omnicopter
9000_gazebo-classic_2d_spacecraft
9001_gazebo-classic_3d_spacecraft

10015_gazebo-classic_iris
10016_none_iris
Expand Down
5 changes: 5 additions & 0 deletions ROMFS/px4fmu_common/init.d-posix/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ done

if [ -e "$autostart_file" ]
then
echo "INFO [init] using autostart file: $autostart_file"
. "$autostart_file"

elif [ ! -e "$autostart_file" ] && [ "$SYS_AUTOSTART" -ne "0" ]
Expand Down Expand Up @@ -307,6 +308,10 @@ then
uxrce_dds_port="$PX4_UXRCE_DDS_PORT"
fi

# Refresh uxrce_dds_client if already running
uxrce_dds_client stop

# Start it for SITL setup
uxrce_dds_client start -t udp -h 127.0.0.1 -p $uxrce_dds_port $uxrce_dds_ns

if param greater -s MNT_MODE_IN -1
Expand Down
7 changes: 7 additions & 0 deletions ROMFS/px4fmu_common/init.d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ if(CONFIG_MODULES_MC_RATE_CONTROL)
)
endif()

if(CONFIG_MODULES_SC_RATE_CONTROL)
px4_add_romfs_files(
rc.sc_apps
rc.sc_defaults
)
endif()

if(CONFIG_MODULES_ROVER_POS_CONTROL)
px4_add_romfs_files(
rc.rover_apps
Expand Down
Loading