px4-firmware/ROMFS/px4fmu_common/init.d/rc.usb

76 lines
1.0 KiB
Plaintext
Raw Normal View History

#!nsh
#
# USB MAVLink start
#
2013-03-22 09:17:04 -03:00
echo "Starting MAVLink on this USB console"
# Stop tone alarm
tone_alarm stop
# Tell MAVLink that this link is "fast"
if mavlink stop
then
echo "stopped other MAVLink instance"
fi
2013-08-02 08:51:46 -03:00
sleep 2
mavlink start -b 230400 -d /dev/ttyACM0
# Stop commander
if commander stop
then
echo "Commander stopped"
fi
sleep 1
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
# Stop px4io
if px4io stop
then
echo "PX4IO stopped"
fi
sleep 1
2013-08-02 10:37:11 -03:00
# Start px4io if present
if px4io start
then
echo "PX4IO driver started"
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
then
2013-08-02 08:51:46 -03:00
echo "fixedwing att filter running"
else
2013-08-02 08:51:46 -03:00
attitude_estimator_ekf start
fi
2013-08-02 08:51:46 -03:00
fi
2013-08-02 08:51:46 -03:00
# Start GPS
if gps start
then
echo "GPS started"
fi
2013-03-22 09:17:04 -03:00
echo "MAVLink started, exiting shell.."
# Exit shell to make it available to MAVLink
exit