2012-08-04 19:12:36 -03:00
|
|
|
#!nsh
|
|
|
|
#
|
|
|
|
# Flight startup script for PX4FMU on PX4IOAR carrier board.
|
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
|
2012-12-09 14:18:42 -04:00
|
|
|
# Disable the USB interface
|
2012-10-02 08:02:57 -03:00
|
|
|
set USB no
|
|
|
|
|
2012-12-09 14:18:42 -04:00
|
|
|
# Disable autostarting other apps
|
|
|
|
set MODE ardrone
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
echo "[init] doing PX4IOAR startup..."
|
2012-10-02 08:02:57 -03:00
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# Start the ORB
|
|
|
|
#
|
|
|
|
uorb start
|
2012-10-02 08:02:57 -03:00
|
|
|
|
|
|
|
#
|
2012-12-09 14:18:42 -04:00
|
|
|
# Load microSD params
|
2012-10-02 08:02:57 -03:00
|
|
|
#
|
2012-12-09 14:18:42 -04:00
|
|
|
echo "[init] loading microSD params"
|
|
|
|
param select /fs/microsd/parameters
|
|
|
|
if [ -f /fs/microsd/parameters ]
|
2012-10-02 08:02:57 -03:00
|
|
|
then
|
2012-12-09 14:18:42 -04:00
|
|
|
param load /fs/microsd/parameters
|
2012-10-02 08:02:57 -03:00
|
|
|
fi
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# Start MAVLink
|
|
|
|
#
|
2012-08-19 11:32:54 -03:00
|
|
|
mavlink start -d /dev/ttyS0 -b 57600
|
2012-08-16 08:09:35 -03:00
|
|
|
usleep 5000
|
2012-10-02 08:02:57 -03:00
|
|
|
|
2012-12-09 14:18:42 -04:00
|
|
|
#
|
|
|
|
# Start the sensors and test them.
|
|
|
|
#
|
|
|
|
sh /etc/init.d/rc.sensors
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# Start the commander.
|
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
commander start
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# Start the attitude estimator
|
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
attitude_estimator_ekf start
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# Configure PX4FMU for operation with PX4IOAR
|
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
fmu mode_gpio_serial
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
# Fire up the multi rotor attitude controller
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
multirotor_att_control start
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
# Fire up the AR.Drone interface.
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-12-09 14:18:42 -04:00
|
|
|
ardrone_interface start -d /dev/ttyS1
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-12-09 14:18:42 -04:00
|
|
|
# Start logging
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-12-09 14:18:42 -04:00
|
|
|
#sdlog start
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
# Start GPS capture
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
gps start
|
|
|
|
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
|
|
|
# startup is done; we don't want the shell because we
|
2012-10-02 08:02:57 -03:00
|
|
|
# use the same UART for telemetry
|
2012-08-04 19:12:36 -03:00
|
|
|
#
|
2012-10-02 08:02:57 -03:00
|
|
|
echo "[init] startup done"
|
|
|
|
exit
|