2013-04-26 20:14:32 -03:00
|
|
|
#!nsh
|
|
|
|
#
|
|
|
|
# Standard startup script for PX4FMU onboard sensor drivers.
|
|
|
|
#
|
|
|
|
|
|
|
|
ms5611 start
|
|
|
|
adc start
|
|
|
|
|
2014-01-14 19:02:57 -04:00
|
|
|
# Mag might be external
|
2013-08-19 11:51:22 -03:00
|
|
|
if hmc5883 start
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using HMC5883"
|
2013-08-19 11:51:22 -03:00
|
|
|
fi
|
2013-08-19 11:34:12 -03:00
|
|
|
|
2013-04-26 20:14:32 -03:00
|
|
|
if mpu6000 start
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using MPU6000"
|
2013-12-15 14:35:23 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if l3gd20 start
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using L3GD20(H)"
|
2013-12-15 14:35:23 -04:00
|
|
|
fi
|
|
|
|
|
2014-01-14 19:02:57 -04:00
|
|
|
if hw_ver compare PX4FMU_V2
|
2013-12-15 14:35:23 -04:00
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
if lsm303d start
|
|
|
|
then
|
|
|
|
echo "[init] Using LSM303D"
|
|
|
|
fi
|
2013-04-26 20:14:32 -03:00
|
|
|
fi
|
|
|
|
|
2013-09-29 09:07:01 -03:00
|
|
|
# Start airspeed sensors
|
|
|
|
if meas_airspeed start
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using MEAS airspeed sensor"
|
2013-09-29 09:07:01 -03:00
|
|
|
else
|
|
|
|
if ets_airspeed start
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using ETS airspeed sensor (bus 3)"
|
2013-09-29 09:07:01 -03:00
|
|
|
else
|
|
|
|
if ets_airspeed start -b 1
|
|
|
|
then
|
2014-01-14 19:02:57 -04:00
|
|
|
echo "[init] Using ETS airspeed sensor (bus 1)"
|
2013-09-29 09:07:01 -03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-04-26 20:14:32 -03:00
|
|
|
#
|
|
|
|
# Start the sensor collection task.
|
|
|
|
# IMPORTANT: this also loads param offsets
|
|
|
|
# ALWAYS start this task before the
|
|
|
|
# preflight_check.
|
|
|
|
#
|
2013-07-18 08:16:34 -03:00
|
|
|
if sensors start
|
|
|
|
then
|
2013-07-18 10:26:14 -03:00
|
|
|
preflight_check &
|
2013-07-18 08:28:26 -03:00
|
|
|
fi
|