aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_common/init.d/rc.usb
blob: ccf2cd47eae9218bc2458f4ee495d1bf06be3403 (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
67
68
69
70
71
72
73
74
75
#!nsh
#
# USB MAVLink start
#

echo "Starting MAVLink on this USB console"

# Stop tone alarm
tone_alarm stop

#
# Check for UORB
#
if uorb start
then
	echo "uORB started"
fi

# Tell MAVLink that this link is "fast"
if mavlink stop
then
	echo "stopped other MAVLink instance"
fi
mavlink start -b 230400 -d /dev/ttyACM0

# Stop commander
if commander stop
then
	echo "Commander stopped"
fi
sleep 1

# Start the commander
if commander start
then
	echo "Commander started"
fi

# Start px4io if present
if px4io start
then
	echo "PX4IO driver started"
else
	if fmu mode_serial
	then
		echo "FMU driver started"
	fi
fi

# Start sensors
sh /etc/init.d/rc.sensors

# Start one of the estimators
if attitude_estimator_ekf status
then
	echo "multicopter att filter running"
else
	if att_pos_estimator_ekf status
	then
		echo "fixedwing att filter running"
	else
		attitude_estimator_ekf start
	fi
fi

# Start GPS
if gps start
then
	echo "GPS started"
fi

echo "MAVLink started, exiting shell.."

# Exit shell to make it available to MAVLink
exit