MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / __init__

Method __init__

PythonAPI/examples/manual_control.py:720–730  ·  view source on GitHub ↗
(self, parent_actor, hud)

Source from the content-addressed store, hash-verified

718
719class LaneInvasionSensor(object):
720 def __init__(self, parent_actor, hud):
721 self.sensor = None
722 self._parent = parent_actor
723 self.hud = hud
724 world = self._parent.get_world()
725 bp = world.get_blueprint_library().find('sensor.other.lane_invasion')
726 self.sensor = world.spawn_actor(bp, carla.Transform(), attach_to=self._parent)
727 # We need to pass the lambda a weak reference to self to avoid circular
728 # reference.
729 weak_self = weakref.ref(self)
730 self.sensor.listen(lambda event: LaneInvasionSensor._on_invasion(weak_self, event))
731
732 @staticmethod
733 def _on_invasion(weak_self, event):

Callers

nothing calls this directly

Calls 3

spawn_actorMethod · 0.45
TransformMethod · 0.45
_on_invasionMethod · 0.45

Tested by

no test coverage detected