aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common/init.d/rc.sensors
blob: f50e9aff7fdccc91ca0a5207164ebfdfe23b10b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!nsh
#
# Standard startup script for PX4FMU onboard sensor drivers.
#

ms5611 start
adc start

if mpu6000 start
then
	echo "[init] Using MPU6000"
fi

if l3gd20 start
then
	echo "[init] Using L3GD20(H)"
fi

# Use selected (internal/external) magnetometer
if param compare SYS_EXT_MAG 0
then
	if hmc5883 -I start
	then
		echo "[init] Using internal HMC5883"
	fi

	if ver hwcmp PX4FMU_V2
	then
		if lsm303d start
		then
			echo "[init] Using internal LSM303D"
		fi
	fi
else
	if hmc5883 -X start
	then
		echo "[init] Using external HMC5883"
	fi
fi

# Start airspeed sensors
if meas_airspeed start
then
	echo "[init] Using MEAS airspeed sensor"
else
	if ets_airspeed start
	then
		echo "[init] Using ETS airspeed sensor (bus 3)"
	else
		if ets_airspeed start -b 1
		then
			echo "[init] Using ETS airspeed sensor (bus 1)"
		fi
	fi
fi

#
# Start the sensor collection task.
# IMPORTANT: this also loads param offsets
# ALWAYS start this task before the
# preflight_check.
#
if sensors start
then
	preflight_check &
fi