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

Method __init__

PythonAPI/examples/manual_control_rss.py:245–261  ·  view source on GitHub ↗
(self, world, args)

Source from the content-addressed store, hash-verified

243
244class KeyboardControl(object):
245 def __init__(self, world, args):
246 self._autopilot_enabled = args.autopilot
247 self._world = world
248 self._restrictor = None
249 self._restrictorEnabled = True
250 if isinstance(world.player, carla.Vehicle):
251 self._control = carla.VehicleControl()
252 world.player.set_autopilot(self._autopilot_enabled)
253 self._restrictor = carla.RssRestrictor()
254 elif isinstance(world.player, carla.Walker):
255 self._control = carla.WalkerControl()
256 self._autopilot_enabled = False
257 self._rotation = world.player.get_transform().rotation
258 else:
259 raise NotImplementedError("Actor type not supported")
260 self._steer_cache = 0.0
261 world.hud.notification("Press 'H' or '?' for help.", seconds=4.0)
262
263 def parse_events(self, client, world, clock):
264 for event in pygame.event.get():

Callers

nothing calls this directly

Calls 4

VehicleControlMethod · 0.80
RssRestrictorMethod · 0.80
WalkerControlMethod · 0.80
notificationMethod · 0.45

Tested by

no test coverage detected