#!nsh # APM startup script for NuttX on PX4 # To disable APM startup add a /fs/microsd/APM/nostart file # check for an old file called APM, caused by # a bug in an earlier firmware release if [ -f /fs/microsd/APM ] then echo "APM file found - renaming" mv /fs/microsd/APM /fs/microsd/APM.old fi if [ -f /fs/microsd/APM/nostart ] then echo "APM/nostart found - skipping APM startup" sh /etc/init.d/rc.error fi set sketch NONE if rm /fs/microsd/APM/boot.log then echo "removed old boot.log" fi set logfile /fs/microsd/APM/BOOT.LOG if mkdir /fs/microsd/APM > /dev/null then echo "Created APM directory" fi if uorb start then echo "uorb started OK" else sh /etc/init.d/rc.error fi echo Starting ArduPilot if ArduPilot start then echo ArduPilot started OK else sh /etc/init.d/rc.error fi echo "rc.APM finished"