@@ -165,11 +165,12 @@ def callback(self, msg):
165165 marker_list = []
166166 # add current active obstacles
167167 for obs in filtered_obstacle_list :
168- (r , g , b ) = colorsys .hsv_to_rgb (obs .msg .uuid .int % 360 / 360. , 1. , 1. ) # encode id with rgb color
168+ obstacle_uuid = uuid .UUID (bytes = bytes (obs .msg .uuid .uuid ))
169+ (r , g , b ) = colorsys .hsv_to_rgb (obstacle_uuid .int % 360 / 360. , 1. , 1. ) # encode id with rgb color
169170 # make a cube
170171 marker = Marker ()
171172 marker .header = msg .header
172- marker .ns = str (obs . msg . uuid )
173+ marker .ns = str (obstacle_uuid )
173174 marker .id = 0
174175 marker .type = 1 # CUBE
175176 marker .action = 0
@@ -186,7 +187,7 @@ def callback(self, msg):
186187 # make an arrow
187188 arrow = Marker ()
188189 arrow .header = msg .header
189- arrow .ns = str (obs . msg . uuid )
190+ arrow .ns = str (obstacle_uuid )
190191 arrow .id = 1
191192 arrow .type = 0
192193 arrow .action = 0
@@ -202,15 +203,15 @@ def callback(self, msg):
202203 arrow .scale .z = 0.05
203204 marker_list .append (arrow )
204205 # add dead obstacles to delete in rviz
205- for idx in dead_object_list :
206+ for uuid in dead_object_list :
206207 marker = Marker ()
207208 marker .header = msg .header
208- marker .ns = str (idx )
209+ marker .ns = str (uuid )
209210 marker .id = 0
210211 marker .action = 2 # delete
211212 arrow = Marker ()
212213 arrow .header = msg .header
213- arrow .ns = str (idx )
214+ arrow .ns = str (uuid )
214215 arrow .id = 1
215216 arrow .action = 2
216217 marker_list .append (marker )
@@ -239,7 +240,8 @@ def death(self, obj_ind, num_of_obstacle):
239240 if self .obstacle_list [obs ].dying < self .death_threshold :
240241 new_object_list .append (self .obstacle_list [obs ])
241242 else :
242- dead_object_list .append (self .obstacle_list [obs ].msg .uuid )
243+ obstacle_uuid = uuid .UUID (bytes = bytes (self .obstacle_list [obs ].msg .uuid .uuid ))
244+ dead_object_list .append (obstacle_uuid )
243245
244246 # add newly born obstacles
245247 for obs in range (num_of_obstacle , len (self .obstacle_list )):
0 commit comments