diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna b/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna index e87e013e5d77..bfecc1a0ca87 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna @@ -11,14 +11,13 @@ PX4_GZ_WORLD=${PX4_GZ_WORLD:=default} PX4_SIM_MODEL=${PX4_SIM_MODEL:=rc_cessna} param set-default SIM_GZ_EN 1 +param set-default SIM_GZ_RUN_GZSIM 0 param set-default SENS_EN_GPSSIM 1 -param set-default SENS_EN_BAROSIM 0 +param set-default SENS_EN_BAROSIM 1 param set-default SENS_EN_MAGSIM 1 param set-default SENS_EN_ARSPDSIM 1 - - param set-default FW_LND_ANG 8 param set-default NPFG_PERIOD 12 diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol b/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol index 39f5f8f3e25d..9841c988c614 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol @@ -12,9 +12,10 @@ PX4_GZ_WORLD=${PX4_GZ_WORLD:=default} PX4_SIM_MODEL=${PX4_SIM_MODEL:=standard_vtol} param set-default SIM_GZ_EN 1 +param set-default SIM_GZ_RUN_GZSIM 0 param set-default SENS_EN_GPSSIM 1 -param set-default SENS_EN_BAROSIM 0 +param set-default SENS_EN_BAROSIM 1 param set-default SENS_EN_MAGSIM 1 param set-default SENS_EN_ARSPDSIM 1 diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4440_gz_ssrc_skywalker_x8 b/ROMFS/px4fmu_common/init.d-posix/airframes/4440_gz_ssrc_skywalker_x8 index 6d3a6f525a8c..d2ede5ef2686 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/4440_gz_ssrc_skywalker_x8 +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4440_gz_ssrc_skywalker_x8 @@ -15,6 +15,11 @@ PX4_SIM_MODEL=${PX4_SIM_MODEL:=skywalker_x8} param set-default SIM_GZ_EN 1 param set-default SIM_GZ_RUN_GZSIM 0 +param set-default SENS_EN_GPSSIM 1 +param set-default SENS_BAROSIM 0 +param set-default SENS_EN_MAGSIM 1 +param set-default SENS_EN_ARSPDSIM 1 + # Control allocator parameters param set-default CA_AIRFRAME 1 param set-default CA_ROTOR_COUNT 1 @@ -26,44 +31,65 @@ param set-default CA_SV_CS1_TYPE 6 param set-default CA_SV_CS1_TRQ_P 0.5 param set-default CA_SV_CS1_TRQ_R 0.5 -# PWM -param set-default PWM_MAIN_FUNC1 201 -param set-default PWM_MAIN_FUNC2 202 -param set-default PWM_MAIN_FUNC4 101 -param set-default PWM_AUX_FUNC1 201 -param set-default PWM_AUX_FUNC2 202 -param set-default PWM_AUX_FUNC4 101 +# GZ SIM +param set-default SIM_GZ_EC_FUNC1 101 +param set-default SIM_GZ_EC_MIN1 0 +param set-default SIM_GZ_EC_MAX1 1000 + +param set-default SIM_GZ_SV_FUNC1 201 +param set-default SIM_GZ_SV_FUNC2 202 # Airspeed parameters -sdp3x start -X -f 400 -param set-default ASPD_DO_CHECKS 15 -param set-default FW_AIRSPD_MAX 22.0 -param set-default FW_AIRSPD_MIN 14.0 -param set-default FW_AIRSPD_STALL 12.0 -param set-default FW_AIRSPD_TRIM 18.0 +param set-default ASPD_PRIMARY 1 +# param set-default FW_AIRSPD_MAX 22.0 +# param set-default FW_AIRSPD_MIN 14.0 +# param set-default FW_AIRSPD_STALL 12.0 +# param set-default FW_AIRSPD_TRIM 18.0 -# Battery parameters -param set-default BAT1_N_CELLS 4 -param set-default BAT1_R_INTERNAL 0.0050 -param set-default BAT1_V_EMPTY 3.6000 -param set-default BAT1_V_LOAD_DROP 0.1000 +# Maximum landing slope angle in deg +param set-default FW_LND_ANG 8 -param set-default BAT2_R_INTERNAL 0.0050 -param set-default BAT2_V_EMPTY 3.6000 -param set-default BAT2_V_LOAD_DROP 0.1000 +# RC loss failsafe to HOLD mode +param set-default COM_RC_IN_MODE 1 -# Disable internal magnetometer -param set CAL_MAG0_PRIO 0 +# Fixed wing control +# Pitch rate +param set-default FW_PR_P 0.9 +param set-default FW_PR_FF 0.5 +param set-default FW_PR_I 0.5 +param set-default TRIM_PITCH -0.15 +# Pitch angle in deg +param set-default FW_PSP_OFF 0 +param set-default FW_P_LIM_MIN -15 +# Roll rate +param set-default FW_RR_FF 0.5 +param set-default FW_RR_P 0.3 +param set-default FW_RR_I 0.5 +# Yaw rate +param set-default FW_YR_FF 0.5 +param set-default FW_YR_P 0.6 +param set-default FW_YR_I 0.5 +# Throttle limit +# param set-default FW_THR_MAX 0.6 +# param set-default FW_THR_MIN 0.05 +# param set-default FW_THR_TRIM 0.25 +# Climb and sink rate +param set-default FW_T_CLMB_MAX 8 +param set-default FW_T_SINK_MAX 2.7 +param set-default FW_T_SINK_MIN 2.2 -# Launch detection -param set-default FW_LAUN_DETCN_ON 1 +# Navigation +param set-default NAV_ACC_RAD 15 +param set-default NAV_DLL_ACT 2 -# Maximum manual roll angle -param set-default FW_MAN_R_MAX 60.0 +# Misc +param set-default MIS_TAKEOFF_ALT 30.0 +param set-default RTL_RETURN_ALT 30.0 -# Rate control -param set-default FW_RR_IMAX 0.4000 -param set-default FW_YR_IMAX 0.4000 +# Disable internal magnetometer +param set CAL_MAG0_PRIO 0 -# Misc -param set-default RTL_RETURN_ALT 30.0 \ No newline at end of file +# Catapult launch with acc threshold trigger +param set-default FW_LAUN_DETCN_ON 1 +param set-default FW_THR_IDLE 0.1 # needs to be running before throw as that's how gazebo detects arming +param set-default FW_LAUN_AC_THLD 10 diff --git a/packaging/entrypoint_sitl_gzsim.sh b/packaging/entrypoint_sitl_gzsim.sh index ace9a173475c..c42bdafe05b1 100755 --- a/packaging/entrypoint_sitl_gzsim.sh +++ b/packaging/entrypoint_sitl_gzsim.sh @@ -13,12 +13,12 @@ case $PX4_VEHICLE_TYPE in export PX4_GZ_MODEL=scout_mini ;; vtol) - export PX4_SYS_AUTOSTART=4430 - export PX4_GZ_MODEL=striver_mini + export PX4_SYS_AUTOSTART=4004 + export PX4_GZ_MODEL=standard_vtol ;; fw) - export PX4_SYS_AUTOSTART=4440 - export PX4_GZ_MODEL=skywalker_x8 + export PX4_SYS_AUTOSTART=4003 + export PX4_GZ_MODEL=rc_cessna ;; *) echo "ERROR: unknown vehicle type: $PX4_VEHICLE_TYPE" diff --git a/src/modules/simulation/sensor_gps_sim/SensorGpsSim.cpp b/src/modules/simulation/sensor_gps_sim/SensorGpsSim.cpp index 1e1b5be22c06..283e171ec37f 100644 --- a/src/modules/simulation/sensor_gps_sim/SensorGpsSim.cpp +++ b/src/modules/simulation/sensor_gps_sim/SensorGpsSim.cpp @@ -114,9 +114,9 @@ void SensorGpsSim::Run() vehicle_global_position_s gpos{}; _vehicle_global_position_sub.copy(&gpos); - double latitude = gpos.lat + math::degrees((double)generate_wgn() * 0.2 / CONSTANTS_RADIUS_OF_EARTH); - double longitude = gpos.lon + math::degrees((double)generate_wgn() * 0.2 / CONSTANTS_RADIUS_OF_EARTH); - float altitude = gpos.alt + (generate_wgn() * 0.5f); + double latitude = gpos.lat + math::degrees((double)generate_wgn() * 0.1 / CONSTANTS_RADIUS_OF_EARTH); + double longitude = gpos.lon + math::degrees((double)generate_wgn() * 0.1 / CONSTANTS_RADIUS_OF_EARTH); + float altitude = gpos.alt + (generate_wgn() * 0.1f); Vector3f gps_vel = Vector3f{lpos.vx, lpos.vy, lpos.vz} + noiseGauss3f(0.06f, 0.077f, 0.158f);