2013-03-21 06:14:34 -03:00
|
|
|
#!nsh
|
|
|
|
#
|
|
|
|
# USB HIL start
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "[HIL] starting.."
|
|
|
|
|
|
|
|
uorb start
|
|
|
|
|
|
|
|
# Tell MAVLink that this link is "fast"
|
|
|
|
mavlink start -b 230400 -d /dev/console
|
|
|
|
|
|
|
|
# Create a fake HIL /dev/pwm_output interface
|
|
|
|
hil mode_pwm
|
|
|
|
|
|
|
|
#
|
|
|
|
# Load microSD params
|
|
|
|
#
|
|
|
|
echo "[init] loading microSD params"
|
2013-05-13 05:26:42 -03:00
|
|
|
param select /fs/microsd/params
|
|
|
|
if [ -f /fs/microsd/params ]
|
2013-03-21 06:14:34 -03:00
|
|
|
then
|
2013-05-13 05:26:42 -03:00
|
|
|
param load /fs/microsd/params
|
2013-03-21 06:14:34 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Force some key parameters to sane values
|
|
|
|
# MAV_TYPE 1 = fixed wing, 2 = quadrotor, 13 = hexarotor
|
|
|
|
# see https://pixhawk.ethz.ch/mavlink/
|
|
|
|
#
|
|
|
|
param set MAV_TYPE 1
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start the commander (depends on orb, mavlink)
|
|
|
|
#
|
|
|
|
commander start
|
|
|
|
|
2013-03-24 14:38:40 -03:00
|
|
|
#
|
|
|
|
# Check if we got an IO
|
|
|
|
#
|
|
|
|
if [ px4io start ]
|
|
|
|
then
|
|
|
|
echo "IO started"
|
|
|
|
else
|
|
|
|
fmu mode_serial
|
|
|
|
echo "FMU started"
|
|
|
|
end
|
|
|
|
|
2013-03-21 06:14:34 -03:00
|
|
|
#
|
|
|
|
# Start the sensors (depends on orb, px4io)
|
|
|
|
#
|
|
|
|
sh /etc/init.d/rc.sensors
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start the attitude estimator (depends on orb)
|
|
|
|
#
|
2013-07-04 10:45:32 -03:00
|
|
|
att_pos_estimator_ekf start
|
2013-03-21 06:14:34 -03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Load mixer and start controllers (depends on px4io)
|
|
|
|
#
|
|
|
|
mixer load /dev/pwm_output /etc/mixers/FMU_AET.mix
|
2013-07-04 10:45:32 -03:00
|
|
|
fixedwing_backside start
|
2013-03-21 06:14:34 -03:00
|
|
|
|
|
|
|
echo "[HIL] setup done, running"
|
|
|
|
|
|
|
|
# Exit shell to make it available to MAVLink
|
|
|
|
exit
|