From 49614cfe38a46d98557c559cc7eed798462c6a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 30 Jun 2016 15:41:17 +0200 Subject: [PATCH] SITL init scripts: add replay tryapplyparams & replay trystart These will only start replay if there's an environment variable 'replay', otherwise they do nothing. We apply the parameters even before loading the modules, so that the modules 'see' the same state as the recorded system had. We will have to see how well this works in practice. --- posix-configs/SITL/init/rcS_gazebo_iris | 2 ++ posix-configs/SITL/init/rcS_gazebo_iris_opt_flow | 2 ++ posix-configs/SITL/init/rcS_gazebo_plane | 2 ++ posix-configs/SITL/init/rcS_gazebo_solo | 2 ++ posix-configs/SITL/init/rcS_gazebo_standard_vtol | 2 ++ posix-configs/SITL/init/rcS_gazebo_tailsitter | 2 ++ posix-configs/SITL/init/rcS_gazebo_typhoon_h480 | 2 ++ posix-configs/SITL/init/rcS_jmavsim_iris | 4 ++++ posix-configs/SITL/init/rcS_lpe_gazebo_iris | 2 ++ posix-configs/SITL/init/rcS_lpe_gazebo_iris_opt_flow | 2 ++ posix-configs/SITL/init/rcS_multiple_gazebo_iris | 2 ++ 11 files changed, 24 insertions(+) diff --git a/posix-configs/SITL/init/rcS_gazebo_iris b/posix-configs/SITL/init/rcS_gazebo_iris index e0be74519c..02add40647 100644 --- a/posix-configs/SITL/init/rcS_gazebo_iris +++ b/posix-configs/SITL/init/rcS_gazebo_iris @@ -41,6 +41,7 @@ param set MPC_Z_VEL_P 0.6 param set MPC_Z_VEL_I 0.15 param set EKF2_GBIAS_INIT 0.01 param set EKF2_ANGERR_INIT 0.01 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -73,3 +74,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 100 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_iris_opt_flow b/posix-configs/SITL/init/rcS_gazebo_iris_opt_flow index d6a10f8d0e..2be4900b81 100644 --- a/posix-configs/SITL/init/rcS_gazebo_iris_opt_flow +++ b/posix-configs/SITL/init/rcS_gazebo_iris_opt_flow @@ -40,6 +40,7 @@ param set MPC_Z_VEL_P 0.8 param set MPC_Z_VEL_I 0.15 param set MPC_XY_VEL_P 0.15 param set MPC_XY_VEL_I 0.2 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -72,3 +73,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 100 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_plane b/posix-configs/SITL/init/rcS_gazebo_plane index 42bb9fe76f..19844e69bd 100644 --- a/posix-configs/SITL/init/rcS_gazebo_plane +++ b/posix-configs/SITL/init/rcS_gazebo_plane @@ -25,6 +25,7 @@ param set COM_RC_IN_MODE 1 param set NAV_DLL_ACT 2 param set NAV_ACC_RAD 15.0 param set FW_THR_IDLE 0.8 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -57,3 +58,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 200 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_solo b/posix-configs/SITL/init/rcS_gazebo_solo index 62fc557bfa..a075fdff30 100644 --- a/posix-configs/SITL/init/rcS_gazebo_solo +++ b/posix-configs/SITL/init/rcS_gazebo_solo @@ -38,6 +38,7 @@ param set MPC_Z_VEL_P 0.6 param set MPC_Z_VEL_I 0.15 param set EKF2_GBIAS_INIT 0.01 param set EKF2_ANGERR_INIT 0.01 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -70,3 +71,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 100 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_standard_vtol b/posix-configs/SITL/init/rcS_gazebo_standard_vtol index 3473324e71..7f6c8bab34 100644 --- a/posix-configs/SITL/init/rcS_gazebo_standard_vtol +++ b/posix-configs/SITL/init/rcS_gazebo_standard_vtol @@ -47,6 +47,7 @@ param set MPC_ACC_HOR_MAX 2 param set GF_ACTION 3 param set GF_MAX_HOR_DIST 500 param set GF_MAX_VER_DIST 500 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -82,3 +83,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 200 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_tailsitter b/posix-configs/SITL/init/rcS_gazebo_tailsitter index 663be85607..ea37d6f431 100644 --- a/posix-configs/SITL/init/rcS_gazebo_tailsitter +++ b/posix-configs/SITL/init/rcS_gazebo_tailsitter @@ -35,6 +35,7 @@ param set SENS_DPRES_OFF 0.001 param set SENS_BOARD_X_OFF 0.000001 param set COM_RC_IN_MODE 1 param set NAV_DLL_ACT 2 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -70,3 +71,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 200 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_gazebo_typhoon_h480 b/posix-configs/SITL/init/rcS_gazebo_typhoon_h480 index 5fd7c5f5ac..392ff03c94 100644 --- a/posix-configs/SITL/init/rcS_gazebo_typhoon_h480 +++ b/posix-configs/SITL/init/rcS_gazebo_typhoon_h480 @@ -40,6 +40,7 @@ param set MPC_XY_VEL_P 0.15 param set MPC_XY_VEL_I 0.2 param set EKF2_GBIAS_INIT 0.01 param set EKF2_ANGERR_INIT 0.01 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -72,3 +73,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 sdlog2 start -r 100 -e -t -a mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_jmavsim_iris b/posix-configs/SITL/init/rcS_jmavsim_iris index 2e90404619..1e44f2b13a 100644 --- a/posix-configs/SITL/init/rcS_jmavsim_iris +++ b/posix-configs/SITL/init/rcS_jmavsim_iris @@ -41,6 +41,7 @@ param set MPC_Z_VEL_MAX 2.0 param set MPC_Z_VEL_P 0.4 param set EKF2_GBIAS_INIT 0.01 param set EKF2_ANGERR_INIT 0.01 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -49,6 +50,7 @@ accelsim start barosim start adcsim start gpssim start +#gps start -d /dev/ttyACM0 -s pwm_out_sim mode_pwm sleep 1 sensors start @@ -72,4 +74,6 @@ mavlink stream -r 250 -s HIGHRES_IMU -u 14556 mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u 14556 mavlink stream -r 20 -s MANUAL_CONTROL -u 14556 sdlog2 start -r 100 -e -t -a +logger start -e -t mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_lpe_gazebo_iris b/posix-configs/SITL/init/rcS_lpe_gazebo_iris index f3e5dd55f8..a72c2c432a 100644 --- a/posix-configs/SITL/init/rcS_lpe_gazebo_iris +++ b/posix-configs/SITL/init/rcS_lpe_gazebo_iris @@ -35,6 +35,7 @@ param set SENS_BOARD_X_OFF 0.000001 param set COM_RC_IN_MODE 1 param set NAV_DLL_ACT 2 param set LPE_BETA_MAX 10000 +replay tryapplyparams simulator start -s rgbled start tone_alarm start @@ -70,3 +71,4 @@ sdlog2 start -r 100 -e -t -a sleep 5 local_position_estimator start mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_lpe_gazebo_iris_opt_flow b/posix-configs/SITL/init/rcS_lpe_gazebo_iris_opt_flow index e7c0c33258..536f7790b8 100644 --- a/posix-configs/SITL/init/rcS_lpe_gazebo_iris_opt_flow +++ b/posix-configs/SITL/init/rcS_lpe_gazebo_iris_opt_flow @@ -39,6 +39,7 @@ param set RTL_DESCEND_ALT 10.0 param set COM_RC_IN_MODE 1 param set NAV_DLL_ACT 2 param set LPE_BETA_MAX 10000 +replay tryapplyparams simulator start -s rgbledsim start tone_alarm start @@ -74,3 +75,4 @@ sdlog2 start -r 100 -e -t -a sleep 5 local_position_estimator start mavlink boot_complete +replay trystart diff --git a/posix-configs/SITL/init/rcS_multiple_gazebo_iris b/posix-configs/SITL/init/rcS_multiple_gazebo_iris index e6de00cff9..fbd5b5a643 100644 --- a/posix-configs/SITL/init/rcS_multiple_gazebo_iris +++ b/posix-configs/SITL/init/rcS_multiple_gazebo_iris @@ -32,6 +32,7 @@ param set COM_RC_IN_MODE 1 param set NAV_ACC_RAD 2.0 param set RTL_RETURN_ALT 30.0 param set RTL_DESCEND_ALT 10.0 +replay tryapplyparams rgbledsim start tone_alarm start gyrosim start @@ -62,3 +63,4 @@ mavlink stream -r 250 -s HIGHRES_IMU -u _MAVPORT_ mavlink stream -r 10 -s OPTICAL_FLOW_RAD -u _MAVPORT_ sdlog2 start -r 100 -e -t -a mavlink boot_complete +replay trystart