@@ -114,8 +114,14 @@ def __init__(self, filename, laser=False, verbose=False):
114
114
115
115
# indices into ROBOTLASER1 record for the 3x3 info matrix in column major
116
116
# order
117
+ # IXX IXY IXT IYY IYT ITT
118
+ # 6 7 8 9 10 11
119
+ # 0 1 2 3 4 5
117
120
g2o = [0 , 1 , 2 , 1 , 3 , 4 , 2 , 4 , 5 ]
118
- toro = [0 , 1 , 4 , 1 , 2 , 5 , 4 , 5 , 3 ]
121
+ # IXX IXY IYY ITT IXT IYT
122
+ # 6 7 8 9 10 11
123
+ # 0 1 2 3 4 5
124
+ toro = [0 , 1 , 4 , 1 , 2 , 5 , 4 , 5 , 3 ]
119
125
120
126
# we keep an array self. = vindex(gi) to map g2o vertex index to PGraph vertex index
121
127
@@ -192,7 +198,7 @@ def __init__(self, filename, laser=False, verbose=False):
192
198
# IXX IXY IYY ITT IXT IYT
193
199
# 6 7 8 9 10 11
194
200
d = np .array ([float (x ) for x in tokens [6 :12 ]])
195
- info = d [g2o ].reshape ((3 ,3 ))
201
+ info = d [toro ].reshape ((3 ,3 ))
196
202
197
203
# create the edge
198
204
v1 = self .graph [v1 ]
@@ -239,7 +245,7 @@ def __init__(self, filename, laser=False, verbose=False):
239
245
filetype = "TORO/LAGO"
240
246
else :
241
247
filetype = "g2o"
242
- print (f"loaded { filetype } format file: { self .graph .n } nodes , { self .graph .ne } edges" )
248
+ print (f"loaded { filetype } format file: { self .graph .n } vertices , { self .graph .ne } edges" )
243
249
244
250
if nlaser > 0 :
245
251
lasermeta = [float (x ) for x in lasermeta ]
@@ -280,7 +286,11 @@ def time(self, i):
280
286
return self .vindex [i ].time
281
287
282
288
def plot (self , ** kwargs ):
283
- self .graph .plot (** kwargs )
289
+ if not 'vertex' in kwargs :
290
+ kwargs ['vertex' ] = dict (markersize = 8 , markerfacecolor = 'blue' , markeredgecolor = 'None' )
291
+ if not 'edge' in kwargs :
292
+ kwargs ['edge' ] = dict (linewidth = 1 , color = 'black' )
293
+ self .graph .plot (colorcomponents = False , ** kwargs )
284
294
plt .xlabel ('x' )
285
295
plt .ylabel ('y' )
286
296
plt .grid (True )
0 commit comments