parameters: (self, parent_actor, hud)
docstring: Constructor method
docstring_summary: Constructor method
docstring_tokens: Constructor method
function: def __init__(self, parent_actor, hud):
          """Constructor method"""
          self.sensor = None
          self.history = []
          self._parent = parent_actor
          self.hud = hud
          world = self._parent.get_world()
          blueprint = world.get_blueprint_library().find('sensor.other.collision')
          self.sensor = world.spawn_actor(blueprint, carla.Transform(), attach_to=self._parent)
          # We need to pass the lambda a weak reference to
          # self to avoid circular reference.
          weak_self = weakref.ref(self)
          self.sensor.listen(lambda event: CollisionSensor._on_collision(weak_self, event))
function_tokens: def __init__ ( self , parent_actor , hud ) : self . sensor = None self . history = [ ] self . _parent = parent_actor self . hud = hud world = self . _parent . get_world ( ) blueprint = world . get_blueprint_library ( ) . find ( 'sensor.other.collision' ) self . sensor = world . spawn_actor ( blueprint , carla . Transform ( ) , attach_to = self . _parent ) # We need to pass the lambda a weak reference to # self to avoid circular reference. weak_self = weakref . ref ( self ) self . sensor . listen ( lambda event : CollisionSensor . _on_collision ( weak_self , event ) )