diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-18 13:18:42 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-18 13:18:42 +0200 |
commit | a4d0594bd73d6ec24c320380674d94c59a141595 (patch) | |
tree | 1f3a082db48270a4a307654b447e3db3db8b56d7 /ROMFS/px4fmu_common | |
parent | 47dd3fdae1d626a28c273946d45ea8c79fb4b76f (diff) | |
parent | 8d1abf4aa441e1c6c886e8af6ecaab2c3ca6e255 (diff) | |
download | px4-firmware-a4d0594bd73d6ec24c320380674d94c59a141595.tar.gz px4-firmware-a4d0594bd73d6ec24c320380674d94c59a141595.tar.bz2 px4-firmware-a4d0594bd73d6ec24c320380674d94c59a141595.zip |
Merge branch 'master' into autostart
Diffstat (limited to 'ROMFS/px4fmu_common')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.sensors | 13 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.usb | 27 | ||||
-rwxr-xr-x | ROMFS/px4fmu_common/init.d/rcS | 52 |
3 files changed, 65 insertions, 27 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 62c7184b8..5cf1ff383 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -34,9 +34,10 @@ fi # ALWAYS start this task before the # preflight_check. # -sensors start - -# -# Check sensors - run AFTER 'sensors start' -# -preflight_check
\ No newline at end of file +if sensors start +then + # + # Check sensors - run AFTER 'sensors start' + # + preflight_check +fi
\ No newline at end of file diff --git a/ROMFS/px4fmu_common/init.d/rc.usb b/ROMFS/px4fmu_common/init.d/rc.usb index 31af3991a..986821994 100644 --- a/ROMFS/px4fmu_common/init.d/rc.usb +++ b/ROMFS/px4fmu_common/init.d/rc.usb @@ -5,8 +5,33 @@ echo "Starting MAVLink on this USB console" +# Stop tone alarm +tone_alarm stop + # Tell MAVLink that this link is "fast" -mavlink start -b 230400 -d /dev/console +if mavlink stop +then + echo "stopped other MAVLink instance" +fi +mavlink start -b 230400 -d /dev/ttyACM0 + +# Start the commander +commander start + +# Start sensors +sh /etc/init.d/rc.sensors + +# Start one of the estimators +if attitude_estimator_ekf start +then + echo "estimating attitude" +fi + +# Start GPS +if gps start +then + echo "GPS started" +fi echo "MAVLink started, exiting shell.." diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 06c1c2492..ee7e84050 100755 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -7,7 +7,6 @@ # can change this to prevent automatic startup of the flight script. # set MODE autostart -set USB autoconnect # # Try to mount the microSD card. @@ -66,31 +65,44 @@ then sh /fs/microsd/etc/rc.txt fi -# -# Check for USB host -# -if [ $USB != autoconnect ] +# if this is an APM build then there will be a rc.APM script +# from an EXTERNAL_SCRIPTS build option +if [ -f /etc/init.d/rc.APM ] then - echo "[init] not connecting USB" -else if sercon then echo "[init] USB interface connected" - else - if [ -f /dev/ttyACM0 ] - echo "[init] NSH via USB" - then - else - echo "[init] No USB connected" - fi fi -fi -# if this is an APM build then there will be a rc.APM script -# from an EXTERNAL_SCRIPTS build option -if [ -f /etc/init.d/rc.APM ] -then - echo Running rc.APM + echo "Running rc.APM" # if APM startup is successful then nsh will exit sh /etc/init.d/rc.APM fi + +if [ $MODE == autostart ] +then + +# +# Start the ORB (first app to start) +# +uorb start + +# +# Load microSD params +# +if ramtron start +then + param select /ramtron/params + if [ -f /ramtron/params ] + then + param load /ramtron/params + fi +else + param select /fs/microsd/params + if [ -f /fs/microsd/params ] + then + param load /fs/microsd/params + fi +fi + +fi |