@@ -42,8 +42,18 @@ def generateReport(args):
42
42
'gyroscope' : {"v" : [], "t" : [], "td" : []},
43
43
'magnetometer' : {"v" : [], "t" : [], "td" : []},
44
44
'barometer' : {"v" : [], "t" : [], "td" : []},
45
- 'gnss' : {"v" : [], "t" : [], "td" : []},
46
45
'cpu' : {"v" : [], "t" : [], "td" : [], "processes" : {}},
46
+ 'gnss' : {
47
+ "t" : [],
48
+ "td" : [],
49
+ "position" : [], # ENU
50
+ "altitude" : [] # WGS-84
51
+ },
52
+ 'vio' : {"t" : [], "td" : [], "status" : [], "position" : [], "global" : {
53
+ "position" : [], # ENU
54
+ "velocity" : [], # ENU
55
+ "altitude" : [] # WGS-84
56
+ }},
47
57
'cameras' : {}
48
58
}
49
59
@@ -74,6 +84,7 @@ def addMeasurement(type, t, v):
74
84
gnss = measurement .get ("gps" )
75
85
frames = measurement .get ("frames" )
76
86
metrics = measurement .get ("systemMetrics" )
87
+ vioOutput = measurement if "status" in measurement else None
77
88
if frames is None and 'frame' in measurement :
78
89
frames = [measurement ['frame' ]]
79
90
frames [0 ]['cameraInd' ] = 0
@@ -84,14 +95,14 @@ def addMeasurement(type, t, v):
84
95
and frames is None
85
96
and metrics is None
86
97
and barometer is None
87
- and gnss is None ): continue
98
+ and gnss is None
99
+ and vioOutput is None ): continue
88
100
89
101
if startTime is None :
90
102
startTime = time
91
103
if args .zero :
92
104
timeOffset = startTime
93
105
94
-
95
106
if (args .skip is not None and time - startTime < args .skip ) or (args .max is not None and time - startTime > args .max ):
96
107
nSkipped += 1
97
108
continue
@@ -105,8 +116,14 @@ def addMeasurement(type, t, v):
105
116
elif barometer is not None :
106
117
addMeasurement ("barometer" , t , barometer ["pressureHectopascals" ])
107
118
elif gnss is not None :
119
+ gnssData = data ["gnss" ]
120
+ if len (gnssData ["t" ]) > 0 :
121
+ diff = t - gnssData ["t" ][- 1 ]
122
+ gnssData ["td" ].append (diff )
123
+ gnssData ["t" ].append (t )
108
124
enu = gnssConverter .enu (gnss ["latitude" ], gnss ["longitude" ], gnss ["altitude" ])
109
- addMeasurement ("gnss" , t , [enu ["x" ], enu ["y" ], gnss ["altitude" ]])
125
+ gnssData ["position" ].append ([enu [c ] for c in "xyz" ])
126
+ gnssData ["altitude" ].append (gnss ["altitude" ])
110
127
elif frames is not None :
111
128
for f in frames :
112
129
if f .get ("missingBitmap" , False ): continue
@@ -125,14 +142,27 @@ def addMeasurement(type, t, v):
125
142
for process in metrics ['cpu' ].get ('processes' , []):
126
143
name = process .get ('name' )
127
144
if not name : continue
128
-
129
145
count = usedProcessNames .get (name , 0 )
130
146
usedProcessNames [name ] = count + 1
131
147
uniqueName = f"{ name } { count + 1 } " if count else name
132
-
133
148
processData = data ['cpu' ]["processes" ].setdefault (uniqueName , {"v" : [], "t" : []})
134
149
processData ['v' ].append (process ['usagePercent' ])
135
150
processData ['t' ].append (t )
151
+ elif vioOutput is not None :
152
+ vio = data ["vio" ]
153
+ if len (vio ["t" ]) > 0 :
154
+ diff = t - vio ["t" ][- 1 ]
155
+ vio ["td" ].append (diff )
156
+ vio ["t" ].append (t )
157
+ vio ["status" ].append (vioOutput ["status" ])
158
+ vio ["position" ].append ([vioOutput ["position" ][c ] for c in "xyz" ])
159
+ if "globalPose" in vioOutput :
160
+ globalPose = vioOutput ["globalPose" ]
161
+ wgs84 = vioOutput ["globalPose" ]["coordinates" ]
162
+ enu = gnssConverter .enu (wgs84 ["latitude" ], wgs84 ["longitude" ], wgs84 ["altitude" ])
163
+ vio ["global" ]["position" ].append ([enu [c ] for c in "xyz" ])
164
+ vio ["global" ]["velocity" ].append ([globalPose ["velocity" ][c ] for c in "xyz" ])
165
+ vio ["global" ]["altitude" ].append (wgs84 ["altitude" ])
136
166
137
167
if nSkipped > 0 : print (f'Skipped { nSkipped } lines' )
138
168
@@ -143,6 +173,7 @@ def addMeasurement(type, t, v):
143
173
diagnoseBarometer (data , output )
144
174
diagnoseGNSS (data , output )
145
175
diagnoseCPU (data , output )
176
+ diagnoseVIO (data , output )
146
177
147
178
if os .path .dirname (args .output_html ):
148
179
os .makedirs (os .path .dirname (args .output_html ), exist_ok = True )
0 commit comments