From bd39d101f58aa5e1ca5f8f7feb72ed46e0e19939 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 16 Sep 2013 22:32:54 +0200 Subject: [PATCH] Fixed HIL rc script --- .../init.d/{rc.hil => 1000_rc.hil} | 37 ++++++++++++++++++- ROMFS/px4fmu_common/init.d/rcS | 2 +- 2 files changed, 36 insertions(+), 3 deletions(-) rename ROMFS/px4fmu_common/init.d/{rc.hil => 1000_rc.hil} (54%) diff --git a/ROMFS/px4fmu_common/init.d/rc.hil b/ROMFS/px4fmu_common/init.d/1000_rc.hil similarity index 54% rename from ROMFS/px4fmu_common/init.d/rc.hil rename to ROMFS/px4fmu_common/init.d/1000_rc.hil index 6c9bfe6dc3..11318023c7 100644 --- a/ROMFS/px4fmu_common/init.d/rc.hil +++ b/ROMFS/px4fmu_common/init.d/1000_rc.hil @@ -3,10 +3,43 @@ # USB HIL start # -echo "[HIL] starting.." +echo "[HIL] HILStar starting.." +# +# Load default params for this platform +# +if param compare SYS_AUTOCONFIG 1 +then + # Set all params here, then disable autoconfig + + param set FW_P_D 0 + param set FW_P_I 0 + param set FW_P_IMAX 15 + param set FW_P_LIM_MAX 50 + param set FW_P_LIM_MIN -50 + param set FW_P_P 60 + param set FW_P_RMAX_NEG 0 + param set FW_P_RMAX_POS 0 + param set FW_P_ROLLFF 1.1 + param set FW_R_D 0 + param set FW_R_I 5 + param set FW_R_IMAX 20 + param set FW_R_P 100 + param set FW_R_RMAX 100 + param set FW_THR_CRUISE 0.65 + param set FW_THR_MAX 1 + param set FW_THR_MIN 0 + param set FW_T_SINK_MAX 5.0 + param set FW_T_SINK_MIN 4.0 + param set FW_Y_ROLLFF 1.1 + + param set SYS_AUTOCONFIG 0 + param save +fi + +# Allow USB some time to come up +sleep 1 # Tell MAVLink that this link is "fast" -sleep 2 mavlink start -b 230400 -d /dev/ttyACM0 # Create a fake HIL /dev/pwm_output interface diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index cd4d4487d9..040b5d594a 100755 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -103,7 +103,7 @@ then if param compare SYS_AUTOSTART 1000 then - sh /etc/init.d/rc.hil + sh /etc/init.d/1000_rc.hil set MODE custom else # Try to get an USB console