-
Notifications
You must be signed in to change notification settings - Fork 1
/
MavlinkParameters.py
154 lines (134 loc) · 5.18 KB
/
MavlinkParameters.py
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
"""
CS 50100 Group 16
Written by Tom Shaw
Mavlink data parameter definition file. This file controls which parameters are read in for data processing.
"""
mavlink_types = [] #name of MAVLINK message type
mavlink_param = [] #name of individual parameters within MAVLINK message
mavlink_index = [] #raw MAVLINK data file index corresponding to parameter
mavlink_rate = [] #rate of data for MAVLINK message. This is needed to determine time to iterations correlation
#mavlink_ahrs_t
mavlink_types.append("mavlink_ahrs_t")
rate = 35.0
param = ["timestamp","omegaIx","omegaIy","omegaIz","accel_weight","renorm_val","error_rp","error_yaw"]
index = [1,12,14,16,18,20,22,24]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#mavlink_ahrs2_t
mavlink_types.append("mavlink_ahrs2_t")
rate = 8
param = ["timestamp","roll","pitch","yaw","altitude","lat","lng"]
index = [1,12,14,16,18,20,22]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#mavlink_ahrs3_t
mavlink_types.append("mavlink_ahrs3_t")
rate = 8
param = ["timestamp","roll","pitch","yaw","altitude","lat","lng"]
index = [1,12,14,16,18,20,22]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#mavlink_attitude_t
mavlink_types.append("mavlink_attitude_t")
rate = 8.5
param = ["timestamp","time boot ms","roll angle","pitch angle","yaw angle","roll rate","pitch rate","yaw rate"]
index = [1,12,14,16,18,20,22,24]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#TS - battery data does not change
#mavlink_battery_status_t
#mavlink_types.append("mavlink_battery_status_t")
#rate = 5
#param = ["timestamp", "Current Consumed","Energy Consumed","Battery temperature","battery current","battery function","battery remaining","battery time remaining"]
#index = [1,12,14,16,20,24,28,30]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
#mavlink_ekf_status_report_t
#mavlink_types.append("mavlink_ekf_status_report_t")
#rate = 35.0
#param = ["timestamp","velocity_variance","pos_horiz_variance","pos_vert_variance","compass_variance","terrain_alt_variance","flags","airspeed_variance"]
#index = [1,12,14,16,18,20,22,24]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
#mavlink_global_position_int_t
mavlink_types.append("mavlink_global_position_int_t")
rate = 9.0
param = ["timestamp", "time_boot_ms","lat","lon","alt","relative_alt","vx","vy","vz","hdg"]
index = [1,12,14,16,18,20,22,24,26,28]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#mavlink_gps_raw_int_t
#mavlink_types.append("mavlink_gps_raw_int_t")
#rate = 5.0
#param = ["timestamp", "time_usec","lat","lon","alt","eph","epv","vel","cog","fix_type","satelliets_visibile","alt_ellipsoid","h_acc","v_acc","vel_acc","hdg_acc"]
#index = [1,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
#mavlink_gps2_raw_t
#mavlink_types.append("mavlink_gps2_raw_t")
#rate = 5.0
#param = ["timestamp", "time_usec","lat","lon","alt","dgps_age","eph","epv","vel","cog","fix_type","satelliets_visibile","dgps_numch"]
#index = [1,12,14,16,18,20,22,24,26,28,30,32,34]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
##mavlink_mission_current_t
#mavlink_types.append("mavlink_mission_current_t")
#rate = 10.0
#param = ["timestamp", "seq"]
#index = [1,12]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
##mavlink_nav_controller_output_t
#mavlink_types.append("mavlink_nav_controller_output_t")
#rate = 10.0
#param = ["timestamp", "nav_roll","nav_pitch","alt_error","aspd_error","xtrack_error","nav_bearing","target_bearing","wp_dist"]
#index = [1,12,14,16,18,20,22,24,26]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
#mavlink_raw_imu_t
mavlink_types.append("mavlink_raw_imu_t")
rate = 50.0
param = ["IMU timestamp","Xaccel","Yaccel","Zaccel","XGyro","YGyro","ZGyro","XMag","YMag","ZMag"]
index = [1,14,16,18,20,22,24,26,28,30]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#mavlink_servo_output_raw_t
mavlink_types.append("mavlink_servo_output_raw_t")
rate = 8.2
param = ["Servo timestamp","Servo utime","Servo 1","Servo 2","Servo 3","Servo 4"]
index = [1,12,14,16,18,20]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
##mavlink_system_time_t
#mavlink_types.append("mavlink_system_time_t")
#rate = 35.0
#param = ["timestamp","time_unix_usec","time_boot_ms"]
#index = [1,12,14]
#mavlink_param.append(param)
#mavlink_index.append(index)
#mavlink_rate.append(rate)
#mavlink_vibration_t
mavlink_types.append("mavlink_vibration_t")
rate = 35.0
param = ["timestamp","vibration_x","vibration_y","vibration_z"]
index = [1,14,16,18]
mavlink_param.append(param)
mavlink_index.append(index)
mavlink_rate.append(rate)
#error check parameter and index sizes are the same to avoid nasty surprises
for typ in range(len(mavlink_types)):
if(len(mavlink_param[typ]) != len(mavlink_index[typ])):
raise ValueError("ERROR: mavlink type " + mavlink_types[typ] + " has mismatched index and param size")