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

Method __init__

PythonAPI/examples/manual_control.py:283–297  ·  view source on GitHub ↗
(self, world, start_in_autopilot)

Source from the content-addressed store, hash-verified

281class KeyboardControl(object):
282 """Class that handles keyboard input."""
283 def __init__(self, world, start_in_autopilot):
284 self._autopilot_enabled = start_in_autopilot
285 if isinstance(world.player, carla.Vehicle):
286 self._control = carla.VehicleControl()
287 self._lights = carla.VehicleLightState.NONE
288 world.player.set_autopilot(self._autopilot_enabled)
289 world.player.set_light_state(self._lights)
290 elif isinstance(world.player, carla.Walker):
291 self._control = carla.WalkerControl()
292 self._autopilot_enabled = False
293 self._rotation = world.player.get_transform().rotation
294 else:
295 raise NotImplementedError("Actor type not supported")
296 self._steer_cache = 0.0
297 world.hud.notification("Press 'H' or '?' for help.", seconds=4.0)
298
299 def parse_events(self, client, world, clock):
300 if isinstance(self._control, carla.VehicleControl):

Callers

nothing calls this directly

Calls 3

VehicleControlMethod · 0.80
WalkerControlMethod · 0.80
notificationMethod · 0.45

Tested by

no test coverage detected