forked from ShiauweiZhao/plotulog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgetNavState.m
56 lines (54 loc) · 1.2 KB
/
getNavState.m
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
function retState = getNavState(state)
% Return description of navigation state number
% All descriptions are from px4 code here
% https://github.com/PX4/Firmware/blob/d3c37e0206c4ed50e64ade05c95a580a5bb18eb7/msg/vehicle_status.msg#L23
% Author: Kyuhyong You
% Date: 2018/9/28
switch(state)
case 0
retState = 'Manual';
case 1
retState = 'ALTCTL';
case 2
retState = 'POSCTL';
case 3
retState = 'AUTO';
case 4
retState = 'LOITER';
case 5
retState = 'RTL';
case 6
retState = 'RECOVER';
case 7
retState = 'RTGS';
case 8
retState = 'LandEngFail';
case 9
retState = 'LandGPSFail';
case 10
retState = 'ACRO';
case 11
retState = 'UNUSED';
case 12
retState = 'DESCEND';
case 13
retState = 'TERMINATE';
case 14
retState = 'OFF BRD';
case 15
retState = 'STAB';
case 16
retState = 'Rattitude';
case 17
retState = 'Auto TO';
case 18
retState = 'Auto Land';
case 19
retState = 'FLW TGT';
case 20
retState = 'Prec Land';
case 21
retState = 'Max';
otherwise
retState = 'Not supported';
end