2013-03-21 06:14:34 -03:00
|
|
|
#!nsh
|
|
|
|
#
|
|
|
|
# USB MAVLink start
|
|
|
|
#
|
|
|
|
|
2013-03-22 09:17:04 -03:00
|
|
|
echo "Starting MAVLink on this USB console"
|
2013-03-21 06:14:34 -03:00
|
|
|
|
2013-07-18 08:16:34 -03:00
|
|
|
# Stop tone alarm
|
|
|
|
tone_alarm stop
|
|
|
|
|
2013-03-21 06:14:34 -03:00
|
|
|
# Tell MAVLink that this link is "fast"
|
2013-07-18 08:16:34 -03:00
|
|
|
if mavlink stop
|
|
|
|
then
|
|
|
|
echo "stopped other MAVLink instance"
|
|
|
|
fi
|
2013-08-02 08:51:46 -03:00
|
|
|
sleep 2
|
2013-07-18 08:16:34 -03:00
|
|
|
mavlink start -b 230400 -d /dev/ttyACM0
|
|
|
|
|
2013-08-02 08:51:46 -03:00
|
|
|
# Start the commander
|
|
|
|
if commander start
|
2013-07-18 11:17:47 -03:00
|
|
|
then
|
2013-08-02 08:51:46 -03:00
|
|
|
echo "Commander started"
|
|
|
|
fi
|
2013-07-18 08:16:34 -03:00
|
|
|
|
2013-08-02 10:37:11 -03:00
|
|
|
# Start px4io if present
|
|
|
|
if px4io start
|
|
|
|
then
|
|
|
|
echo "PX4IO driver started"
|
2013-08-02 10:38:17 -03:00
|
|
|
else
|
|
|
|
if fmu mode_serial
|
|
|
|
then
|
|
|
|
echo "FMU driver started"
|
|
|
|
fi
|
2013-08-02 10:37:11 -03:00
|
|
|
fi
|
|
|
|
|
2013-08-02 08:51:46 -03:00
|
|
|
# Start sensors
|
|
|
|
sh /etc/init.d/rc.sensors
|
2013-07-18 11:17:47 -03:00
|
|
|
|
2013-08-02 08:51:46 -03:00
|
|
|
# Start one of the estimators
|
|
|
|
if attitude_estimator_ekf status
|
|
|
|
then
|
|
|
|
echo "multicopter att filter running"
|
|
|
|
else
|
|
|
|
if att_pos_estimator_ekf status
|
2013-07-18 10:20:36 -03:00
|
|
|
then
|
2013-08-02 08:51:46 -03:00
|
|
|
echo "fixedwing att filter running"
|
2013-07-18 10:20:36 -03:00
|
|
|
else
|
2013-08-02 08:51:46 -03:00
|
|
|
attitude_estimator_ekf start
|
2013-07-18 10:20:36 -03:00
|
|
|
fi
|
2013-08-02 08:51:46 -03:00
|
|
|
fi
|
2013-07-18 08:16:34 -03:00
|
|
|
|
2013-08-02 08:51:46 -03:00
|
|
|
# Start GPS
|
|
|
|
if gps start
|
|
|
|
then
|
|
|
|
echo "GPS started"
|
2013-07-18 08:16:34 -03:00
|
|
|
fi
|
2013-03-21 06:14:34 -03:00
|
|
|
|
2013-03-22 09:17:04 -03:00
|
|
|
echo "MAVLink started, exiting shell.."
|
|
|
|
|
2013-03-21 06:14:34 -03:00
|
|
|
# Exit shell to make it available to MAVLink
|
|
|
|
exit
|