feat(sim): add RotorPy simulator support (#27116)

* Add rotorpy simulator and integrate with main simulator script

* docs: add rotorpy simulator instructions

* docs(update): subedit

* docs: address RotorPy review comments

---------

Co-authored-by: Davide Iafrate <dvde.iafrate98@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
This commit is contained in:
Davide Iafrate
2026-06-26 03:51:55 +05:00
committed by GitHub
parent 3db36cb022
commit 6ddf60c7b4
6 changed files with 137 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ px4_add_romfs_files(
px4-rc.jmavsim
px4-rc.mavlinksim
px4-rc.sihsim
px4-rc.rotorpy
rc.replay
rcS
)

View File

@@ -0,0 +1,33 @@
#!/bin/sh
echo "INFO [init] rotorpy sensors simulator"
param set-default SYS_HITL 1
if [ -n "${PX4_HOME_LAT}" ]; then
param set SIH_LOC_LAT0 ${PX4_HOME_LAT}
fi
if [ -n "${PX4_HOME_LON}" ]; then
param set SIH_LOC_LON0 ${PX4_HOME_LON}
fi
if [ -n "${PX4_HOME_ALT}" ]; then
param set SIH_LOC_H0 ${PX4_HOME_ALT}
fi
if param compare -s SENS_EN_BAROSIM 1
then
sensor_baro_sim start
fi
if param compare -s SENS_EN_GPSSIM 1
then
sensor_gps_sim start
fi
if param compare -s SENS_EN_MAGSIM 1
then
sensor_mag_sim start
fi
if param compare -s SENS_EN_AGPSIM 1
then
sensor_agp_sim start
fi

View File

@@ -11,6 +11,11 @@ if [ "$PX4_SIMULATOR" = "sihsim" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "0"
# Run SIH
. px4-rc.sihsim
elif [ "$PX4_SIMULATOR" = "rotorpy" ]; then
# No simulator, possibly HITL
. px4-rc.mavlinksim
. px4-rc.rotorpy
elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then
# Run Gazebo (gz)
. px4-rc.gzsim