Beispiel #1
0
 def draw_on_world(self, world):
     from carla import Color
     for marking in self.left_markings:
         world.debug.draw_point(marking.as_simulator_location(),
                                size=0.1,
                                color=Color(255, 255, 0))
     for marking in self.right_markings:
         world.debug.draw_point(marking.as_simulator_location(),
                                size=0.1,
                                color=Color(255, 255, 0))
 def _draw_trigger_volume(self, world, tl_actor):
     transform = tl_actor.get_transform()
     tv = transform.transform(tl_actor.trigger_volume.location)
     bbox = BoundingBox(tv, tl_actor.trigger_volume.extent)
     tl_state = tl_actor.get_state()
     if tl_state in TL_STATE_TO_PIXEL_COLOR:
         r, g, b = TL_STATE_TO_PIXEL_COLOR[tl_state]
         bbox_color = Color(r, g, b)
     else:
         bbox_color = Color(0, 0, 0)
     bbox_life_time = \
         (1 / self._flags.simulator_fps + TL_BBOX_LIFETIME_BUFFER)
     world.debug.draw_box(bbox,
                          transform.rotation,
                          thickness=0.5,
                          color=bbox_color,
                          life_time=bbox_life_time)