aboutsummaryrefslogtreecommitdiff
path: root/ROMFS
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-03-21 10:14:34 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-03-21 10:14:34 +0100
commit70a85739ccf2df6f032093ee9b0f03666d5a241c (patch)
treeb792e6d0af1f0031af3ba3255552c66a4f76b429 /ROMFS
parentbee896786a3236d7dac3f5460c56ff6e335f1e23 (diff)
downloadpx4-firmware-70a85739ccf2df6f032093ee9b0f03666d5a241c.tar.gz
px4-firmware-70a85739ccf2df6f032093ee9b0f03666d5a241c.tar.bz2
px4-firmware-70a85739ccf2df6f032093ee9b0f03666d5a241c.zip
Added startup scripts useful when running USB consoles, made MAVLink aware that /dev/console is a hint for running on USB (magic strings, magic strings)
Diffstat (limited to 'ROMFS')
-rw-r--r--ROMFS/Makefile2
-rw-r--r--ROMFS/scripts/rc.hil57
-rw-r--r--ROMFS/scripts/rc.usb14
3 files changed, 73 insertions, 0 deletions
diff --git a/ROMFS/Makefile b/ROMFS/Makefile
index 15167bf47..ed39ab825 100644
--- a/ROMFS/Makefile
+++ b/ROMFS/Makefile
@@ -22,6 +22,8 @@ ROMFS_FSSPEC := $(SRCROOT)/scripts/rcS~init.d/rcS \
$(SRCROOT)/scripts/rc.PX4IO~init.d/rc.PX4IO \
$(SRCROOT)/scripts/rc.PX4IOAR~init.d/rc.PX4IOAR \
$(SRCROOT)/scripts/rc.FMU_quad_x~init.d/rc.FMU_quad_x \
+ $(SRCROOT)/scripts/rc.usb~init.d/rc.usb \
+ $(SRCROOT)/scripts/rc.hil~init.d/rc.hil \
$(SRCROOT)/mixers/FMU_pass.mix~mixers/FMU_pass.mix \
$(SRCROOT)/mixers/FMU_Q.mix~mixers/FMU_Q.mix \
$(SRCROOT)/mixers/FMU_X5.mix~mixers/FMU_X5.mix \
diff --git a/ROMFS/scripts/rc.hil b/ROMFS/scripts/rc.hil
new file mode 100644
index 000000000..3b37ac26b
--- /dev/null
+++ b/ROMFS/scripts/rc.hil
@@ -0,0 +1,57 @@
+#!nsh
+#
+# USB HIL start
+#
+
+echo "[HIL] starting.."
+
+uorb start
+
+# Tell MAVLink that this link is "fast"
+mavlink start -b 230400 -d /dev/console
+
+# Create a fake HIL /dev/pwm_output interface
+hil mode_pwm
+
+#
+# Load microSD params
+#
+echo "[init] loading microSD params"
+param select /fs/microsd/parameters
+if [ -f /fs/microsd/parameters ]
+then
+ param load /fs/microsd/parameters
+fi
+
+#
+# Force some key parameters to sane values
+# MAV_TYPE 1 = fixed wing, 2 = quadrotor, 13 = hexarotor
+# see https://pixhawk.ethz.ch/mavlink/
+#
+param set MAV_TYPE 1
+
+#
+# Start the commander (depends on orb, mavlink)
+#
+commander start
+
+#
+# Start the sensors (depends on orb, px4io)
+#
+sh /etc/init.d/rc.sensors
+
+#
+# Start the attitude estimator (depends on orb)
+#
+kalman_demo start
+
+#
+# Load mixer and start controllers (depends on px4io)
+#
+mixer load /dev/pwm_output /etc/mixers/FMU_AET.mix
+control_demo start
+
+echo "[HIL] setup done, running"
+
+# Exit shell to make it available to MAVLink
+exit
diff --git a/ROMFS/scripts/rc.usb b/ROMFS/scripts/rc.usb
new file mode 100644
index 000000000..9031b38a2
--- /dev/null
+++ b/ROMFS/scripts/rc.usb
@@ -0,0 +1,14 @@
+#!nsh
+#
+# USB MAVLink start
+#
+
+echo "[testing] doing production test.."
+
+# Tell MAVLink that this link is "fast"
+mavlink start -b 230400 -d /dev/console
+
+# Exit shell to make it available to MAVLink
+exit
+
+echo "[testing] testing done"