From 564b7b940859bb70b58a6b450fd3bd6e7020d39a Mon Sep 17 00:00:00 2001 From: sergi-e Date: Fri, 17 Apr 2020 18:14:51 +0200 Subject: [PATCH] First iteration with getters, setters and previous APIs --- Docs/APIs/python_api_090.md | 125 ++ Docs/APIs/python_api_091.md | 309 +++++ Docs/APIs/python_api_092.md | 311 +++++ Docs/APIs/python_api_093.md | 341 +++++ Docs/APIs/python_api_094.md | 448 +++++++ Docs/APIs/python_api_095.md | 543 ++++++++ Docs/APIs/python_api_096.md | 2263 ++++++++++++++++++++++++++++++++++ Docs/APIs/python_api_097.md | 1913 ++++++++++++++++++++++++++++ Docs/APIs/python_api_098.md | 2326 +++++++++++++++++++++++++++++++++++ Docs/python_api.md | 287 +++-- PythonAPI/docs/doc_gen.py | 110 +- 11 files changed, 8863 insertions(+), 113 deletions(-) create mode 100644 Docs/APIs/python_api_090.md create mode 100644 Docs/APIs/python_api_091.md create mode 100644 Docs/APIs/python_api_092.md create mode 100644 Docs/APIs/python_api_093.md create mode 100644 Docs/APIs/python_api_094.md create mode 100644 Docs/APIs/python_api_095.md create mode 100644 Docs/APIs/python_api_096.md create mode 100644 Docs/APIs/python_api_097.md create mode 100644 Docs/APIs/python_api_098.md diff --git a/Docs/APIs/python_api_090.md b/Docs/APIs/python_api_090.md new file mode 100644 index 000000000..89859d617 --- /dev/null +++ b/Docs/APIs/python_api_090.md @@ -0,0 +1,125 @@ +# Python API reference (0.9.0) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.0__. + +
+

+ +Back to latest +

+
+ +!!! important + Versions prior to 0.9.0 have a very different API. For the documentation of the stable version please switch to the [stable branch](https://carla.readthedocs.io/en/stable/). + +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(milliseconds)` +- `get_client_version()` +- `get_server_version()` +- `ping()` +- `get_world()` + +## `carla.World` + +- `get_blueprint_library()` +- `get_spectator()` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `contains_tag(tag)` +- `match_tags(wildcard_pattern)` +- `contains_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` + +## `carla.ActorAttribute` + +- `is_modifiable` +- `type` +- `recommended_values` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__()` +- `__ne__()` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `get_world()` +- `get_location()` +- `get_transform()` +- `set_location(location)` +- `set_transform(transform)` +- `destroy()` + +## `carla.Vehicle(carla.Actor)` + +- `apply_control(vehicle_control)` +- `set_autopilot(enabled=True)` + +## `carla.Sensor(carla.Actor)` + +- `listen(callback_function)` + +## `carla.Image` + +- `frame_number` +- `width` +- `height` +- `type` +- `fov` +- `raw_data` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` + +## `carla.Location` + +- `x` +- `y` +- `z` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` + +## `carla.Transform` + +- `location` +- `rotation` + +## `carla.Color` + +- `r` +- `g` +- `b` diff --git a/Docs/APIs/python_api_091.md b/Docs/APIs/python_api_091.md new file mode 100644 index 000000000..072ba07e9 --- /dev/null +++ b/Docs/APIs/python_api_091.md @@ -0,0 +1,309 @@ +# Python API reference (0.9.1) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.1__. + +
+

+ +Back to latest +

+
+ +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(float_seconds)` +- `get_client_version()` +- `get_server_version()` +- `get_world()` + +## `carla.World` + +- `id` +- `map_name` +- `debug` +- `get_blueprint_library()` +- `get_map()` +- `get_spectator()` +- `get_weather()` +- `set_weather(weather_parameters)` +- `get_actors()` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` +- `wait_for_tick(seconds=1.0)` +- `on_tick(callback)` + +## `carla.DebugHelper` + +- `draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `has_tag(tag)` +- `match_tags(wildcard_pattern)` +- `has_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` +- `__len__()` +- `__iter__()` + +## `carla.ActorAttribute` + +- `id` +- `type` +- `recommended_values` +- `is_modifiable` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__(other)` +- `__ne__(other)` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.ActorList` + +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `parent` +- `semantic_tags` +- `is_alive` +- `get_world()` +- `get_location()` +- `get_transform()` +- `get_velocity()` +- `get_acceleration()` +- `set_location(location)` +- `set_transform(transform)` +- `set_simulate_physics(enabled=True)` +- `destroy()` + +## `carla.Vehicle(carla.Actor)` + +- `bounding_box` +- `apply_control(vehicle_control)` +- `get_vehicle_control()` +- `set_autopilot(enabled=True)` + +## `carla.TrafficLight(carla.Actor)` + +- `state` + +## `carla.Sensor(carla.Actor)` + +- `is_listening` +- `listen(callback_function)` +- `stop()` + +## `carla.SensorData` + +- `frame_number` +- `transform` + +## `carla.Image(carla.SensorData)` + +- `width` +- `height` +- `fov` +- `raw_data` +- `convert(color_converter)` +- `save_to_disk(path, color_converter=None)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, color)` + +## `carla.LidarMeasurement(carla.SensorData)` + +- `horizontal_angle` +- `channels` +- `raw_data` +- `get_point_count(channel)` +- `save_to_disk(path)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, location)` + +## `carla.CollisionEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `normal_impulse` + +## `carla.LaneInvasionEvent(carla.SensorData)` + +- `actor` +- `crossed_lane_markings` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Map` + +- `name` +- `get_spawn_points()` +- `get_waypoint(location, project_to_road=True)` +- `get_topology()` +- `generate_waypoints(distance)` +- `to_opendrive()` +- `save_to_disk(path=self.name)` + +## `carla.Waypoint` + +- `transform` +- `is_intersection` +- `lane_width` +- `road_id` +- `lane_id` +- `next(distance)` + +## `carla.WeatherParameters` + +- `cloudyness` +- `precipitation` +- `precipitation_deposits` +- `wind_intensity` +- `sun_azimuth_angle` +- `sun_altitude_angle` +- `__eq__(other)` +- `__ne__(other)` + +Static presets + +- `carla.WeatherParameters.ClearNoon` +- `carla.WeatherParameters.CloudyNoon` +- `carla.WeatherParameters.WetNoon` +- `carla.WeatherParameters.WetCloudyNoon` +- `carla.WeatherParameters.MidRainyNoon` +- `carla.WeatherParameters.HardRainNoon` +- `carla.WeatherParameters.SoftRainNoon` +- `carla.WeatherParameters.ClearSunset` +- `carla.WeatherParameters.CloudySunset` +- `carla.WeatherParameters.WetSunset` +- `carla.WeatherParameters.WetCloudySunset` +- `carla.WeatherParameters.MidRainSunset` +- `carla.WeatherParameters.HardRainSunset` +- `carla.WeatherParameters.SoftRainSunset` + +## `carla.Vector3D` + +- `x` +- `y` +- `z` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Location` + +- `x` +- `y` +- `z` +- `distance(other)` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Transform` + +- `location` +- `rotation` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.BoundingBox` + +- `location` +- `extent` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Timestamp` + +- `frame_count` +- `elapsed_seconds` +- `delta_seconds` +- `platform_timestamp` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Color` + +- `r` +- `g` +- `b` +- `a` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.ColorConverter` + +- `Raw` +- `Depth` +- `LogarithmicDepth` +- `CityScapesPalette` + +## `carla.ActorAttributeType` + +- `Bool` +- `Int` +- `Float` +- `RGBColor` + +## `carla.TrafficLightState` + +- `Off` +- `Red` +- `Yellow` +- `Green` +- `Unknown` + +## `carla.LaneMarking` + +- `Other` +- `Broken` +- `Solid` diff --git a/Docs/APIs/python_api_092.md b/Docs/APIs/python_api_092.md new file mode 100644 index 000000000..478e63aaa --- /dev/null +++ b/Docs/APIs/python_api_092.md @@ -0,0 +1,311 @@ +# Python API reference (0.9.2) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.2__. + +
+

+ +Back to latest +

+
+ +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(float_seconds)` +- `get_client_version()` +- `get_server_version()` +- `get_world()` + +## `carla.World` + +- `id` +- `map_name` +- `debug` +- `get_blueprint_library()` +- `get_map()` +- `get_spectator()` +- `get_weather()` +- `set_weather(weather_parameters)` +- `get_actors()` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` +- `wait_for_tick(seconds=1.0)` +- `on_tick(callback)` + +## `carla.DebugHelper` + +- `draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `has_tag(tag)` +- `match_tags(wildcard_pattern)` +- `has_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` +- `__len__()` +- `__iter__()` + +## `carla.ActorAttribute` + +- `id` +- `type` +- `recommended_values` +- `is_modifiable` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__(other)` +- `__ne__(other)` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.ActorList` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `parent` +- `semantic_tags` +- `is_alive` +- `attributes` +- `get_world()` +- `get_location()` +- `get_transform()` +- `get_velocity()` +- `get_acceleration()` +- `set_location(location)` +- `set_transform(transform)` +- `set_simulate_physics(enabled=True)` +- `destroy()` + +## `carla.Vehicle(carla.Actor)` + +- `bounding_box` +- `apply_control(vehicle_control)` +- `get_vehicle_control()` +- `set_autopilot(enabled=True)` + +## `carla.TrafficLight(carla.Actor)` + +- `state` + +## `carla.Sensor(carla.Actor)` + +- `is_listening` +- `listen(callback_function)` +- `stop()` + +## `carla.SensorData` + +- `frame_number` +- `transform` + +## `carla.Image(carla.SensorData)` + +- `width` +- `height` +- `fov` +- `raw_data` +- `convert(color_converter)` +- `save_to_disk(path, color_converter=None)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, color)` + +## `carla.LidarMeasurement(carla.SensorData)` + +- `horizontal_angle` +- `channels` +- `raw_data` +- `get_point_count(channel)` +- `save_to_disk(path)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, location)` + +## `carla.CollisionEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `normal_impulse` + +## `carla.LaneInvasionEvent(carla.SensorData)` + +- `actor` +- `crossed_lane_markings` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Map` + +- `name` +- `get_spawn_points()` +- `get_waypoint(location, project_to_road=True)` +- `get_topology()` +- `generate_waypoints(distance)` +- `to_opendrive()` +- `save_to_disk(path=self.name)` + +## `carla.Waypoint` + +- `transform` +- `is_intersection` +- `lane_width` +- `road_id` +- `lane_id` +- `next(distance)` + +## `carla.WeatherParameters` + +- `cloudyness` +- `precipitation` +- `precipitation_deposits` +- `wind_intensity` +- `sun_azimuth_angle` +- `sun_altitude_angle` +- `__eq__(other)` +- `__ne__(other)` + +Static presets + +- `carla.WeatherParameters.ClearNoon` +- `carla.WeatherParameters.CloudyNoon` +- `carla.WeatherParameters.WetNoon` +- `carla.WeatherParameters.WetCloudyNoon` +- `carla.WeatherParameters.MidRainyNoon` +- `carla.WeatherParameters.HardRainNoon` +- `carla.WeatherParameters.SoftRainNoon` +- `carla.WeatherParameters.ClearSunset` +- `carla.WeatherParameters.CloudySunset` +- `carla.WeatherParameters.WetSunset` +- `carla.WeatherParameters.WetCloudySunset` +- `carla.WeatherParameters.MidRainSunset` +- `carla.WeatherParameters.HardRainSunset` +- `carla.WeatherParameters.SoftRainSunset` + +## `carla.Vector3D` + +- `x` +- `y` +- `z` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Location` + +- `x` +- `y` +- `z` +- `distance(other)` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Transform` + +- `location` +- `rotation` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.BoundingBox` + +- `location` +- `extent` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Timestamp` + +- `frame_count` +- `elapsed_seconds` +- `delta_seconds` +- `platform_timestamp` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Color` + +- `r` +- `g` +- `b` +- `a` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.ColorConverter` + +- `Raw` +- `Depth` +- `LogarithmicDepth` +- `CityScapesPalette` + +## `carla.ActorAttributeType` + +- `Bool` +- `Int` +- `Float` +- `RGBColor` + +## `carla.TrafficLightState` + +- `Off` +- `Red` +- `Yellow` +- `Green` +- `Unknown` + +## `carla.LaneMarking` + +- `Other` +- `Broken` +- `Solid` diff --git a/Docs/APIs/python_api_093.md b/Docs/APIs/python_api_093.md new file mode 100644 index 000000000..a9709e287 --- /dev/null +++ b/Docs/APIs/python_api_093.md @@ -0,0 +1,341 @@ +# Python API reference (0.9.3) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.3__. + +
+

+ +Back to latest +

+
+ +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(float_seconds)` +- `get_client_version()` +- `get_server_version()` +- `get_world()` + +## `carla.World` + +- `id` +- `map_name` +- `debug` +- `get_blueprint_library()` +- `get_map()` +- `get_spectator()` +- `get_weather()` +- `set_weather(weather_parameters)` +- `get_actors()` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` +- `wait_for_tick(seconds=1.0)` +- `on_tick(callback)` + +## `carla.DebugHelper` + +- `draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `has_tag(tag)` +- `match_tags(wildcard_pattern)` +- `has_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` +- `__len__()` +- `__iter__()` + +## `carla.ActorAttribute` + +- `id` +- `type` +- `recommended_values` +- `is_modifiable` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__(other)` +- `__ne__(other)` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.ActorList` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `parent` +- `semantic_tags` +- `is_alive` +- `attributes` +- `get_world()` +- `get_location()` +- `get_transform()` +- `get_velocity()` +- `get_acceleration()` +- `set_location(location)` +- `set_transform(transform)` +- `set_simulate_physics(enabled=True)` +- `destroy()` + +## `carla.Vehicle(carla.Actor)` + +- `bounding_box` +- `apply_control(vehicle_control)` +- `get_control()` +- `set_autopilot(enabled=True)` +- `get_speed_limit()` +- `get_traffic_light_state()` +- `is_at_traffic_light()` +- `get_traffic_light()` + +## `carla.TrafficLight(carla.Actor)` + +- `state` +- `set_state(traffic_light_state)` +- `get_state()` +- `set_green_time(green_time)` +- `get_green_time()` +- `set_yellow_time(yellow_time)` +- `get_yellow_time()` +- `set_red_time(red_time)` +- `get_red_time()` +- `get_elapsed_time()` +- `freeze(True)` +- `is_frozen()` + +## `carla.Sensor(carla.Actor)` + +- `is_listening` +- `listen(callback_function)` +- `stop()` + +## `carla.SensorData` + +- `frame_number` +- `transform` + +## `carla.Image(carla.SensorData)` + +- `width` +- `height` +- `fov` +- `raw_data` +- `convert(color_converter)` +- `save_to_disk(path, color_converter=None)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, color)` + +## `carla.LidarMeasurement(carla.SensorData)` + +- `horizontal_angle` +- `channels` +- `raw_data` +- `get_point_count(channel)` +- `save_to_disk(path)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, location)` + +## `carla.CollisionEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `normal_impulse` + +## `carla.LaneInvasionEvent(carla.SensorData)` + +- `actor` +- `crossed_lane_markings` + +## `carla.GnssEvent(carla.SensorData)` + +- `latitude` +- `longitude` +- `altitude` + +## `carla.ObstacleDetectionSensorEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `distance` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Map` + +- `name` +- `get_spawn_points()` +- `get_waypoint(location, project_to_road=True)` +- `get_topology()` +- `generate_waypoints(distance)` +- `to_opendrive()` +- `save_to_disk(path=self.name)` + +## `carla.Waypoint` + +- `transform` +- `is_intersection` +- `lane_width` +- `road_id` +- `lane_id` +- `next(distance)` + +## `carla.WeatherParameters` + +- `cloudyness` +- `precipitation` +- `precipitation_deposits` +- `wind_intensity` +- `sun_azimuth_angle` +- `sun_altitude_angle` +- `__eq__(other)` +- `__ne__(other)` + +Static presets + +- `carla.WeatherParameters.ClearNoon` +- `carla.WeatherParameters.CloudyNoon` +- `carla.WeatherParameters.WetNoon` +- `carla.WeatherParameters.WetCloudyNoon` +- `carla.WeatherParameters.MidRainyNoon` +- `carla.WeatherParameters.HardRainNoon` +- `carla.WeatherParameters.SoftRainNoon` +- `carla.WeatherParameters.ClearSunset` +- `carla.WeatherParameters.CloudySunset` +- `carla.WeatherParameters.WetSunset` +- `carla.WeatherParameters.WetCloudySunset` +- `carla.WeatherParameters.MidRainSunset` +- `carla.WeatherParameters.HardRainSunset` +- `carla.WeatherParameters.SoftRainSunset` + +## `carla.Vector3D` + +- `x` +- `y` +- `z` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Location` + +- `x` +- `y` +- `z` +- `distance(other)` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Transform` + +- `location` +- `rotation` +- `transform(geom_object)` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.BoundingBox` + +- `location` +- `extent` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Timestamp` + +- `frame_count` +- `elapsed_seconds` +- `delta_seconds` +- `platform_timestamp` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Color` + +- `r` +- `g` +- `b` +- `a` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.ColorConverter` + +- `Raw` +- `Depth` +- `LogarithmicDepth` +- `CityScapesPalette` + +## `carla.ActorAttributeType` + +- `Bool` +- `Int` +- `Float` +- `RGBColor` + +## `carla.TrafficLightState` + +- `Red` +- `Yellow` +- `Green` +- `Off` +- `Unknown` + +## `carla.LaneMarking` + +- `Other` +- `Broken` +- `Solid` diff --git a/Docs/APIs/python_api_094.md b/Docs/APIs/python_api_094.md new file mode 100644 index 000000000..46ff33f5b --- /dev/null +++ b/Docs/APIs/python_api_094.md @@ -0,0 +1,448 @@ +# Python API reference (0.9.4) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.4__. + +
+

+ +Back to latest +

+
+ +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(float_seconds)` +- `get_client_version()` +- `get_server_version()` +- `get_world()` +- `get_available_maps()` +- `reload_world()` +- `load_world(map_name)` +- `start_recorder(string filename)` +- `replay_file(string filename, float start, float duration, int camera_follow_id)` +- `show_recorder_file_info(string filename)` +- `show_recorder_collisions(string filename, char category1, char category2)` +- `show_recorder_actors_blocked(string filename, float min_time, float min_distance)` +- `apply_batch(commands, do_tick=False)` + +## `carla.World` + +- `id` +- `debug` +- `get_blueprint_library()` +- `get_map()` +- `get_spectator()` +- `get_settings()` +- `apply_settings(world_settings)` +- `get_weather()` +- `set_weather(weather_parameters)` +- `get_actors()` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` +- `wait_for_tick(seconds=1.0)` +- `on_tick(callback)` +- `tick()` + +## `carla.WorldSettings` + +- `synchronous_mode` +- `no_rendering_mode` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.DebugHelper` + +- `draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `has_tag(tag)` +- `match_tags(wildcard_pattern)` +- `has_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` +- `__len__()` +- `__iter__()` + +## `carla.ActorAttribute` + +- `id` +- `type` +- `recommended_values` +- `is_modifiable` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__(other)` +- `__ne__(other)` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.ActorList` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `parent` +- `semantic_tags` +- `is_alive` +- `attributes` +- `get_world()` +- `get_location()` +- `get_transform()` +- `get_velocity()` +- `get_acceleration()` +- `set_location(location)` +- `set_transform(transform)` +- `set_simulate_physics(enabled=True)` +- `destroy()` + +## `carla.Vehicle(carla.Actor)` + +- `bounding_box` +- `apply_control(vehicle_control)` +- `get_control()` +- `set_autopilot(enabled=True)` +- `get_physics_control()` +- `apply_physics_control(vehicle_physics_control)` +- `get_speed_limit()` +- `get_traffic_light_state()` +- `is_at_traffic_light()` +- `get_traffic_light()` + +## `carla.TrafficLight(carla.Actor)` + +- `state` +- `set_state(traffic_light_state)` +- `get_state()` +- `set_green_time(green_time)` +- `get_green_time()` +- `set_yellow_time(yellow_time)` +- `get_yellow_time()` +- `set_red_time(red_time)` +- `get_red_time()` +- `get_elapsed_time()` +- `freeze(True)` +- `is_frozen()` +- `get_pole_index()` +- `get_group_traffic_lights()` + +## `carla.Sensor(carla.Actor)` + +- `is_listening` +- `listen(callback_function)` +- `stop()` + +## `carla.SensorData` + +- `frame_number` +- `transform` + +## `carla.Image(carla.SensorData)` + +- `width` +- `height` +- `fov` +- `raw_data` +- `convert(color_converter)` +- `save_to_disk(path, color_converter=None)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, color)` + +## `carla.LidarMeasurement(carla.SensorData)` + +- `horizontal_angle` +- `channels` +- `raw_data` +- `get_point_count(channel)` +- `save_to_disk(path)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, location)` + +## `carla.CollisionEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `normal_impulse` + +## `carla.LaneInvasionEvent(carla.SensorData)` + +- `actor` +- `crossed_lane_markings` + +## `carla.GnssEvent(carla.SensorData)` + +- `latitude` +- `longitude` +- `altitude` + +## `carla.ObstacleDetectionSensorEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `distance` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` +- `__eq__(other)` +- `__ne__(other)` + + +## `carla.WheelsPhysicsControl` +- `tire_friction` +- `damping_rate` +- `steer_angle` +- `disable_steering` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.VehiclePhysicsControl` + +- `torque_curve` +- `max_rpm` +- `moi` +- `damping_rate_full_throttle` +- `damping_rate_zero_throttle_clutch_engaged` +- `damping_rate_zero_throttle_clutch_disengaged` +- `use_gear_autobox` +- `gear_switch_time` +- `clutch_strength` +- `mass` +- `drag_coefficient` +- `center_of_mass` +- `steering_curve` +- `wheels` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Map` + +- `name` +- `get_spawn_points()` +- `get_waypoint(location, project_to_road=True)` +- `get_topology()` +- `generate_waypoints(distance)` +- `to_opendrive()` +- `save_to_disk(path=self.name)` + +## `carla.Waypoint` + +- `transform` +- `is_intersection` +- `lane_width` +- `road_id` +- `lane_id` +- `lane_change` +- `lane_type` +- `next(distance)` +- `get_right_lane()` +- `get_left_lane()` + +## `carla.LaneChange` +- `None` +- `Right` +- `Left` +- `Both` + +## `carla.WeatherParameters` + +- `cloudyness` +- `precipitation` +- `precipitation_deposits` +- `wind_intensity` +- `sun_azimuth_angle` +- `sun_altitude_angle` +- `__eq__(other)` +- `__ne__(other)` + +Static presets + +- `carla.WeatherParameters.ClearNoon` +- `carla.WeatherParameters.CloudyNoon` +- `carla.WeatherParameters.WetNoon` +- `carla.WeatherParameters.WetCloudyNoon` +- `carla.WeatherParameters.MidRainyNoon` +- `carla.WeatherParameters.HardRainNoon` +- `carla.WeatherParameters.SoftRainNoon` +- `carla.WeatherParameters.ClearSunset` +- `carla.WeatherParameters.CloudySunset` +- `carla.WeatherParameters.WetSunset` +- `carla.WeatherParameters.WetCloudySunset` +- `carla.WeatherParameters.MidRainSunset` +- `carla.WeatherParameters.HardRainSunset` +- `carla.WeatherParameters.SoftRainSunset` + +## `carla.Vector3D` + +- `x` +- `y` +- `z` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Location` + +- `x` +- `y` +- `z` +- `distance(other)` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Transform` + +- `location` +- `rotation` +- `transform(geom_object)` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.BoundingBox` + +- `location` +- `extent` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Timestamp` + +- `frame_count` +- `elapsed_seconds` +- `delta_seconds` +- `platform_timestamp` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Color` + +- `r` +- `g` +- `b` +- `a` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.ColorConverter` + +- `Raw` +- `Depth` +- `LogarithmicDepth` +- `CityScapesPalette` + +## `carla.ActorAttributeType` + +- `Bool` +- `Int` +- `Float` +- `RGBColor` + +## `carla.TrafficLightState` + +- `Red` +- `Yellow` +- `Green` +- `Off` +- `Unknown` + +## `carla.LaneMarking` + +- `Other` +- `Broken` +- `Solid` + +# module `carla.command` + +## `carla.command.DestroyActor` + +- `actor_id` + +## `carla.command.ApplyVehicleControl` + +- `actor_id` +- `control` + +## `carla.command.ApplyWalkerControl` + +- `actor_id` +- `control` + +## `carla.command.ApplyTransform` + +- `actor_id` +- `transform` + +## `carla.command.ApplyVelocity` + +- `actor_id` +- `velocity` + +## `carla.command.ApplyAngularVelocity` + +- `actor_id` +- `angular_velocity` + + +## `carla.command.ApplyImpulse` + +- `actor_id` +- `impulse` + +## `carla.command.SetSimulatePhysics` + +- `actor_id` +- `enabled` + +## `carla.command.SetAutopilot` + +- `actor_id` +- `enabled` diff --git a/Docs/APIs/python_api_095.md b/Docs/APIs/python_api_095.md new file mode 100644 index 000000000..fd325af1f --- /dev/null +++ b/Docs/APIs/python_api_095.md @@ -0,0 +1,543 @@ +# Python API reference (0.9.5) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.5__. + +
+

+ +Back to latest +

+
+ +## `carla.Client` + +- `Client(host, port, worker_threads=0)` +- `set_timeout(float_seconds)` +- `get_client_version()` +- `get_server_version()` +- `get_world()` +- `get_available_maps()` +- `reload_world()` +- `load_world(map_name)` +- `start_recorder(string filename)` +- `replay_file(string filename, float start, float duration, int camera_follow_id)` +- `show_recorder_file_info(string filename)` +- `show_recorder_collisions(string filename, char category1, char category2)` +- `show_recorder_actors_blocked(string filename, float min_time, float min_distance)` +- `apply_batch(commands, do_tick=False)` +- `apply_batch_sync(commands, do_tick=False) -> list(carla.command.Response)` + +## `carla.World` + +- `id` +- `debug` +- `get_blueprint_library()` +- `get_map()` +- `get_spectator()` +- `get_settings()` +- `apply_settings(world_settings)` +- `get_weather()` +- `set_weather(weather_parameters)` +- `get_actors(actor_ids=None) -> carla.ActorList` +- `spawn_actor(blueprint, transform, attach_to=None)` +- `try_spawn_actor(blueprint, transform, attach_to=None)` +- `wait_for_tick(seconds=1.0)` +- `on_tick(callback)` +- `tick()` + +## `carla.WorldSettings` + +- `synchronous_mode` +- `no_rendering_mode` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.DebugHelper` + +- `draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)` +- `draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)` + +## `carla.BlueprintLibrary` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.ActorBlueprint` + +- `id` +- `tags` +- `has_tag(tag)` +- `match_tags(wildcard_pattern)` +- `has_attribute(key)` +- `get_attribute(key)` +- `set_attribute(key, value)` +- `__len__()` +- `__iter__()` + +## `carla.ActorAttribute` + +- `id` +- `type` +- `recommended_values` +- `is_modifiable` +- `as_bool()` +- `as_int()` +- `as_float()` +- `as_str()` +- `as_color()` +- `__eq__(other)` +- `__ne__(other)` +- `__nonzero__()` +- `__bool__()` +- `__int__()` +- `__float__()` +- `__str__()` + +## `carla.ActorList` + +- `find(id)` +- `filter(wildcard_pattern)` +- `__getitem__(pos)` +- `__len__()` +- `__iter__()` + +## `carla.Actor` + +- `id` +- `type_id` +- `parent` +- `semantic_tags` +- `is_alive` +- `attributes` +- `get_world()` +- `get_location()` +- `get_transform()` +- `get_velocity()` +- `get_angular_velocity()` +- `get_acceleration()` +- `set_location(location)` +- `set_transform(transform)` +- `set_velocity(vector)` +- `set_angular_velocity(vector)` +- `add_impulse(vector)` +- `set_simulate_physics(enabled=True)` +- `destroy()` +- `__str__()` + +## `carla.Vehicle(carla.Actor)` + +- `bounding_box` +- `apply_control(vehicle_control)` +- `get_control()` +- `get_physics_control()` +- `apply_physics_control(vehicle_physics_control)` +- `set_autopilot(enabled=True)` +- `get_speed_limit()` +- `get_traffic_light_state()` +- `is_at_traffic_light()` +- `get_traffic_light()` + +## `carla.TrafficLight(carla.Actor)` + +- `state` +- `set_state(traffic_light_state)` +- `get_state()` +- `set_green_time(green_time)` +- `get_green_time()` +- `set_yellow_time(yellow_time)` +- `get_yellow_time()` +- `set_red_time(red_time)` +- `get_red_time()` +- `get_elapsed_time()` +- `freeze(True)` +- `is_frozen()` +- `get_pole_index()` +- `get_group_traffic_lights()` + +## `carla.Sensor(carla.Actor)` + +- `is_listening` +- `listen(callback_function)` +- `stop()` + +## `carla.SensorData` + +- `frame_number` +- `timestamp` +- `transform` + +## `carla.Image(carla.SensorData)` + +- `width` +- `height` +- `fov` +- `raw_data` +- `convert(color_converter)` +- `save_to_disk(path, color_converter=None)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, color)` + +## `carla.LidarMeasurement(carla.SensorData)` + +- `horizontal_angle` +- `channels` +- `raw_data` +- `get_point_count(channel)` +- `save_to_disk(path)` +- `__len__()` +- `__iter__()` +- `__getitem__(pos)` +- `__setitem__(pos, location)` + +## `carla.CollisionEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `normal_impulse` + +## `carla.LaneInvasionEvent(carla.SensorData)` + +- `actor` +- `crossed_lane_markings` + +## `carla.GnssEvent(carla.SensorData)` + +- `latitude` +- `longitude` +- `altitude` + +## `carla.ObstacleDetectionSensorEvent(carla.SensorData)` + +- `actor` +- `other_actor` +- `distance` + +## `carla.VehicleControl` + +- `throttle` +- `steer` +- `brake` +- `hand_brake` +- `reverse` +- `gear` +- `manual_gear_shift` +- `__eq__(other)` +- `__ne__(other)` + + +## `carla.WheelsPhysicsControl` + +- `tire_friction` +- `damping_rate` +- `steer_angle` +- `disable_steering` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.VehiclePhysicsControl` + +- `torque_curve` +- `max_rpm` +- `moi` +- `damping_rate_full_throttle` +- `damping_rate_zero_throttle_clutch_engaged` +- `damping_rate_zero_throttle_clutch_disengaged` +- `use_gear_autobox` +- `gear_switch_time` +- `clutch_strength` +- `mass` +- `drag_coefficient` +- `center_of_mass` +- `steering_curve` +- `wheels` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Map` + +- `name` +- `get_spawn_points()` +- `get_waypoint(location, project_to_road=True, lane_type=carla.LaneType.Driving)` +- `get_topology()` +- `generate_waypoints(distance)` +- `transform_to_geolocation(location)` +- `to_opendrive()` +- `save_to_disk(path=self.name)` + +## `carla.LaneType` + +- `NONE` +- `Driving` +- `Stop` +- `Shoulder` +- `Biking` +- `Sidewalk` +- `Border` +- `Restricted` +- `Parking` +- `Bidirectional` +- `Median` +- `Special1` +- `Special2` +- `Special3` +- `RoadWorks` +- `Tram` +- `Rail` +- `Entry` +- `Exit` +- `OffRamp` +- `OnRamp` +- `Any` + +## `carla.LaneChange` + +- `NONE` +- `Right` +- `Left` +- `Both` + +## `carla.LaneMarkingColor` + +- `Standard = White` +- `Blue` +- `Green` +- `Red` +- `White` +- `Yellow` +- `Other` + +## `carla.LaneMarkingType` + +- `NONE` +- `Other` +- `Broken` +- `Solid` +- `SolidSolid` +- `SolidBroken` +- `BrokenSolid` +- `BrokenBroken` +- `BottsDots` +- `Grass` +- `Curb` + +## `carla.LaneMarking` + +- `type -> carla.LaneMarking` +- `color -> carla.RoadMarkColor` +- `lane_change -> carla.LaneChange` +- `width` + +## `carla.Waypoint` + +- `id` +- `transform` +- `is_intersection` +- `lane_width` +- `road_id` +- `section_id` +- `lane_id` +- `s` +- `lane_change -> carla.LaneChange` +- `lane_type -> carla.LaneType` +- `right_lane_marking -> carla.LaneMarking` +- `left_lane_marking -> carla.LaneMarking` +- `next(distance) -> list(carla.Waypoint)` +- `get_right_lane() -> carla.Waypoint` +- `get_left_lane() -> carla.Waypoint` + +## `carla.WeatherParameters` + +- `cloudyness` +- `precipitation` +- `precipitation_deposits` +- `wind_intensity` +- `sun_azimuth_angle` +- `sun_altitude_angle` +- `__eq__(other)` +- `__ne__(other)` + +Static presets + +- `carla.WeatherParameters.ClearNoon` +- `carla.WeatherParameters.CloudyNoon` +- `carla.WeatherParameters.WetNoon` +- `carla.WeatherParameters.WetCloudyNoon` +- `carla.WeatherParameters.MidRainyNoon` +- `carla.WeatherParameters.HardRainNoon` +- `carla.WeatherParameters.SoftRainNoon` +- `carla.WeatherParameters.ClearSunset` +- `carla.WeatherParameters.CloudySunset` +- `carla.WeatherParameters.WetSunset` +- `carla.WeatherParameters.WetCloudySunset` +- `carla.WeatherParameters.MidRainSunset` +- `carla.WeatherParameters.HardRainSunset` +- `carla.WeatherParameters.SoftRainSunset` + +## `carla.Vector3D` + +- `x` +- `y` +- `z` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Location` + +- `x` +- `y` +- `z` +- `distance(other)` +- `__add__(other)` +- `__sub__(other)` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Rotation` + +- `pitch` +- `yaw` +- `roll` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Transform` + +- `location` +- `rotation` +- `transform(geom_object)` +- `get_forward_vector()` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.BoundingBox` + +- `location` +- `extent` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Timestamp` + +- `frame_count` +- `elapsed_seconds` +- `delta_seconds` +- `platform_timestamp` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.Color` + +- `r` +- `g` +- `b` +- `a` +- `__eq__(other)` +- `__ne__(other)` + +## `carla.ColorConverter` + +- `Raw` +- `Depth` +- `LogarithmicDepth` +- `CityScapesPalette` + +## `carla.ActorAttributeType` + +- `Bool` +- `Int` +- `Float` +- `RGBColor` + +## `carla.TrafficLightState` + +- `Red` +- `Yellow` +- `Green` +- `Off` +- `Unknown` + +## `carla.LaneMarking` + +- `Other` +- `Broken` +- `Solid` + +# module `carla.command` + +`carla.command.FutureActor` (not yet spawned actor handler) + +## `carla.command.Response` + +- `actor_id` +- `error` -> str|empty +- `has_error()` + +## `carla.command.SpawnActor` + +- `__init__(blueprint, transform, parent=None)` +- `then(command)` + +## `carla.command.DestroyActor` + +- `__init__(actor)` +- `actor_id` + +## `carla.command.ApplyVehicleControl` + +- `__init__(actor, control)` +- `actor_id` +- `control` + +## `carla.command.ApplyWalkerControl` + +- `__init__(actor, control)` +- `actor_id` +- `control` + +## `carla.command.ApplyTransform` + +- `__init__(actor, transform)` +- `actor_id` +- `transform` + +## `carla.command.ApplyVelocity` + +- `__init__(actor, velocity)` +- `actor_id` +- `velocity` + +## `carla.command.ApplyAngularVelocity` + +- `__init__(actor, angular_velocity)` +- `actor_id` +- `angular_velocity` + + +## `carla.command.ApplyImpulse` + +- `__init__(actor, impulse)` +- `actor_id` +- `impulse` + +## `carla.command.SetSimulatePhysics` + +- `__init__(actor, bool)` +- `actor_id` +- `enabled` + +## `carla.command.SetAutopilot` + +- `__init__(actor, bool)` +- `actor_id` +- `enabled` diff --git a/Docs/APIs/python_api_096.md b/Docs/APIs/python_api_096.md new file mode 100644 index 000000000..22a1a26bc --- /dev/null +++ b/Docs/APIs/python_api_096.md @@ -0,0 +1,2263 @@ +# Python API reference (0.9.6) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.6__. + +
+

+ +Back to latest +

+
+ +### Overview +- [**carla**](#carla) _Module_ + - [**ActorAttributeType**](#carla.ActorAttributeType) _Class_ + - [**Bool**](#carla.ActorAttributeType.Bool) _Instance variable_ + - [**Int**](#carla.ActorAttributeType.Int) _Instance variable_ + - [**Float**](#carla.ActorAttributeType.Float) _Instance variable_ + - [**String**](#carla.ActorAttributeType.String) _Instance variable_ + - [**RGBColor**](#carla.ActorAttributeType.RGBColor) _Instance variable_ + - [**ActorList**](#carla.ActorList) _Class_ + - [**find**(**self**, **actor_id**)](#carla.ActorList.find) _Method_ + - [**filter**(**self**, **wildcard_pattern**)](#carla.ActorList.filter) _Method_ + - [**\__getitem__**(**self**, **pos**)](#carla.ActorList.__getitem__) _Method_ + - [**\__len__**(**self**)](#carla.ActorList.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.ActorList.__iter__) _Method_ + - [**\__str__**(**self**)](#carla.ActorList.__str__) _Method_ + - [**AttachmentType**](#carla.AttachmentType) _Class_ + - [**Rigid**](#carla.AttachmentType.Rigid) _Instance variable_ + - [**SpringArm**](#carla.AttachmentType.SpringArm) _Instance variable_ + - [**BlueprintLibrary**](#carla.BlueprintLibrary) _Class_ + - [**find**(**self**)](#carla.BlueprintLibrary.find) _Method_ + - [**filter**(**self**, **wildcard_pattern**)](#carla.BlueprintLibrary.filter) _Method_ + - [**\__getitem__**(**self**, **pos**)](#carla.BlueprintLibrary.__getitem__) _Method_ + - [**\__len__**(**self**)](#carla.BlueprintLibrary.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.BlueprintLibrary.__iter__) _Method_ + - [**\__str__**(**self**)](#carla.BlueprintLibrary.__str__) _Method_ + - [**ColorConverter**](#carla.ColorConverter) _Class_ + - [**Raw**](#carla.ColorConverter.Raw) _Instance variable_ + - [**Depth**](#carla.ColorConverter.Depth) _Instance variable_ + - [**LogarithmicDepth**](#carla.ColorConverter.LogarithmicDepth) _Instance variable_ + - [**CityScapesPalette**](#carla.ColorConverter.CityScapesPalette) _Instance variable_ + - [**DebugHelper**](#carla.DebugHelper) _Class_ + - [**draw_point**(**self**, **location**, **size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True)](#carla.DebugHelper.draw_point) _Method_ + - [**draw_line**(**self**, **begin**, **end**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True)](#carla.DebugHelper.draw_line) _Method_ + - [**draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1f, **arrow_size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True)](#carla.DebugHelper.draw_arrow) _Method_ + - [**draw_box**(**self**, **box**, **rotation**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True)](#carla.DebugHelper.draw_box) _Method_ + - [**draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True)](#carla.DebugHelper.draw_string) _Method_ + - [**LaneChange**](#carla.LaneChange) _Class_ + - [**NONE**](#carla.LaneChange.NONE) _Instance variable_ + - [**Right**](#carla.LaneChange.Right) _Instance variable_ + - [**Left**](#carla.LaneChange.Left) _Instance variable_ + - [**Both**](#carla.LaneChange.Both) _Instance variable_ + - [**LaneMarking**](#carla.LaneMarking) _Class_ + - [**type**](#carla.LaneMarking.type) _Instance variable_ + - [**color**](#carla.LaneMarking.color) _Instance variable_ + - [**lane_change**](#carla.LaneMarking.lane_change) _Instance variable_ + - [**width**](#carla.LaneMarking.width) _Instance variable_ + - [**LaneMarkingColor**](#carla.LaneMarkingColor) _Class_ + - [**Standard**](#carla.LaneMarkingColor.Standard) _Instance variable_ + - [**Blue**](#carla.LaneMarkingColor.Blue) _Instance variable_ + - [**Green**](#carla.LaneMarkingColor.Green) _Instance variable_ + - [**Red**](#carla.LaneMarkingColor.Red) _Instance variable_ + - [**White**](#carla.LaneMarkingColor.White) _Instance variable_ + - [**Yellow**](#carla.LaneMarkingColor.Yellow) _Instance variable_ + - [**Other**](#carla.LaneMarkingColor.Other) _Instance variable_ + - [**LaneMarkingType**](#carla.LaneMarkingType) _Class_ + - [**NONE**](#carla.LaneMarkingType.NONE) _Instance variable_ + - [**Other**](#carla.LaneMarkingType.Other) _Instance variable_ + - [**Broken**](#carla.LaneMarkingType.Broken) _Instance variable_ + - [**Solid**](#carla.LaneMarkingType.Solid) _Instance variable_ + - [**SolidSolid**](#carla.LaneMarkingType.SolidSolid) _Instance variable_ + - [**SolidBroken**](#carla.LaneMarkingType.SolidBroken) _Instance variable_ + - [**BrokenSolid**](#carla.LaneMarkingType.BrokenSolid) _Instance variable_ + - [**BrokenBroken**](#carla.LaneMarkingType.BrokenBroken) _Instance variable_ + - [**BottsDots**](#carla.LaneMarkingType.BottsDots) _Instance variable_ + - [**Grass**](#carla.LaneMarkingType.Grass) _Instance variable_ + - [**Curb**](#carla.LaneMarkingType.Curb) _Instance variable_ + - [**LaneType**](#carla.LaneType) _Class_ + - [**NONE**](#carla.LaneType.NONE) _Instance variable_ + - [**Driving**](#carla.LaneType.Driving) _Instance variable_ + - [**Stop**](#carla.LaneType.Stop) _Instance variable_ + - [**Shoulder**](#carla.LaneType.Shoulder) _Instance variable_ + - [**Biking**](#carla.LaneType.Biking) _Instance variable_ + - [**Sidewalk**](#carla.LaneType.Sidewalk) _Instance variable_ + - [**Border**](#carla.LaneType.Border) _Instance variable_ + - [**Restricted**](#carla.LaneType.Restricted) _Instance variable_ + - [**Parking**](#carla.LaneType.Parking) _Instance variable_ + - [**Bidirectional**](#carla.LaneType.Bidirectional) _Instance variable_ + - [**Median**](#carla.LaneType.Median) _Instance variable_ + - [**Special1**](#carla.LaneType.Special1) _Instance variable_ + - [**Special2**](#carla.LaneType.Special2) _Instance variable_ + - [**Special3**](#carla.LaneType.Special3) _Instance variable_ + - [**RoadWorks**](#carla.LaneType.RoadWorks) _Instance variable_ + - [**Tram**](#carla.LaneType.Tram) _Instance variable_ + - [**Rail**](#carla.LaneType.Rail) _Instance variable_ + - [**Entry**](#carla.LaneType.Entry) _Instance variable_ + - [**Exit**](#carla.LaneType.Exit) _Instance variable_ + - [**OffRamp**](#carla.LaneType.OffRamp) _Instance variable_ + - [**OnRamp**](#carla.LaneType.OnRamp) _Instance variable_ + - [**Any**](#carla.LaneType.Any) _Instance variable_ + - [**SensorData**](#carla.SensorData) _Class_ + - [**frame**](#carla.SensorData.frame) _Instance variable_ + - [**timestamp**](#carla.SensorData.timestamp) _Instance variable_ + - [**transform**](#carla.SensorData.transform) _Instance variable_ + - [**TrafficLightState**](#carla.TrafficLightState) _Class_ + - [**Red**](#carla.TrafficLightState.Red) _Instance variable_ + - [**Yellow**](#carla.TrafficLightState.Yellow) _Instance variable_ + - [**Green**](#carla.TrafficLightState.Green) _Instance variable_ + - [**Off**](#carla.TrafficLightState.Off) _Instance variable_ + - [**Unknown**](#carla.TrafficLightState.Unknown) _Instance variable_ + - [**Actor**](#carla.Actor) _Class_ + - [**id**](#carla.Actor.id) _Instance variable_ + - [**type_id**](#carla.Actor.type_id) _Instance variable_ + - [**parent**](#carla.Actor.parent) _Instance variable_ + - [**semantic_tags**](#carla.Actor.semantic_tags) _Instance variable_ + - [**is_alive**](#carla.Actor.is_alive) _Instance variable_ + - [**attributes**](#carla.Actor.attributes) _Instance variable_ + - [**destroy**(**self**)](#carla.Actor.destroy) _Method_ + - [**get_world**(**self**)](#carla.Actor.get_world) _Method_ + - [**get_location**(**self**)](#carla.Actor.get_location) _Method_ + - [**get_velocity**(**self**)](#carla.Actor.get_velocity) _Method_ + - [**get_angular_velocity**(**self**)](#carla.Actor.get_angular_velocity) _Method_ + - [**get_acceleration**(**self**)](#carla.Actor.get_acceleration) _Method_ + - [**set_location**(**self**, **location**)](#carla.Actor.set_location) _Method_ + - [**set_transform**(**self**, **transform**)](#carla.Actor.set_transform) _Method_ + - [**set_velocity**(**self**, **velocity**)](#carla.Actor.set_velocity) _Method_ + - [**set_angular_velocity**(**self**, **angular_velocity**)](#carla.Actor.set_angular_velocity) _Method_ + - [**add_impulse**(**self**, **impulse**)](#carla.Actor.add_impulse) _Method_ + - [**set_simulate_physics**(**self**, **enabled**=True)](#carla.Actor.set_simulate_physics) _Method_ + - [**\__str__**(**self**)](#carla.Actor.__str__) _Method_ + - [**ActorAttribute**](#carla.ActorAttribute) _Class_ + - [**id**](#carla.ActorAttribute.id) _Instance variable_ + - [**type**](#carla.ActorAttribute.type) _Instance variable_ + - [**recommended_values**](#carla.ActorAttribute.recommended_values) _Instance variable_ + - [**is_modifiable**](#carla.ActorAttribute.is_modifiable) _Instance variable_ + - [**as_bool**(**self**)](#carla.ActorAttribute.as_bool) _Method_ + - [**as_int**(**self**)](#carla.ActorAttribute.as_int) _Method_ + - [**as_float**(**self**)](#carla.ActorAttribute.as_float) _Method_ + - [**as_str**(**self**)](#carla.ActorAttribute.as_str) _Method_ + - [**as_color**(**self**)](#carla.ActorAttribute.as_color) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.ActorAttribute.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.ActorAttribute.__ne__) _Method_ + - [**\__nonzero__**(**self**)](#carla.ActorAttribute.__nonzero__) _Method_ + - [**\__bool__**(**self**)](#carla.ActorAttribute.__bool__) _Method_ + - [**\__int__**(**self**)](#carla.ActorAttribute.__int__) _Method_ + - [**\__float__**(**self**)](#carla.ActorAttribute.__float__) _Method_ + - [**\__str__**(**self**)](#carla.ActorAttribute.__str__) _Method_ + - [**\__str__**(**self**)](#carla.ActorAttribute.__str__) _Method_ + - [**ActorBlueprint**](#carla.ActorBlueprint) _Class_ + - [**id**](#carla.ActorBlueprint.id) _Instance variable_ + - [**tags**](#carla.ActorBlueprint.tags) _Instance variable_ + - [**has_tag**(**self**, **tag**)](#carla.ActorBlueprint.has_tag) _Method_ + - [**match_tags**(**self**, **wildcard_pattern**)](#carla.ActorBlueprint.match_tags) _Method_ + - [**has_attribute**(**self**, **id**)](#carla.ActorBlueprint.has_attribute) _Method_ + - [**get_attribute**(**self**, **id**)](#carla.ActorBlueprint.get_attribute) _Method_ + - [**set_attribute**(**self**, **id**, **value**)](#carla.ActorBlueprint.set_attribute) _Method_ + - [**\__len__**(**self**)](#carla.ActorBlueprint.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.ActorBlueprint.__iter__) _Method_ + - [**\__str__**(**self**)](#carla.ActorBlueprint.__str__) _Method_ + - [**ActorSnapshot**](#carla.ActorSnapshot) _Class_ + - [**id**](#carla.ActorSnapshot.id) _Instance variable_ + - [**get_transform**(**self**)](#carla.ActorSnapshot.get_transform) _Method_ + - [**get_velocity**(**self**)](#carla.ActorSnapshot.get_velocity) _Method_ + - [**get_angular_velocity**(**self**)](#carla.ActorSnapshot.get_angular_velocity) _Method_ + - [**get_acceleration**(**self**)](#carla.ActorSnapshot.get_acceleration) _Method_ + - [**\__self__**(**self**)](#carla.ActorSnapshot.__self__) _Method_ + - [**BoundingBox**](#carla.BoundingBox) _Class_ + - [**location**](#carla.BoundingBox.location) _Instance variable_ + - [**extent**](#carla.BoundingBox.extent) _Instance variable_ + - [**\__init__**(**self**, **location**, **extent**)](#carla.BoundingBox.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.BoundingBox.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.BoundingBox.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.BoundingBox.__str__) _Method_ + - [**Client**](#carla.Client) _Class_ + - [**\__init__**(**self**, **host**, **port**, **worker_threads**=0)](#carla.Client.__init__) _Method_ + - [**set_timeout**(**self**, **seconds**)](#carla.Client.set_timeout) _Method_ + - [**get_client_version**(**self**)](#carla.Client.get_client_version) _Method_ + - [**get_server_version**(**self**)](#carla.Client.get_server_version) _Method_ + - [**get_world**(**self**)](#carla.Client.get_world) _Method_ + - [**get_available_maps**(**self**)](#carla.Client.get_available_maps) _Method_ + - [**reload_world**(**self**)](#carla.Client.reload_world) _Method_ + - [**load_world**(**self**, **map_name**)](#carla.Client.load_world) _Method_ + - [**start_recorder**(**self**, **filename**)](#carla.Client.start_recorder) _Method_ + - [**stop_recorder**(**self**)](#carla.Client.stop_recorder) _Method_ + - [**show_recorder_file_info**(**self**, **filename**, **show_all**)](#carla.Client.show_recorder_file_info) _Method_ + - [**show_recorder_collisions**(**self**, **filename**, **category1**, **category2**)](#carla.Client.show_recorder_collisions) _Method_ + - [**show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**)](#carla.Client.show_recorder_actors_blocked) _Method_ + - [**replay_file**(**self**, **name**, **start**, **duration**, **follow_id**)](#carla.Client.replay_file) _Method_ + - [**set_replayer_time_factor**(**self**, **time_factor**)](#carla.Client.set_replayer_time_factor) _Method_ + - [**apply_batch**(**self**, **commands**)](#carla.Client.apply_batch) _Method_ + - [**apply_batch_sync**(**self**, **commands**)](#carla.Client.apply_batch_sync) _Method_ + - [**CollisionEvent**](#carla.CollisionEvent) _Class_ + - [**actor**](#carla.CollisionEvent.actor) _Instance variable_ + - [**other_actor**](#carla.CollisionEvent.other_actor) _Instance variable_ + - [**normal_impulse**](#carla.CollisionEvent.normal_impulse) _Instance variable_ + - [**Color**](#carla.Color) _Class_ + - [**r**](#carla.Color.r) _Instance variable_ + - [**g**](#carla.Color.g) _Instance variable_ + - [**b**](#carla.Color.b) _Instance variable_ + - [**a**](#carla.Color.a) _Instance variable_ + - [**\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=255)](#carla.Color.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Color.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Color.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Color.__str__) _Method_ + - [**GearPhysicsControl**](#carla.GearPhysicsControl) _Class_ + - [**ratio**](#carla.GearPhysicsControl.ratio) _Instance variable_ + - [**down_ratio**](#carla.GearPhysicsControl.down_ratio) _Instance variable_ + - [**up_ratio**](#carla.GearPhysicsControl.up_ratio) _Instance variable_ + - [**\__init__**(**self**, **ratio**=1.0, **down_ratio**=0.5, **up_ratio**=0.65)](#carla.GearPhysicsControl.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.GearPhysicsControl.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.GearPhysicsControl.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.GearPhysicsControl.__str__) _Method_ + - [**GeoLocation**](#carla.GeoLocation) _Class_ + - [**latitude**](#carla.GeoLocation.latitude) _Instance variable_ + - [**longitude**](#carla.GeoLocation.longitude) _Instance variable_ + - [**altitude**](#carla.GeoLocation.altitude) _Instance variable_ + - [**\__init__**(**self**, **latitude**=0.0, **longitude**=0.0, **altitude**=0.0)](#carla.GeoLocation.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.GeoLocation.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.GeoLocation.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.GeoLocation.__str__) _Method_ + - [**Map**](#carla.Map) _Class_ + - [**name**](#carla.Map.name) _Instance variable_ + - [**\__init__**(**self**, **name**, **xodr_content**)](#carla.Map.__init__) _Method_ + - [**get_spawn_points**(**self**)](#carla.Map.get_spawn_points) _Method_ + - [**get_waypoint**(**self**, **location**, **project_to_road**=True, **lane_type**=carla.LaneType.Driving)](#carla.Map.get_waypoint) _Method_ + - [**get_topology**(**self**)](#carla.Map.get_topology) _Method_ + - [**generate_waypoints**(**self**, **distance**)](#carla.Map.generate_waypoints) _Method_ + - [**transform_to_geolocation**(**self**, **location**)](#carla.Map.transform_to_geolocation) _Method_ + - [**to_opendrive**(**self**)](#carla.Map.to_opendrive) _Method_ + - [**save_to_disk**(**self**, **path**)](#carla.Map.save_to_disk) _Method_ + - [**\__str__**(**self**)](#carla.Map.__str__) _Method_ + - [**Rotation**](#carla.Rotation) _Class_ + - [**pitch**](#carla.Rotation.pitch) _Instance variable_ + - [**yaw**](#carla.Rotation.yaw) _Instance variable_ + - [**roll**](#carla.Rotation.roll) _Instance variable_ + - [**\__init__**(**self**, **pitch**=0.0, **yaw**=0.0, **roll**=0.0)](#carla.Rotation.__init__) _Method_ + - [**get_forward_vector**(**self**)](#carla.Rotation.get_forward_vector) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Rotation.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Rotation.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Rotation.__str__) _Method_ + - [**Timestamp**](#carla.Timestamp) _Class_ + - [**frame**](#carla.Timestamp.frame) _Instance variable_ + - [**elapsed_seconds**](#carla.Timestamp.elapsed_seconds) _Instance variable_ + - [**delta_seconds**](#carla.Timestamp.delta_seconds) _Instance variable_ + - [**platform_timestamp**](#carla.Timestamp.platform_timestamp) _Instance variable_ + - [**\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**)](#carla.Timestamp.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Timestamp.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Timestamp.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Timestamp.__str__) _Method_ + - [**TrafficSign**](#carla.TrafficSign) _Class_ + - [**trigger_volume**](#carla.TrafficSign.trigger_volume) _Instance variable_ + - [**Transform**](#carla.Transform) _Class_ + - [**location**](#carla.Transform.location) _Instance variable_ + - [**rotation**](#carla.Transform.rotation) _Instance variable_ + - [**\__init__**(**self**, **location**, **rotation**)](#carla.Transform.__init__) _Method_ + - [**transform**(**self**, **in_point**)](#carla.Transform.transform) _Method_ + - [**get_forward_vector**(**self**)](#carla.Transform.get_forward_vector) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Transform.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Transform.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Transform.__str__) _Method_ + - [**Vector2D**](#carla.Vector2D) _Class_ + - [**x**](#carla.Vector2D.x) _Instance variable_ + - [**y**](#carla.Vector2D.y) _Instance variable_ + - [**\__init__**(**self**, **x**=0.0, **y**=0.0)](#carla.Vector2D.__init__) _Method_ + - [**\__add__**(**self**, **other**)](#carla.Vector2D.__add__) _Method_ + - [**\__mul__**(**self**, **other**)](#carla.Vector2D.__mul__) _Method_ + - [**\__sub__**(**self**, **other**)](#carla.Vector2D.__sub__) _Method_ + - [**\__truediv__**(**self**, **other**)](#carla.Vector2D.__truediv__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Vector2D.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Vector2D.__ne__) _Method_ + - [**\__self__**(**self**)](#carla.Vector2D.__self__) _Method_ + - [**Vector3D**](#carla.Vector3D) _Class_ + - [**x**](#carla.Vector3D.x) _Instance variable_ + - [**y**](#carla.Vector3D.y) _Instance variable_ + - [**z**](#carla.Vector3D.z) _Instance variable_ + - [**\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0)](#carla.Vector3D.__init__) _Method_ + - [**\__add__**(**self**, **other**)](#carla.Vector3D.__add__) _Method_ + - [**\__mul__**(**self**, **other**)](#carla.Vector3D.__mul__) _Method_ + - [**\__sub__**(**self**, **other**)](#carla.Vector3D.__sub__) _Method_ + - [**\__truediv__**(**self**, **other**)](#carla.Vector3D.__truediv__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Vector3D.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Vector3D.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Vector3D.__str__) _Method_ + - [**VehicleControl**](#carla.VehicleControl) _Class_ + - [**throttle**](#carla.VehicleControl.throttle) _Instance variable_ + - [**steer**](#carla.VehicleControl.steer) _Instance variable_ + - [**brake**](#carla.VehicleControl.brake) _Instance variable_ + - [**hand_brake**](#carla.VehicleControl.hand_brake) _Instance variable_ + - [**reverse**](#carla.VehicleControl.reverse) _Instance variable_ + - [**manual_gear_shift**](#carla.VehicleControl.manual_gear_shift) _Instance variable_ + - [**gear**](#carla.VehicleControl.gear) _Instance variable_ + - [**\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=True, **reverse**=True, **manual_gear_shift**=True, **gear**=0)](#carla.VehicleControl.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.VehicleControl.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.VehicleControl.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.VehicleControl.__str__) _Method_ + - [**VehiclePhysicsControl**](#carla.VehiclePhysicsControl) _Class_ + - [**torque_curve**](#carla.VehiclePhysicsControl.torque_curve) _Instance variable_ + - [**max_rpm**](#carla.VehiclePhysicsControl.max_rpm) _Instance variable_ + - [**moi**](#carla.VehiclePhysicsControl.moi) _Instance variable_ + - [**damping_rate_full_throttle**](#carla.VehiclePhysicsControl.damping_rate_full_throttle) _Instance variable_ + - [**damping_rate_zero_throttle_clutch_engaged**](#carla.VehiclePhysicsControl.damping_rate_zero_throttle_clutch_engaged) _Instance variable_ + - [**damping_rate_zero_throttle_clutch_disengaged**](#carla.VehiclePhysicsControl.damping_rate_zero_throttle_clutch_disengaged) _Instance variable_ + - [**use_gear_autobox**](#carla.VehiclePhysicsControl.use_gear_autobox) _Instance variable_ + - [**gear_switch_time**](#carla.VehiclePhysicsControl.gear_switch_time) _Instance variable_ + - [**clutch_strength**](#carla.VehiclePhysicsControl.clutch_strength) _Instance variable_ + - [**final_ratio**](#carla.VehiclePhysicsControl.final_ratio) _Instance variable_ + - [**forward_gears**](#carla.VehiclePhysicsControl.forward_gears) _Instance variable_ + - [**mass**](#carla.VehiclePhysicsControl.mass) _Instance variable_ + - [**drag_coefficient**](#carla.VehiclePhysicsControl.drag_coefficient) _Instance variable_ + - [**center_of_mass**](#carla.VehiclePhysicsControl.center_of_mass) _Instance variable_ + - [**steering_curve**](#carla.VehiclePhysicsControl.steering_curve) _Instance variable_ + - [**wheels**](#carla.VehiclePhysicsControl.wheels) _Instance variable_ + - [**\__init__**(**self**, **torque_curve**=[[0.0, 500.0], [5000.0, 500.0]], **max_rpm**=5000.0, **moi**=1.0, **damping_rate_full_throttle**=0.15, **damping_rate_zero_throttle_clutch_engaged**=2.0, **damping_rate_zero_throttle_clutch_disengaged**=0.35, **use_gear_autobox**=True, **gear_switch_time**=0.5, **clutch_strength**=10.0, **mass**=1000.0, **drag_coefficient**=0.3, **center_of_mass**=[0.0, 0.0, 0.0], **steering_curve**=[0.0, 0.0, 0.0], **wheels**=list())](#carla.VehiclePhysicsControl.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.VehiclePhysicsControl.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.VehiclePhysicsControl.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.VehiclePhysicsControl.__str__) _Method_ + - [**WalkerAIController**](#carla.WalkerAIController) _Class_ + - [**start**(**self**)](#carla.WalkerAIController.start) _Method_ + - [**stop**(**self**)](#carla.WalkerAIController.stop) _Method_ + - [**go_to_location**(**self**, **destination**)](#carla.WalkerAIController.go_to_location) _Method_ + - [**set_max_speed**(**self**, **speed**=1.4)](#carla.WalkerAIController.set_max_speed) _Method_ + - [**\__str__**(**self**)](#carla.WalkerAIController.__str__) _Method_ + - [**WalkerBoneControl**](#carla.WalkerBoneControl) _Class_ + - [**bone_transforms**](#carla.WalkerBoneControl.bone_transforms) _Instance variable_ + - [**\__init__**(**self**, **list(name,transform)**)](#carla.WalkerBoneControl.__init__) _Method_ + - [**\__str__**(**self**)](#carla.WalkerBoneControl.__str__) _Method_ + - [**WalkerControl**](#carla.WalkerControl) _Class_ + - [**direction**](#carla.WalkerControl.direction) _Instance variable_ + - [**speed**](#carla.WalkerControl.speed) _Instance variable_ + - [**jump**](#carla.WalkerControl.jump) _Instance variable_ + - [**\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False)](#carla.WalkerControl.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.WalkerControl.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.WalkerControl.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.WalkerControl.__str__) _Method_ + - [**Waypoint**](#carla.Waypoint) _Class_ + - [**id**](#carla.Waypoint.id) _Instance variable_ + - [**transform**](#carla.Waypoint.transform) _Instance variable_ + - [**is_intersection**](#carla.Waypoint.is_intersection) _Instance variable_ + - [**is_junction**](#carla.Waypoint.is_junction) _Instance variable_ + - [**lane_width**](#carla.Waypoint.lane_width) _Instance variable_ + - [**road_id**](#carla.Waypoint.road_id) _Instance variable_ + - [**section_id**](#carla.Waypoint.section_id) _Instance variable_ + - [**lane_id**](#carla.Waypoint.lane_id) _Instance variable_ + - [**s**](#carla.Waypoint.s) _Instance variable_ + - [**lane_change**](#carla.Waypoint.lane_change) _Instance variable_ + - [**lane_type**](#carla.Waypoint.lane_type) _Instance variable_ + - [**right_lane_marking**](#carla.Waypoint.right_lane_marking) _Instance variable_ + - [**left_lane_marking**](#carla.Waypoint.left_lane_marking) _Instance variable_ + - [**next**(**self**, **distance**)](#carla.Waypoint.next) _Method_ + - [**get_right_lane**(**self**)](#carla.Waypoint.get_right_lane) _Method_ + - [**get_left_lane**(**self**)](#carla.Waypoint.get_left_lane) _Method_ + - [**\__str__**(**self**)](#carla.Waypoint.__str__) _Method_ + - [**WeatherParameters**](#carla.WeatherParameters) _Class_ + - [**cloudiness**](#carla.WeatherParameters.cloudiness) _Instance variable_ + - [**precipitation**](#carla.WeatherParameters.precipitation) _Instance variable_ + - [**precipitation_deposits**](#carla.WeatherParameters.precipitation_deposits) _Instance variable_ + - [**wind_intensity**](#carla.WeatherParameters.wind_intensity) _Instance variable_ + - [**sun_azimuth_angle**](#carla.WeatherParameters.sun_azimuth_angle) _Instance variable_ + - [**sun_altitude_angle**](#carla.WeatherParameters.sun_altitude_angle) _Instance variable_ + - [**\__init__**(**self**, **cloudiness**=0.0, **precipitation**=0.0, **precipitation_deposits**=0.0, **wind_intensity**=0.0, **sun_azimuth_angle**=0.0, **sun_altitude_angle**=0.0)](#carla.WeatherParameters.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.WeatherParameters.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.WeatherParameters.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.WeatherParameters.__str__) _Method_ + - [**WheelPhysicsControl**](#carla.WheelPhysicsControl) _Class_ + - [**tire_friction**](#carla.WheelPhysicsControl.tire_friction) _Instance variable_ + - [**damping_rate**](#carla.WheelPhysicsControl.damping_rate) _Instance variable_ + - [**max_steer_angle**](#carla.WheelPhysicsControl.max_steer_angle) _Instance variable_ + - [**radius**](#carla.WheelPhysicsControl.radius) _Instance variable_ + - [**max_brake_torque**](#carla.WheelPhysicsControl.max_brake_torque) _Instance variable_ + - [**max_handbrake_torque**](#carla.WheelPhysicsControl.max_handbrake_torque) _Instance variable_ + - [**position**](#carla.WheelPhysicsControl.position) _Instance variable_ + - [**\__init__**(**self**, **tire_friction**=2.0, **damping_rate**=0.25, **max_steer_angle**=70.0, **radius**=30.0, **position**=(0.0,0.0,0.0))](#carla.WheelPhysicsControl.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.WheelPhysicsControl.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.WheelPhysicsControl.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.WheelPhysicsControl.__str__) _Method_ + - [**World**](#carla.World) _Class_ + - [**id**](#carla.World.id) _Instance variable_ + - [**debug**](#carla.World.debug) _Instance variable_ + - [**get_blueprint_library**(**self**)](#carla.World.get_blueprint_library) _Method_ + - [**get_map**(**self**)](#carla.World.get_map) _Method_ + - [**get_spectator**(**self**)](#carla.World.get_spectator) _Method_ + - [**get_settings**(**self**)](#carla.World.get_settings) _Method_ + - [**apply_settings**(**self**, **world_settings**)](#carla.World.apply_settings) _Method_ + - [**get_weather**(**self**)](#carla.World.get_weather) _Method_ + - [**set_weather**(**self**, **weather**)](#carla.World.set_weather) _Method_ + - [**get_snapshot**(**self**)](#carla.World.get_snapshot) _Method_ + - [**get_actor**(**self**, **actor_id**)](#carla.World.get_actor) _Method_ + - [**get_actors**(**self**)](#carla.World.get_actors) _Method_ + - [**spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)](#carla.World.spawn_actor) _Method_ + - [**try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)](#carla.World.try_spawn_actor) _Method_ + - [**wait_for_tick**(**self**, **seconds**=10.0)](#carla.World.wait_for_tick) _Method_ + - [**on_tick**(**self**, **callback**)](#carla.World.on_tick) _Method_ + - [**remove_on_tick**(**self**, **callback_id**)](#carla.World.remove_on_tick) _Method_ + - [**tick**(**self**)](#carla.World.tick) _Method_ + - [**\__str__**(**self**)](#carla.World.__str__) _Method_ + - [**WorldSettings**](#carla.WorldSettings) _Class_ + - [**synchronous_mode**](#carla.WorldSettings.synchronous_mode) _Instance variable_ + - [**no_rendering_mode**](#carla.WorldSettings.no_rendering_mode) _Instance variable_ + - [**fixed_delta_seconds**](#carla.WorldSettings.fixed_delta_seconds) _Instance variable_ + - [**\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0)](#carla.WorldSettings.__init__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.WorldSettings.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.WorldSettings.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.WorldSettings.__str__) _Method_ + - [**WorldSnapshot**](#carla.WorldSnapshot) _Class_ + - [**id**](#carla.WorldSnapshot.id) _Instance variable_ + - [**frame**](#carla.WorldSnapshot.frame) _Instance variable_ + - [**timestamp**](#carla.WorldSnapshot.timestamp) _Instance variable_ + - [**has_actor**(**self**, **actor_id**)](#carla.WorldSnapshot.has_actor) _Method_ + - [**find**(**self**, **actor_id**)](#carla.WorldSnapshot.find) _Method_ + - [**\__len__**(**self**)](#carla.WorldSnapshot.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.WorldSnapshot.__iter__) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.WorldSnapshot.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.WorldSnapshot.__ne__) _Method_ + - [**\__self__**(**self**)](#carla.WorldSnapshot.__self__) _Method_ + - [**GnssEvent**](#carla.GnssEvent) _Class_ + - [**latitude**](#carla.GnssEvent.latitude) _Instance variable_ + - [**longitude**](#carla.GnssEvent.longitude) _Instance variable_ + - [**altitude**](#carla.GnssEvent.altitude) _Instance variable_ + - [**\__str__**(**self**)](#carla.GnssEvent.__str__) _Method_ + - [**Image**](#carla.Image) _Class_ + - [**width**](#carla.Image.width) _Instance variable_ + - [**height**](#carla.Image.height) _Instance variable_ + - [**fov**](#carla.Image.fov) _Instance variable_ + - [**raw_data**](#carla.Image.raw_data) _Instance variable_ + - [**convert**(**self**, **color_converter**)](#carla.Image.convert) _Method_ + - [**save_to_disk**(**self**, **path**, **color_converter**=Raw)](#carla.Image.save_to_disk) _Method_ + - [**\__len__**(**self**)](#carla.Image.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.Image.__iter__) _Method_ + - [**\__getitem__**(**self**, **pos**)](#carla.Image.__getitem__) _Method_ + - [**\__setitem__**(**self**, **pos**, **color**)](#carla.Image.__setitem__) _Method_ + - [**\__str__**(**self**)](#carla.Image.__str__) _Method_ + - [**LaneInvasionEvent**](#carla.LaneInvasionEvent) _Class_ + - [**actor**](#carla.LaneInvasionEvent.actor) _Instance variable_ + - [**crossed_lane_markings**](#carla.LaneInvasionEvent.crossed_lane_markings) _Instance variable_ + - [**\__str__**(**self**)](#carla.LaneInvasionEvent.__str__) _Method_ + - [**LidarMeasurement**](#carla.LidarMeasurement) _Class_ + - [**horizontal_angle**](#carla.LidarMeasurement.horizontal_angle) _Instance variable_ + - [**channels**](#carla.LidarMeasurement.channels) _Instance variable_ + - [**raw_data**](#carla.LidarMeasurement.raw_data) _Instance variable_ + - [**get_point_count**(**self**, **channel**)](#carla.LidarMeasurement.get_point_count) _Method_ + - [**save_to_disk**(**self**, **path**)](#carla.LidarMeasurement.save_to_disk) _Method_ + - [**\__len__**(**self**)](#carla.LidarMeasurement.__len__) _Method_ + - [**\__iter__**(**self**)](#carla.LidarMeasurement.__iter__) _Method_ + - [**\__getitem__**(**self**, **pos**)](#carla.LidarMeasurement.__getitem__) _Method_ + - [**\__setitem__**(**self**, **pos**, **location**)](#carla.LidarMeasurement.__setitem__) _Method_ + - [**\__str__**(**self**)](#carla.LidarMeasurement.__str__) _Method_ + - [**Location**](#carla.Location) _Class_ + - [**x**](#carla.Location.x) _Instance variable_ + - [**y**](#carla.Location.y) _Instance variable_ + - [**z**](#carla.Location.z) _Instance variable_ + - [**\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0)](#carla.Location.__init__) _Method_ + - [**distance**(**self**, **location**)](#carla.Location.distance) _Method_ + - [**\__eq__**(**self**, **other**)](#carla.Location.__eq__) _Method_ + - [**\__ne__**(**self**, **other**)](#carla.Location.__ne__) _Method_ + - [**\__str__**(**self**)](#carla.Location.__str__) _Method_ + - [**ObstacleDetectionEvent**](#carla.ObstacleDetectionEvent) _Class_ + - [**actor**](#carla.ObstacleDetectionEvent.actor) _Instance variable_ + - [**other_actor**](#carla.ObstacleDetectionEvent.other_actor) _Instance variable_ + - [**distance**](#carla.ObstacleDetectionEvent.distance) _Instance variable_ + - [**\__str__**(**self**)](#carla.ObstacleDetectionEvent.__str__) _Method_ + - [**Sensor**](#carla.Sensor) _Class_ + - [**is_listening**](#carla.Sensor.is_listening) _Instance variable_ + - [**listen**(**self**, **callback**)](#carla.Sensor.listen) _Method_ + - [**stop**(**self**)](#carla.Sensor.stop) _Method_ + - [**\__str__**(**self**)](#carla.Sensor.__str__) _Method_ + - [**TrafficLight**](#carla.TrafficLight) _Class_ + - [**state**](#carla.TrafficLight.state) _Instance variable_ + - [**set_state**(**self**, **state**)](#carla.TrafficLight.set_state) _Method_ + - [**get_state**(**self**)](#carla.TrafficLight.get_state) _Method_ + - [**set_green_time**(**self**, **green_time**)](#carla.TrafficLight.set_green_time) _Method_ + - [**get_green_time**(**self**)](#carla.TrafficLight.get_green_time) _Method_ + - [**set_yellow_time**(**self**, **yellow_time**)](#carla.TrafficLight.set_yellow_time) _Method_ + - [**get_yellow_time**(**self**)](#carla.TrafficLight.get_yellow_time) _Method_ + - [**set_red_time**(**self**, **red_time**)](#carla.TrafficLight.set_red_time) _Method_ + - [**get_red_time**(**self**)](#carla.TrafficLight.get_red_time) _Method_ + - [**get_elapsed_time**(**self**)](#carla.TrafficLight.get_elapsed_time) _Method_ + - [**freeze**(**self**, **freeze**)](#carla.TrafficLight.freeze) _Method_ + - [**is_frozen**(**self**)](#carla.TrafficLight.is_frozen) _Method_ + - [**get_pole_index**(**self**)](#carla.TrafficLight.get_pole_index) _Method_ + - [**get_group_traffic_lights**(**self**)](#carla.TrafficLight.get_group_traffic_lights) _Method_ + - [**\__str__**(**self**)](#carla.TrafficLight.__str__) _Method_ + - [**Vehicle**](#carla.Vehicle) _Class_ + - [**bounding_box**](#carla.Vehicle.bounding_box) _Instance variable_ + - [**apply_control**(**self**, **control**)](#carla.Vehicle.apply_control) _Method_ + - [**get_control**(**self**)](#carla.Vehicle.get_control) _Method_ + - [**apply_physics_control**(**self**, **physics_control**)](#carla.Vehicle.apply_physics_control) _Method_ + - [**get_physics_control**(**self**)](#carla.Vehicle.get_physics_control) _Method_ + - [**set_autopilot**(**self**, **enabled**=True)](#carla.Vehicle.set_autopilot) _Method_ + - [**get_speed_limit**(**self**)](#carla.Vehicle.get_speed_limit) _Method_ + - [**get_traffic_light_state**(**self**)](#carla.Vehicle.get_traffic_light_state) _Method_ + - [**is_at_traffic_light**(**self**)](#carla.Vehicle.is_at_traffic_light) _Method_ + - [**get_traffic_light**(**self**)](#carla.Vehicle.get_traffic_light) _Method_ + - [**\__str__**(**self**)](#carla.Vehicle.__str__) _Method_ + - [**Walker**](#carla.Walker) _Class_ + - [**bounding_box**](#carla.Walker.bounding_box) _Instance variable_ + - [**apply_control**(**self**, **control**)](#carla.Walker.apply_control) _Method_ + - [**apply_control**(**self**, **control**)](#carla.Walker.apply_control) _Method_ + - [**get_control**(**self**)](#carla.Walker.get_control) _Method_ + - [**\__str__**(**self**)](#carla.Walker.__str__) _Method_ +- [**command**](#command) _Module_ + - [**ApplyAngularVelocity**](#command.ApplyAngularVelocity) _Class_ + - [**actor_id**](#command.ApplyAngularVelocity.actor_id) _Instance variable_ + - [**angular_velocity**](#command.ApplyAngularVelocity.angular_velocity) _Instance variable_ + - [**\__init__**(**self**, **actor**, **angular_velocity**)](#command.ApplyAngularVelocity.__init__) _Method_ + - [**ApplyImpulse**](#command.ApplyImpulse) _Class_ + - [**actor_id**](#command.ApplyImpulse.actor_id) _Instance variable_ + - [**impulse**](#command.ApplyImpulse.impulse) _Instance variable_ + - [**\__init__**(**self**, **actor**, **impulse**)](#command.ApplyImpulse.__init__) _Method_ + - [**ApplyTransform**](#command.ApplyTransform) _Class_ + - [**actor_id**](#command.ApplyTransform.actor_id) _Instance variable_ + - [**transform**](#command.ApplyTransform.transform) _Instance variable_ + - [**\__init__**(**self**, **actor**, **transform**)](#command.ApplyTransform.__init__) _Method_ + - [**ApplyVehicleControl**](#command.ApplyVehicleControl) _Class_ + - [**actor_id**](#command.ApplyVehicleControl.actor_id) _Instance variable_ + - [**control**](#command.ApplyVehicleControl.control) _Instance variable_ + - [**\__init__**(**self**, **actor**, **control**)](#command.ApplyVehicleControl.__init__) _Method_ + - [**ApplyVelocity**](#command.ApplyVelocity) _Class_ + - [**actor_id**](#command.ApplyVelocity.actor_id) _Instance variable_ + - [**velocity**](#command.ApplyVelocity.velocity) _Instance variable_ + - [**\__init__**(**self**, **actor**, **velocity**)](#command.ApplyVelocity.__init__) _Method_ + - [**ApplyWalkerControl**](#command.ApplyWalkerControl) _Class_ + - [**actor_id**](#command.ApplyWalkerControl.actor_id) _Instance variable_ + - [**control**](#command.ApplyWalkerControl.control) _Instance variable_ + - [**\__init__**(**self**, **actor**, **control**)](#command.ApplyWalkerControl.__init__) _Method_ + - [**ApplyWalkerState**](#command.ApplyWalkerState) _Class_ + - [**actor_id**](#command.ApplyWalkerState.actor_id) _Instance variable_ + - [**transform**](#command.ApplyWalkerState.transform) _Instance variable_ + - [**speed**](#command.ApplyWalkerState.speed) _Instance variable_ + - [**\__init__**(**self**, **actor**, **transform**, **speed**)](#command.ApplyWalkerState.__init__) _Method_ + - [**DestroyActor**](#command.DestroyActor) _Class_ + - [**actor_id**](#command.DestroyActor.actor_id) _Instance variable_ + - [**\__init__**(**self**, **actor**)](#command.DestroyActor.__init__) _Method_ + - [**Response**](#command.Response) _Class_ + - [**actor_id**](#command.Response.actor_id) _Instance variable_ + - [**error**](#command.Response.error) _Instance variable_ + - [**has_error**(**self**)](#command.Response.has_error) _Method_ + - [**SetAutopilot**](#command.SetAutopilot) _Class_ + - [**actor_id**](#command.SetAutopilot.actor_id) _Instance variable_ + - [**enabled**](#command.SetAutopilot.enabled) _Instance variable_ + - [**\__init__**(**self**, **actor**, **enabled**)](#command.SetAutopilot.__init__) _Method_ + - [**SetSimulatePhysics**](#command.SetSimulatePhysics) _Class_ + - [**actor_id**](#command.SetSimulatePhysics.actor_id) _Instance variable_ + - [**enabled**](#command.SetSimulatePhysics.enabled) _Instance variable_ + - [**\__init__**(**self**, **actor**, **enabled**)](#command.SetSimulatePhysics.__init__) _Method_ + - [**SpawnActor**](#command.SpawnActor) _Class_ + - [**transform**](#command.SpawnActor.transform) _Instance variable_ + - [**parent_id**](#command.SpawnActor.parent_id) _Instance variable_ + - [**\__init__**(**self**)](#command.SpawnActor.__init__) _Method_ + - [**\__init__**(**self**, **blueprint**, **transform**)](#command.SpawnActor.__init__) _Method_ + - [**\__init__**(**self**, **blueprint**, **transform**, **parent**)](#command.SpawnActor.__init__) _Method_ + - [**then**(**self**, **command**)](#command.SpawnActor.then) _Method_ + +## carla.ActorAttributeType _class_ + +

Instance Variables

+- **Bool** +- **Int** +- **Float** +- **String** +- **RGBColor** + +--- + +## carla.ActorList _class_ +Class that provides access to actors. + +

Methods

+- **find**(**self**, **actor_id**) + - **Parameters:** + - `actor_id` (_int_) +- **filter**(**self**, **wildcard_pattern**) + - **Parameters:** + - `wildcard_pattern` (_str_) +- **\__getitem__**(**self**, **pos**) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.AttachmentType _class_ +Class that defines the attachment options. See [`world.spawn_actor`](#[carla.World.spawn_actor](#carla.World.spawn_actor)). + +

Instance Variables

+- **Rigid** +- **SpringArm** + +--- + +## carla.BlueprintLibrary _class_ +Class that provides access to blueprints. + +

Methods

+- **find**(**self**) +- **filter**(**self**, **wildcard_pattern**) +Filters a list of ActorBlueprint with id or tags matching wildcard_pattern. The pattern is matched against each blueprint's id and tags. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ + - **Note:** _wildcard_pattern follows Unix shell-style wildcards (fnmatch). +_ +- **\__getitem__**(**self**, **pos**) + - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ColorConverter _class_ +Class that defines the color converter options. + +

Instance Variables

+- **Raw** +- **Depth** +- **LogarithmicDepth** +- **CityScapesPalette** + +--- + +## carla.DebugHelper _class_ +Class that provides drawing debug shapes. + +

Methods

+- **draw_point**(**self**, **location**, **size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `size` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time=0` instead_. +- **draw_line**(**self**, **begin**, **end**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) + - `end` (_[carla.Location](#carla.Location)_) + - `thickness` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time=0` instead_. +- **draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1f, **arrow_size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) + - `end` (_[carla.Location](#carla.Location)_) + - `thickness` (_float_) + - `arrow_size` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time=0` instead_. +- **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) + - **Parameters:** + - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) + - `rotation` (_[carla.Rotation](#carla.Rotation)_) + - `thickness` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time=0` instead_. +- **draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `text` (_str_) + - `draw_shadow` (_bool_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, set a high `life_time` instead_. + +--- + +## carla.LaneChange _class_ +Class that defines the lane change options. + +

Instance Variables

+- **NONE** +Traffic rules do not allow turning right or left, only going straight. +- **Right** +Traffic rules allow turning right. +- **Left** +Traffic rules allow turning left. +- **Both** +Traffic rules allow turning right or left. + +--- + +## carla.LaneMarking _class_ +Struct that defines a lane marking. + +

Instance Variables

+- **type** (_[carla.LaneMarkingType](#carla.LaneMarkingType)_) +Lane marking type. +- **color** (_[carla.Color](#carla.Color)_) +Actual color of the marking. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Lane change availability. +- **width** (_float_) +Horizontal lane marking thickness. + +--- + +## carla.LaneMarkingColor _class_ +Class that defines the lane marking colors. + +

Instance Variables

+- **Standard** +White by default. +- **Blue** +- **Green** +- **Red** +- **White** +- **Yellow** +- **Other** + +--- + +## carla.LaneMarkingType _class_ +Class that defines the lane marking types that OpenDRIVE accepts. + +

Instance Variables

+- **NONE** +- **Other** +- **Broken** +- **Solid** +- **SolidSolid** +For double solid line. +- **SolidBroken** +From inside to outside except for center lane which is from left to right. +- **BrokenSolid** +From inside to outside except for center lane which is from left to right. +- **BrokenBroken** +From inside to outside except for center lane which is from left to right. +- **BottsDots** +- **Grass** +Grass edge. +- **Curb** + +--- + +## carla.LaneType _class_ +All the possible lane types that OpenDRIVE accepts. + +

Instance Variables

+- **NONE** +- **Driving** +- **Stop** +- **Shoulder** +- **Biking** +- **Sidewalk** +- **Border** +- **Restricted** +- **Parking** +- **Bidirectional** +- **Median** +- **Special1** +- **Special2** +- **Special3** +- **RoadWorks** +- **Tram** +- **Rail** +- **Entry** +- **Exit** +- **OffRamp** +- **OnRamp** +- **Any** + +--- + +## carla.SensorData _class_ +Base class for all the objects containing data generated by a sensor. + +

Instance Variables

+- **frame** (_int_) +Frame count when the data was generated. +- **timestamp** (_float_) +Simulation-time when the data was generated. +- **transform** (_[carla.Transform](#carla.Transform)_) +Sensor's transform when the data was generated. + +--- + +## carla.TrafficLightState _class_ +All possible states for traffic lights. + +

Instance Variables

+- **Red** +- **Yellow** +- **Green** +- **Off** +- **Unknown** + +--- + +## carla.Actor _class_ +Base class for all actors. +Actor is anything that plays a role in the simulation and can be moved around, examples of actors are vehicles, pedestrians, and sensors. + +

Instance Variables

+- **id** (_int_) +Unique id identifying this actor. Note ids are unique during a given episode. +- **type_id** (_str_) +Id of the blueprint that created this actor, e.g. "vehicle.ford.mustang". +- **parent** (_[carla.Actor](#carla.Actor)_) +Parent actor of this instance, None if this instance is not attached to another actor. +- **semantic_tags** (_list(int)_) +List of semantic tags of all components of this actor, see semantic segmentation sensor for the list of available tags. E.g., a traffic light actor could contain "pole" and "traffic light" tags. +- **is_alive** (_bool_) +Return whether this object was destroyed using this actor handle. +- **attributes** (_dict_) +Dictionary of attributes of the blueprint that created this actor. + +

Methods

+- **destroy**(**self**) +Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. It has no effect if the Actor was already successfully destroyed. + - **Return:** _bool_ + - **Warning:** _This function blocks until the destruction operation is completed by the simulator. +_ +- **get_world**(**self**) +Return the world this actor belongs to. + - **Return:** _[carla.World](#carla.World)_ +- **get_location**(**self**) +Return the current location of the actor. + - **Return:** _[carla.Location](#carla.Location)_ + - **Note:** _This function does not call the simulator, it returns the location received in the last tick. +_ +- **get_velocity**(**self**) +Return the current 3D velocity of the actor. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the velocity received in the last tick. +_ +- **get_angular_velocity**(**self**) +Return the current 3D angular velocity of the actor. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the angular velocity received in the last tick. +_ +- **get_acceleration**(**self**) +Return the current 3D acceleration of the actor. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the acceleration received in the last tick. +_ +- **set_location**(**self**, **location**) +Teleport the actor to a given location. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) +- **set_transform**(**self**, **transform**) +Teleport the actor to a given transform. + - **Parameters:** + - `transform` (_[carla.Transform](#carla.Transform)_) +- **set_velocity**(**self**, **velocity**) +Set the actor's velocity. + - **Parameters:** + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) +- **set_angular_velocity**(**self**, **angular_velocity**) +Set the actor's angular velocity. + - **Parameters:** + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) +- **add_impulse**(**self**, **impulse**) +Add impulse to the actor. + - **Parameters:** + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) +- **set_simulate_physics**(**self**, **enabled**=True) +Enable or disable physics simulation on this actor. + - **Parameters:** + - `enabled` (_bool_) +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.ActorAttribute _class_ +Class that defines an attribute of a [carla.ActorBlueprint](#carla.ActorBlueprint). + +

Instance Variables

+- **id** (_str_) +- **type** (_[carla.ActorAttributeType](#carla.ActorAttributeType)_) +- **recommended_values** (_list(str)_) +- **is_modifiable** (_bool_) + +

Methods

+- **as_bool**(**self**) +- **as_int**(**self**) +- **as_float**(**self**) +- **as_str**(**self**) +- **as_color**(**self**) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_bool_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_str_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.ActorAttribute](#carla.ActorAttribute)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_bool_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_int_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_float_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_str_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.ActorAttribute](#carla.ActorAttribute)_) +- **\__nonzero__**(**self**) +- **\__bool__**(**self**) +- **\__int__**(**self**) +- **\__float__**(**self**) +- **\__str__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ActorBlueprint _class_ +Class that contains all the necessary information for spawning an Actor. + +

Instance Variables

+- **id** (_str_) +- **tags** (_list(str)_) + +

Methods

+- **has_tag**(**self**, **tag**) + - **Parameters:** + - `tag` (_str_) + - **Return:** _bool_ +- **match_tags**(**self**, **wildcard_pattern**) +Test if any of the flags or id matches wildcard_pattern. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _bool_ + - **Note:** _Wildcard_pattern follows Unix shell-style wildcards. +_ +- **has_attribute**(**self**, **id**) + - **Parameters:** + - `id` (_str_) + - **Return:** _bool_ +- **get_attribute**(**self**, **id**) + - **Parameters:** + - `id` (_str_) + - **Return:** _[carla.ActorAttribute](#carla.ActorAttribute)_ +- **set_attribute**(**self**, **id**, **value**) + - **Parameters:** + - `id` (_str_) + - `value` (_str_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ActorSnapshot _class_ +Class that provides access to the data of a [carla.Actor](#carla.Actor) in a [carla.WorldSnapshot](#carla.WorldSnapshot). + +

Instance Variables

+- **id** (_int_) + +

Methods

+- **get_transform**(**self**) + - **Return:** _[carla.Transform](#carla.Transform)_ +- **get_velocity**(**self**) + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_angular_velocity**(**self**) + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_acceleration**(**self**) + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__self__**(**self**) + +--- + +## carla.BoundingBox _class_ +Bounding box helper class. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +The center of the bounding box relative to its parent actor. +- **extent** (_[carla.Vector3D](#carla.Vector3D)_) +It contains the vector from the center of the bounding box to one of the vertex of the box. +So, if you want to know the _X bounding box size_, you can just do `extent.x * 2`. + +

Methods

+- **\__init__**(**self**, **location**, **extent**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `extent` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) +- **\__str__**(**self**) + +--- + +## carla.Client _class_ +Client used to connect to a Carla server. + +

Methods

+- **\__init__**(**self**, **host**, **port**, **worker_threads**=0) +Client constructor. + - **Parameters:** + - `host` (_str_) – IP address where a CARLA Simulator instance is running. + - `port` (_int_) – TCP port where the CARLA Simulator instance is running. + - `worker_threads` (_int_) – Number of working threads used for background updates. If 0, use all available concurrency. +- **set_timeout**(**self**, **seconds**) +Set the timeout in seconds allowed to block when doing networking calls. + - **Parameters:** + - `seconds` (_float_) – New timeout value in seconds. +- **get_client_version**(**self**) +Get the client version as a string. + - **Return:** _str_ +- **get_server_version**(**self**) +Get the server version as a string. + - **Return:** _str_ +- **get_world**(**self**) +Get the world currently active in the simulation. + - **Return:** _[carla.World](#carla.World)_ +- **get_available_maps**(**self**) +Get a list of strings of the maps available on server. The result can be something like: + '/Game/Carla/Maps/Town01' + '/Game/Carla/Maps/Town02' + '/Game/Carla/Maps/Town03' + '/Game/Carla/Maps/Town04' + '/Game/Carla/Maps/Town05' + '/Game/Carla/Maps/Town06' + '/Game/Carla/Maps/Town07'. + - **Return:** _list(str)_ +- **reload_world**(**self**) +Reload the current world, note that a new world is created with default settings using the same map. All actors present in the world will be destroyed. + - **Raises:** RuntimeError +- **load_world**(**self**, **map_name**) +Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed. + - **Parameters:** + - `map_name` (_str_) – Name of the map to load, accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. +- **start_recorder**(**self**, **filename**) +If we use a simple name like 'recording.log' then it will be saved at server folder 'CarlaUE4/Saved/recording.log'. If we use some folder in the name, then it will be considered to be an absolute path, like '/home/carla/recording.log'. + - **Parameters:** + - `filename` (_str_) – Name of the file to write the recorded data. +- **stop_recorder**(**self**) +Stops the recording in progress. +- **show_recorder_file_info**(**self**, **filename**, **show_all**) +Will show info about the recorded file (frames, times, events, state, positions...) We have the option to show all the details per frame, that includes all the traffic light states, position of all actors, and animations data. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `show_all` (_bool_) – Show all detailed info, or just a summary. +- **show_recorder_collisions**(**self**, **filename**, **category1**, **category2**) +This will show which collisions were recorded in the file. We can use a filter for the collisions we want, using two categories. The categories can be: + 'h' = Hero + 'v' = Vehicle + 'w' = Walker + 't' = Traffic light + 'o' = Other + 'a' = Any +So, if you want to see only collisions about a vehicle and a walker, we would use for category1 'v' and category2 'w'. Or if you want all the collisions (filter off) you can use 'a' as both categories. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `category1` (_single char_) – Character specifying the category of the first actor. + - `category2` (_single char_) – Character specifying the category of the second actor. +- **show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**) +Shows which actors seem blocked by some reason. The idea is to calculate which actors are not moving as much as 'min_distance' for a period of 'min_time'. By default min_time = 60 seconds (1 min) and min_distance = 100 centimeters (1 m). + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `min_time` (_float_) – How many seconds has to be stoped an actor to be considered as blocked. + - `min_distance` (_float_) – How many centimeters needs to move the actor in order to be considered as moving, and not blocked. +- **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**) +Playback a file. + - **Parameters:** + - `name` (_str_) – Name of the file. + - `start` (_float_) – Time in seconds where to start the playback. If it is negative, then it starts from the end. + - `duration` (_float_) – Id of the actor to follow. If this is 0 then camera is disabled. + - `follow_id` (_int_) +- **set_replayer_time_factor**(**self**, **time_factor**) +Apply a different playback speed to current playback. Can be used several times while a playback is in curse. + - **Parameters:** + - `time_factor` (_float_) – A value of 1.0 means normal time factor. A value < 1.0 means slow motion (for example 0.5 is half speed) A value > 1.0 means fast motion (for example 2.0 is double speed). +- **apply_batch**(**self**, **commands**) +This function executes the whole list of commands on a single simulation step. For example, to set autopilot on some actors, we could use: [sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) We don't have control about the response of each command. If we need that, we can use apply_batch_sync(). + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. Each command has a different number of parameters. Currently, we can use these [commands](#command.ApplyAngularVelocity): + SpawnActor + DestroyActor + ApplyVehicleControl + ApplyWalkerControl + ApplyTransform + ApplyVelocity + AplyAngularVelocity + ApplyImpulse + SetSimulatePhysics + SetAutopilot. +- **apply_batch_sync**(**self**, **commands**) +This function executes the whole list of commands on a single simulation step, blocks until the commands are executed, and returns a list of [`command.Response`](#command.Response) that can be used to determine whether a single command succeeded or not. [sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116). + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. For a list of commands available see function above apply_batch(). + - **Return:** _list_ + +--- + +## carla.CollisionEvent([carla.SensorData](#carla.SensorData)) _class_ +Class that defines a registered collision. + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that measured the collision. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +Get the actor to which we collided. +- **normal_impulse** (_[carla.Vector3D](#carla.Vector3D)_) +Normal impulse result of the collision. + +--- + +## carla.Color _class_ +Class that defines a 32-bit BGRA color. + +

Instance Variables

+- **r** +- **g** +- **b** +- **a** + +

Methods

+- **\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=255) +Client constructor. + - **Parameters:** + - `r` (_int_) + - `g` (_int_) + - `b` (_int_) + - `a` (_int_) +- **\__eq__**(**self**, **other**) +- **\__ne__**(**self**, **other**) +- **\__str__**(**self**) + +--- + +## carla.GearPhysicsControl _class_ +Class that provides access to vehicle transmission details. + +

Instance Variables

+- **ratio** (_float_) +- **down_ratio** (_float_) +- **up_ratio** (_float_) + +

Methods

+- **\__init__**(**self**, **ratio**=1.0, **down_ratio**=0.5, **up_ratio**=0.65) + - **Parameters:** + - `ratio` (_float_) + - `down_ratio` (_float_) + - `up_ratio` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.GeoLocation _class_ +Class that contains geolocation simulated data. + +

Instance Variables

+- **latitude** (_float_) +- **longitude** (_float_) +- **altitude** (_float_) + +

Methods

+- **\__init__**(**self**, **latitude**=0.0, **longitude**=0.0, **altitude**=0.0) + - **Parameters:** + - `latitude` (_float_) + - `longitude` (_float_) + - `altitude` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Geolocation](#carla.Geolocation)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Geolocation](#carla.Geolocation)_) +- **\__str__**(**self**) + +--- + +## carla.Map _class_ +Map description that provides a Waypoint query system, that extracts the information from the OpenDRIVE file. + +

Instance Variables

+- **name** +Map name. Comes from the Unreal's UMap name if loaded from a Carla server. + +

Methods

+- **\__init__**(**self**, **name**, **xodr_content**) +Constructor for this class useful if you want to use a `XODR` (OpenDRIVE) file without importing it from any Carla server running. + - **Parameters:** + - `name` (_str_) – Name of the current map. + - `xodr_content` (_str_) – XODR content as string. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **get_spawn_points**(**self**) +Returns a list of transformations corresponding to the recommended spawn points over the map. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **get_waypoint**(**self**, **location**, **project_to_road**=True, **lane_type**=[carla.LaneType.Driving](#carla.LaneType.Driving)) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Location where you want to get the [carla.Waypoint](#carla.Waypoint). + - `project_to_road` (_bool_) – If **True**, the waypoint will be at the center of the nearest lane. +If **False**, the waypoint will be at the given location. Also, in this second case, the result may be `None` if the waypoint is not found. + - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – This parameter is used to limit the search on a certain lane type. This can be used like a flag: `LaneType.Driving & LaneType.Shoulder`. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_topology**(**self**) +It provides a minimal graph of the topology of the current OpenDRIVE file. It is constituted by a list of pairs of waypoints, where the first waypoint is the origin and the second one is the destination. It can be loaded into [NetworkX](https://networkx.github.io/). A valid output could be: `[ (w0, w1), (w0, w2), (w1, w3), (w2, w3), (w0, w4) ]`. + - **Return:** _list(tuple([carla.Waypoint](#carla.Waypoint), [carla.Waypoint](#carla.Waypoint)))_ +- **generate_waypoints**(**self**, **distance**) +Returns a list of waypoints positioned on the center of the lanes all over the map with an approximate distance between them. + - **Parameters:** + - `distance` (_float_) – Approximate distance between the waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **transform_to_geolocation**(**self**, **location**) +Converts a given [carla.Location](#carla.Location) `(x, y, z)` to a [carla.GeoLocation](#carla.GeoLocation) `(lat, lon, alt)`. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Location to convert. + - **Return:** _[carla.GeoLocation](#carla.GeoLocation)_ +- **to_opendrive**(**self**) +Returns the OpenDRIVE of the current map as string. + - **Return:** _str_ +- **save_to_disk**(**self**, **path**) +Save the OpenDRIVE of the current map to disk. + - **Parameters:** + - `path` – Path where it will be saved. +- **\__str__**(**self**) + +--- + +## carla.Rotation _class_ +Class that represents a 3D rotation. All rotation angles are stored in degrees. + +![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg) _Unreal Engine's standard (from [UE4 docs](https://wiki.unrealengine.com/Blueprint_Rotating_Movement_Component))_. + +

Instance Variables

+- **pitch** (_float_) +- **yaw** (_float_) +- **roll** (_float_) + +

Methods

+- **\__init__**(**self**, **pitch**=0.0, **yaw**=0.0, **roll**=0.0) + - **Parameters:** + - `pitch` (_float_) + - `yaw` (_float_) + - `roll` (_float_) +- **get_forward_vector**(**self**) +Computes a forward vector using the current rotation. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) +- **\__str__**(**self**) + +--- + +## carla.Timestamp _class_ + +

Instance Variables

+- **frame** (_int_) +The number of frames elapsed since the simulator was launched. +- **elapsed_seconds** (_float_) +Simulated seconds elapsed since the beginning of the current episode. +- **delta_seconds** (_float_) +Simulated seconds elapsed since the previous frame. +- **platform_timestamp** (_float_) +Time-stamp of the frame at which this measurement was taken, in seconds as given by the OS. + +

Methods

+- **\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**) + - **Parameters:** + - `frame` (_int_) + - `elapsed_seconds` (_float_) + - `delta_seconds` (_float_) + - `platform_timestamp` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__str__**(**self**) + +--- + +## carla.TrafficSign([carla.Actor](#carla.Actor)) _class_ + +

Instance Variables

+- **trigger_volume** + +--- + +## carla.Transform _class_ +Class that defines a transformation without scaling. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +- **rotation** (_[carla.Rotation](#carla.Rotation)_) + +

Methods

+- **\__init__**(**self**, **location**, **rotation**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `rotation` (_[carla.Rotation](#carla.Rotation)_) +- **transform**(**self**, **in_point**) +Transform a 3D point using the current transformation. + - **Parameters:** + - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied. +- **get_forward_vector**(**self**) +Computes a forward vector using the rotation of the current transformation. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) +- **\__str__**(**self**) + +--- + +## carla.Vector2D _class_ +Vector 2D helper class. + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) +- **\__add__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__mul__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__sub__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__truediv__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__self__**(**self**) + +--- + +## carla.Vector3D _class_ +Vector 3D helper class. + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) +- **z** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **\__add__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__mul__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__sub__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__truediv__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__str__**(**self**) + +--- + +## carla.VehicleControl _class_ +VehicleControl is used for controlling the basic movement of a vehicle. + +

Instance Variables

+- **throttle** (_float_) +A scalar value to control the vehicle throttle [0.0, 1.0]. +- **steer** (_float_) +A scalar value to control the vehicle steering [-1.0, 1.0]. +- **brake** (_float_) +A scalar value to control the vehicle brake [0.0, 1.0]. +- **hand_brake** (_bool_) +If true, hand brake will be used. +- **reverse** (_bool_) +If true, the vehicle will move reverse. +- **manual_gear_shift** (_bool_) +If true, the vehicle will be controlled by changing gears manually. +- **gear** (_int_) +Controls the gear value of the vehicle. + +

Methods

+- **\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=True, **reverse**=True, **manual_gear_shift**=True, **gear**=0) +VehicleControl constructor. + - **Parameters:** + - `throttle` (_float_) + - `steer` (_float_) + - `brake` (_float_) + - `hand_brake` (_bool_) + - `reverse` (_bool_) + - `manual_gear_shift` (_bool_) + - `gear` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__str__**(**self**) + +--- + +## carla.VehiclePhysicsControl _class_ +VehiclePhysicsControl is used for controlling the physics parameters of a vehicle. + +

Instance Variables

+- **torque_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the torque measured in Nm for a specific RPM of the vehicle's engine. +- **max_rpm** (_float_) +The maximum RPM of the vehicle's engine. +- **moi** (_float_) +The moment of inertia of the vehicle's engine. +- **damping_rate_full_throttle** (_float_) +Damping rate when the throttle is maximum. +- **damping_rate_zero_throttle_clutch_engaged** (_float_) +Damping rate when the throttle is zero with clutch engaged. +- **damping_rate_zero_throttle_clutch_disengaged** (_float_) +Damping rate when the throttle is zero with clutch disengaged. +- **use_gear_autobox** (_bool_) +If true, the vehicle will have an automatic transmission. +- **gear_switch_time** (_float_) +Switching time between gears. +- **clutch_strength** (_float_) +The clutch strength of the vehicle. Measured in Kgm^2/s. +- **final_ratio** (_float_) +The fixed ratio from transmission to wheels. +- **forward_gears** (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) +List of GearPhysicsControl objects. +- **mass** (_float_) +The mass of the vehicle measured in Kg. +- **drag_coefficient** (_float_) +Drag coefficient of the vehicle's chassis. +- **center_of_mass** (_[carla.Vector3D](#carla.Vector3D)_) +The center of mass of the vehicle. +- **steering_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the maximum steering for a specific forward speed. +- **wheels** (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) +List of [carla.WheelPhysicsControl](#carla.WheelPhysicsControl) objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels. + +

Methods

+- **\__init__**(**self**, **torque_curve**=[[0.0, 500.0], [5000.0, 500.0]], **max_rpm**=5000.0, **moi**=1.0, **damping_rate_full_throttle**=0.15, **damping_rate_zero_throttle_clutch_engaged**=2.0, **damping_rate_zero_throttle_clutch_disengaged**=0.35, **use_gear_autobox**=True, **gear_switch_time**=0.5, **clutch_strength**=10.0, **mass**=1000.0, **drag_coefficient**=0.3, **center_of_mass**=[0.0, 0.0, 0.0], **steering_curve**=[0.0, 0.0, 0.0], **wheels**=list()) +VehiclePhysicsControl constructor. +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.WalkerAIController([carla.Actor](#carla.Actor)) _class_ +Class used for controlling the automation of a pedestrian. + +

Methods

+- **start**(**self**) +Initializes walker controller. +- **stop**(**self**) +Stops walker controller. +- **go_to_location**(**self**, **destination**) +Sets the destination that the pedestrian will reach. + - **Parameters:** + - `destination` (_[carla.Location](#carla.Location)_) +- **set_max_speed**(**self**, **speed**=1.4) +Sets the speed of the pedestrian. + - **Parameters:** + - `speed` (_float_) – Speed is in m/s. +- **\__str__**(**self**) + +--- + +## carla.WalkerBoneControl _class_ +Class used for controlling the skeleton of a walker. See [walker bone control](../tuto_G_control_walker_skeletons.md). + +

Instance Variables

+- **bone_transforms** (_list([name,transform])_) + +

Methods

+- **\__init__**(**self**, **list(name,transform)**) + - **Parameters:** + - `list(name,transform)` (_tuple_) +- **\__str__**(**self**) + +--- + +## carla.WalkerControl _class_ +WalkerControl is used for controlling the basic movement of a walker. + +

Instance Variables

+- **direction** (_[carla.Vector3D](#carla.Vector3D)_) +Vector that controls the direction of the walker. +- **speed** (_float_) +A scalar value to control the walker speed. +- **jump** (_bool_) +If true, the walker will perform a jump. + +

Methods

+- **\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False) +VehicleControl constructor. +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__str__**(**self**) + +--- + +## carla.Waypoint _class_ +3D directed point that stores information about the road definition that OpenDRIVE provides. + +

Instance Variables

+- **id** (_int_) +Waypoint id, it's generated using a hash combination of its `road_id`, `section_id`, `lane_id` and `s` values, all them come from the OpenDRIVE. The `s` precision is set to 2 centimeters, so 2 waypoints at a distance `s` less than 2 centimeters in the same road, section and lane, will have the same `id`. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transform indicating it's position and orientation according to the current lane information. +- **is_intersection** (_bool_) +_Deprecated, use is_junction instead_. +- **is_junction** (_bool_) +True if the current Waypoint is on a junction. +- **lane_width** (_float_) +Horizontal size of the road at current `s`. +- **road_id** (_int_) +OpenDRIVE road's id. +- **section_id** (_int_) +OpenDRIVE section's id, based on the order that they are originally defined. +- **lane_id** (_int_) +OpenDRIVE lane's id, this value can be positive or negative which represents the direction of the current lane with respect to the road. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20). +- **s** (_float_) +OpenDRIVE `s` value of the current position. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Lane change definition of the current Waypoint's location, based on the traffic rules defined in the OpenDRIVE file. Basically, it tells you if a lane change can be done and in which direction. +- **lane_type** (_[carla.LaneType](#carla.LaneType)_) +The lane type of the current Waypoint, based on OpenDRIVE types. +- **right_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The right lane marking information based on the direction of the Waypoint. +- **left_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The left lane marking information based on the direction of the Waypoint. + +

Methods

+- **next**(**self**, **distance**) +Returns a list of Waypoints at a certain approximate distance from the current Waypoint, taking into account the shape of the road and its possible deviations, without performing any lane change. +The list may be empty if the road ends before the specified distance, for instance, a lane ending with the only option of incorporating to another road. + - **Parameters:** + - `distance` (_float_) – The approximate distance where to get the next Waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **get_right_lane**(**self**) +Generates a Waypoint at the center of the right lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. +Can return `None` if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_left_lane**(**self**) +Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. +Can return `None` if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **\__str__**(**self**) + +--- + +## carla.WeatherParameters _class_ +WeatherParameters class is used for requesting and changing the lighting and weather conditions inside the world. + +

Instance Variables

+- **cloudiness** (_float_) +Weather cloudiness. Values range from 0 to 100. +- **precipitation** (_float_) +Precipitation amount for controlling rain intensity. Values range from 0 to 100. +- **precipitation_deposits** (_float_) +Precipitation deposits for controlling the area of puddles on roads. Values range from 0 to 100. +- **wind_intensity** (_float_) +Wind intensity. Values range from 0 to 100. +- **sun_azimuth_angle** (_float_) +The azimuth angle of the sun in degrees. Values range from 0 to 360. +- **sun_altitude_angle** (_float_) +Altitude angle of the sun in degrees. Values range from -90 to 90. + +

Methods

+- **\__init__**(**self**, **cloudiness**=0.0, **precipitation**=0.0, **precipitation_deposits**=0.0, **wind_intensity**=0.0, **sun_azimuth_angle**=0.0, **sun_altitude_angle**=0.0) +WeatherParameters constructor. + - **Parameters:** + - `cloudiness` (_float_) + - `precipitation` (_float_) + - `precipitation_deposits` (_float_) + - `wind_intensity` (_float_) + - `sun_azimuth_angle` (_float_) + - `sun_altitude_angle` (_float_) +- **\__eq__**(**self**, **other**) +Returns True if `self` and `other` are equal. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns True if `self` and `other` are not equal. + - **Return:** _bool_ +- **\__str__**(**self**) + +--- + +## carla.WheelPhysicsControl _class_ +WheelPhysicsControl is used for controlling the physics parameters of a vehicle's wheel. + +

Instance Variables

+- **tire_friction** (_float_) +A scalar value that indicates the friction of the wheel. +- **damping_rate** (_float_) +The damping rate of the wheel. +- **max_steer_angle** (_float_) +The maximum angle in degrees that the wheel can steer. +- **radius** (_float_) +The radius of the wheel in centimeters. +- **max_brake_torque** (_float_) +The maximum brake torque in Nm. +- **max_handbrake_torque** (_float_) +The maximum handbrake torque in Nm. +- **position** (_[carla.Vector3D](#carla.Vector3D)_) +World position of the wheel. Note that it is a read-only parameter. + +

Methods

+- **\__init__**(**self**, **tire_friction**=2.0, **damping_rate**=0.25, **max_steer_angle**=70.0, **radius**=30.0, **position**=(0.0,0.0,0.0)) +WheelPhysicsControl constructor. +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.World _class_ + +

Instance Variables

+- **id** (_int_) +The id of the episode associated with this world. +- **debug** (_[carla.DebugHelper](#carla.DebugHelper)_) + +

Methods

+- **get_blueprint_library**(**self**) +Return the list of blueprints available in this world. These blueprints can be used to spawn actors into the world. + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ +- **get_map**(**self**) +Return the map that describes this world. + - **Return:** _[carla.Map](#carla.Map)_ +- **get_spectator**(**self**) +Return the spectator actor. The spectator controls the view in the simulator window. + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_settings**(**self**) + - **Return:** _[carla.WorldSettings](#carla.WorldSettings)_ +- **apply_settings**(**self**, **world_settings**) +Returns the id of the frame when the settings took effect. + - **Parameters:** + - `world_settings` (_[carla.WorldSettings](#carla.WorldSettings)_) + - **Return:** _int_ +- **get_weather**(**self**) +Retrieve the weather parameters currently active in the world. + - **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_ +- **set_weather**(**self**, **weather**) +Change the weather in the simulation. + - **Parameters:** + - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) +- **get_snapshot**(**self**) +Return a snapshot of the world at this moment. + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ +- **get_actor**(**self**, **actor_id**) +Find actor by id, return None if not found. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_actors**(**self**) +By default it returns a list with every actor present in the world. _A list of ids can be used as a parameter_. + - **Return:** _[carla.ActorList](#carla.ActorList)_ +- **spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +Spawn an actor into the world based on the blueprint provided at transform. If a parent is provided, the actor is attached to parent. + - **Parameters:** + - `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_) + - `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor. + - `attach_to` (_[carla.Actor](#carla.Actor)_) + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +Same as SpawnActor but return none on failure instead of throwing an exception. + - **Parameters:** + - `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_) + - `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor. + - `attach_to` (_[carla.Actor](#carla.Actor)_) + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **wait_for_tick**(**self**, **seconds**=10.0) +Block calling thread until a world tick is received. + - **Parameters:** + - `seconds` (_float_) + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ +- **on_tick**(**self**, **callback**) +Returns the ID of the callback so it can be removed with `remove_on_tick`. + - **Parameters:** + - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) + - **Return:** _int_ +- **remove_on_tick**(**self**, **callback_id**) +Removes on tick callbacks. +- **tick**(**self**) +Synchronizes with the simulator and returns the id of the newly started frame (only has effect on synchronous mode). + - **Return:** _int_ +- **\__str__**(**self**) + +--- + +## carla.WorldSettings _class_ +More information in our [section](../configuring_the_simulation/). + +

Instance Variables

+- **synchronous_mode** (_bool_) +- **no_rendering_mode** (_bool_) +- **fixed_delta_seconds** (_float_) + +

Methods

+- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0) + - **Parameters:** + - `synchronous_mode` (_bool_) + - `no_rendering_mode` (_bool_) + - `fixed_delta_seconds` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__str__**(**self**) + +--- + +## carla.WorldSnapshot _class_ + +

Instance Variables

+- **id** (_int_) +- **frame** (_int_) +- **timestamp** (_[carla.Timestamp](#carla.Timestamp)_) + +

Methods

+- **has_actor**(**self**, **actor_id**) +Check if an actor is present in this snapshot. + - **Parameters:** + - `actor_id` (_int_) +- **find**(**self**, **actor_id**) +Find an ActorSnapshot by id, return None if the actor is not found. + - **Parameters:** + - `actor_id` (_int_) +- **\__len__**(**self**) +Return number of ActorSnapshots present in this WorldSnapshot. +- **\__iter__**(**self**) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) +- **\__self__**(**self**) + +--- + +## carla.GnssEvent([carla.SensorData](#carla.SensorData)) _class_ + +

Instance Variables

+- **latitude** (_float_) +- **longitude** (_float_) +- **altitude** (_float_) + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.Image([carla.SensorData](#carla.SensorData)) _class_ +Class that defines an image of 32-bit BGRA colors. + +

Instance Variables

+- **width** (_int_) +Image width in pixels. +- **height** (_int_) +Image height in pixels. +- **fov** (_float_) +Horizontal field of view of the image in degrees. +- **raw_data** (_bytes_) + +

Methods

+- **convert**(**self**, **color_converter**) + - **Parameters:** + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) +- **save_to_disk**(**self**, **path**, **color_converter**=Raw) + - **Parameters:** + - `path` (_str_) + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **color**) + - **Parameters:** + - `pos` (_int_) + - `color` (_[carla.Color](#carla.Color)_) +- **\__str__**(**self**) + +--- + +## carla.LaneInvasionEvent([carla.SensorData](#carla.SensorData)) _class_ + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that invaded another lane. +- **crossed_lane_markings** (_list([carla.LaneMarking](#carla.LaneMarking))_) +List of lane markings that have been crossed. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.LidarMeasurement([carla.SensorData](#carla.SensorData)) _class_ + +

Instance Variables

+- **horizontal_angle** (_float_) +- **channels** (_int_) +- **raw_data** (_bytes_) + +

Methods

+- **get_point_count**(**self**, **channel**) + - **Parameters:** + - `channel` (_int_) +- **save_to_disk**(**self**, **path**) + - **Parameters:** + - `path` (_str_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **location**) + - **Parameters:** + - `pos` (_int_) + - `location` (_[carla.Location](#carla.Location)_) +- **\__str__**(**self**) + +--- + +## carla.Location([carla.Vector3D](#carla.Vector3D)) _class_ +Represents a location in the world (in meters). + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) +- **z** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **distance**(**self**, **location**) +Computes the Euclidean distance in meters from this location to another one. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – The Location from where to compute the distance. + - **Return:** _float_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) +- **\__str__**(**self**) + +--- + +## carla.ObstacleDetectionEvent([carla.SensorData](#carla.SensorData)) _class_ + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that measured the collision. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +Get the actor to which we collided. +- **distance** (_float_) +Get obstacle distance. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.Sensor([carla.Actor](#carla.Actor)) _class_ + +

Instance Variables

+- **is_listening** (_boolean_) +Is true if the sensor is listening for data. + +

Methods

+- **listen**(**self**, **callback**) + - **Parameters:** + - `callback` (_function_) – Register a callback to be executed each time a new measurement is received. The callback must accept a single argument containing the sensor data; the type of this object varies depending on the type of sensor, but they all derive from [carla.SensorData](#carla.SensorData). +- **stop**(**self**) +Stops listening for data. +- **\__str__**(**self**) + +--- + +## carla.TrafficLight([carla.TrafficSign](#carla.TrafficSign)) _class_ + +

Instance Variables

+- **state** (_[carla.TrafficLightState](#carla.TrafficLightState)_) + +

Methods

+- **set_state**(**self**, **state**) + - **Parameters:** + - `state` (_[carla.TrafficLightState](#carla.TrafficLightState)_) +- **get_state**(**self**) +Return the current state of the traffic light. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_green_time**(**self**, **green_time**) + - **Parameters:** + - `green_time` (_float_) +- **get_green_time**(**self**) + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_yellow_time**(**self**, **yellow_time**) + - **Parameters:** + - `yellow_time` (_float_) +- **get_yellow_time**(**self**) + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_red_time**(**self**, **red_time**) + - **Parameters:** + - `red_time` (_float_) +- **get_red_time**(**self**) + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_elapsed_time**(**self**) + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **freeze**(**self**, **freeze**) + - **Parameters:** + - `freeze` (_bool_) +- **is_frozen**(**self**) + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_pole_index**(**self**) + - **Return:** _int_ +- **get_group_traffic_lights**(**self**) +Return all traffic lights in the group this one belongs to. + - **Note:** _This function calls the simulator. +_ +- **\__str__**(**self**) + +--- + +## carla.Vehicle([carla.Actor](#carla.Actor)) _class_ +A vehicle actor. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The bounding box of the vehicle. + +

Methods

+- **apply_control**(**self**, **control**) +Apply control to this vehicle. The control will take effect on next tick. + - **Parameters:** + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **get_control**(**self**) +Return the control last applied to this vehicle. + - **Return:** _[carla.VehicleControl](#carla.VehicleControl)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **apply_physics_control**(**self**, **physics_control**) +Apply physics control to this vehicle. The control will take effect on the next tick. + - **Parameters:** + - `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **get_physics_control**(**self**) +Return the physics control last applied to this vehicle. + - **Return:** _[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_ + - **Warning:** _This function does call the simulator to retrieve the value._ +- **set_autopilot**(**self**, **enabled**=True) +Switch on/off this vehicle's server-side autopilot. + - **Parameters:** + - `enabled` (_bool_) +- **get_speed_limit**(**self**) +Return the speed limit currently affecting this vehicle. Note that the speed limit is only updated when passing by a speed limit signal, right after spawning a vehicle it might not reflect the actual speed limit of the current road. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_traffic_light_state**(**self**) +Return the state of the traffic light currently affecting this vehicle. If no traffic light is currently affecting the vehicle, return Green. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **is_at_traffic_light**(**self**) +Return whether a traffic light is affecting this vehicle. + - **Return:** _bool_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_traffic_light**(**self**) +Retrieve the traffic light actor currently affecting this vehicle. + - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.Walker([carla.Actor](#carla.Actor)) _class_ +A walking actor, pedestrian. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The bounding box of the walker. + +

Methods

+- **apply_control**(**self**, **control**) +Apply control to this walker. The control will take effect on the next tick. + - **Parameters:** + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **apply_control**(**self**, **control**) + - **Parameters:** + - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_) +- **get_control**(**self**) +Return the control last applied to this walker. + - **Return:** _[carla.WalkerControl](#carla.WalkerControl)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## command.ApplyAngularVelocity _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **angular_velocity** (_[carla.Vector3D](#carla.Vector3D)_) + +

Methods

+- **\__init__**(**self**, **actor**, **angular_velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyImpulse _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **impulse** (_[carla.Vector3D](#carla.Vector3D)_) + +

Methods

+- **\__init__**(**self**, **actor**, **impulse**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyTransform _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **transform** (_[carla.Transform](#carla.Transform)_) + +

Methods

+- **\__init__**(**self**, **actor**, **transform**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `transform` (_[carla.Transform](#carla.Transform)_) + +--- + +## command.ApplyVehicleControl _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **control** (_[carla.VehicleControl](#carla.VehicleControl)_) + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) + +--- + +## command.ApplyVelocity _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **velocity** (_[carla.Vector3D](#carla.Vector3D)_) + +

Methods

+- **\__init__**(**self**, **actor**, **velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyWalkerControl _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **control** (_[carla.VehicleControl](#carla.VehicleControl)_) + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) + +--- + +## command.ApplyWalkerState _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **transform** (_[carla.Transform](#carla.Transform)_) +- **speed** (_float_) + +

Methods

+- **\__init__**(**self**, **actor**, **transform**, **speed**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `transform` (_[carla.Transform](#carla.Transform)_) + - `speed` (_float_) + +--- + +## command.DestroyActor _class_ + +

Instance Variables

+- **actor_id** (_int_) + +

Methods

+- **\__init__**(**self**, **actor**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + +--- + +## command.Response _class_ +Execution result of a command, contains either an error string or and actor ID, depending on whether or not the command succeeded. See `client.apply_batch_sync()`. + +

Instance Variables

+- **actor_id** (_int_) +- **error** (_str_) + +

Methods

+- **has_error**(**self**) + +--- + +## command.SetAutopilot _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **enabled** (_bool_) + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `enabled` (_bool_) + +--- + +## command.SetSimulatePhysics _class_ + +

Instance Variables

+- **actor_id** (_int_) +- **enabled** (_bool_) + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `enabled` (_bool_) + +--- + +## command.SpawnActor _class_ + +

Instance Variables

+- **transform** (_[carla.Transform](#carla.Transform)_) +- **parent_id** (_int_) + +

Methods

+- **\__init__**(**self**) +- **\__init__**(**self**, **blueprint**, **transform**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) +- **\__init__**(**self**, **blueprint**, **transform**, **parent**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) + - `parent` (_[carla.Actor](#carla.Actor) or int_) +- **then**(**self**, **command**) + - **Parameters:** + - `command` (_[carla.Command](#carla.Command)_) – CommandType. + +--- \ No newline at end of file diff --git a/Docs/APIs/python_api_097.md b/Docs/APIs/python_api_097.md new file mode 100644 index 000000000..e4d206a44 --- /dev/null +++ b/Docs/APIs/python_api_097.md @@ -0,0 +1,1913 @@ +# Python API reference (0.9.7) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.7__. + +
+

+ +Back to latest +

+
+ +## carla.ActorAttributeType _class_ +Class that defines the type of attribute of a [carla.ActorAttribute](#carla.ActorAttribute). + +

Instance Variables

+- **Bool** +- **Int** +- **Float** +- **String** +- **RGBColor** + +--- + +## carla.ActorList _class_ +Class that provides access to actors. + +

Methods

+- **find**(**self**, **actor_id**) +Find an actor by ID. + - **Parameters:** + - `actor_id` (_int_) +- **filter**(**self**, **wildcard_pattern**) +Filters a list of Actors with type_id matching wildcard_pattern. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Note:** _The wildcard_pattern follows Unix shell-style wildcards (fnmatch). +_ +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.AttachmentType _class_ +Class that defines the attachment options. See [carla.World.spawn_actor](#carla.World.spawn_actor).
Check out this [`recipe`](../python_cookbook/#attach-sensors-recipe)! + +

Instance Variables

+- **Rigid** +Standard fixed attachment. +- **SpringArm** +Attachment that expands or retracts based on camera situation. + +--- + +## carla.BlueprintLibrary _class_ +Class that provides access to [blueprints](../bp_library/). + +

Methods

+- **find**(**self**, **id**) +Returns a [carla.ActorBlueprint](#carla.ActorBlueprint) through its id. + - **Parameters:** + - `id` (_str_) + - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ +- **filter**(**self**, **wildcard_pattern**) +Filters a list of ActorBlueprint with id or tags matching wildcard_pattern. The pattern is matched against each blueprint's id and tags. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ + - **Note:** _The wildcard_pattern follows Unix shell-style wildcards (fnmatch). +_ +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) + - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ColorConverter _class_ +Class that defines the color converter options. Check out this [`recipe`](../python_cookbook/#converted-image-recipe)! + +

Instance Variables

+- **Raw** +- **Depth** +- **LogarithmicDepth** +- **CityScapesPalette** + +--- + +## carla.DebugHelper _class_ +Class that provides drawing debug shapes. Check out this [`example`](https://github.com/carla-simulator/carla/blob/master/PythonAPI/util/lane_explorer.py). + +

Methods

+- **draw_point**(**self**, **location**, **size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) +Draws a point in the given location. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `size` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. +- **draw_line**(**self**, **begin**, **end**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) +Draws a line between two given locations. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) + - `end` (_[carla.Location](#carla.Location)_) + - `thickness` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. +- **draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1f, **arrow_size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) +Draws an arrow between two given locations. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) + - `end` (_[carla.Location](#carla.Location)_) + - `thickness` (_float_) + - `arrow_size` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. +- **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) +Draws the [carla.BoundingBox](#carla.BoundingBox) of a given bounding_box.
Check out this [`recipe`](../python_cookbook/#debug-bounding-box-recipe)! + - **Parameters:** + - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) + - `rotation` (_[carla.Rotation](#carla.Rotation)_) + - `thickness` (_float_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. +- **draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) +Draws a string in a given location. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `text` (_str_) + - `draw_shadow` (_bool_) + - `color` (_[carla.Color](#carla.Color)_) + - `life_time` (_float_) + - `persistent_lines` (_bool_) – _Deprecated, set a high `life_time` instead_. + - **Note:** _Strings can only be seen on the server-side. +_ + +--- + +## carla.LaneChange _class_ +Class that defines the lane change options. Check out this [`recipe`](../python_cookbook/#lanes-recipe)! + +

Instance Variables

+- **NONE** +Traffic rules do not allow turning right or left, only going straight. +- **Right** +Traffic rules allow turning right. +- **Left** +Traffic rules allow turning left. +- **Both** +Traffic rules allow turning right or left. + +--- + +## carla.LaneMarking _class_ +Class that defines a lane marking. + +

Instance Variables

+- **type** (_[carla.LaneMarkingType](#carla.LaneMarkingType)_) +Lane marking type. +- **color** (_[carla.Color](#carla.Color)_) +Actual color of the marking. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Lane change availability. +- **width** (_float_) +Horizontal lane marking thickness. + +--- + +## carla.LaneMarkingColor _class_ +Class that defines the lane marking colors. + +

Instance Variables

+- **Standard** +White by default. +- **Blue** +- **Green** +- **Red** +- **White** +- **Yellow** +- **Other** + +--- + +## carla.LaneMarkingType _class_ +Class that defines the lane marking types accepted by OpenDRIVE. Check out this [`recipe`](../python_cookbook/#lanes-recipe)! + +

Instance Variables

+- **NONE** +- **Other** +- **Broken** +- **Solid** +- **SolidSolid** +For double solid line. +- **SolidBroken** +From inside to outside except for center lane which is from left to right. +- **BrokenSolid** +From inside to outside except for center lane which is from left to right. +- **BrokenBroken** +From inside to outside except for center lane which is from left to right. +- **BottsDots** +- **Grass** +Grass edge. +- **Curb** + +--- + +## carla.LaneType _class_ +All the possible lane types accepted by OpenDRIVE. Check out this [`recipe`](../python_cookbook/#lanes-recipe)! + +

Instance Variables

+- **NONE** +- **Driving** +- **Stop** +- **Shoulder** +- **Biking** +- **Sidewalk** +- **Border** +- **Restricted** +- **Parking** +- **Bidirectional** +- **Median** +- **Special1** +- **Special2** +- **Special3** +- **RoadWorks** +- **Tram** +- **Rail** +- **Entry** +- **Exit** +- **OffRamp** +- **OnRamp** +- **Any** + +--- + +## carla.SensorData _class_ +Base class for all the objects containing data generated by a sensor. + +

Instance Variables

+- **frame** (_int_) +Frame count when the data was generated. +- **timestamp** (_float_) +Simulation-time when the data was generated. +- **transform** (_[carla.Transform](#carla.Transform)_) +Sensor's transform when the data was generated. + +--- + +## carla.TrafficLightState _class_ +All possible states for traffic lights. Check out this [`recipe`](../python_cookbook/#traffic-lights-recipe)! + +

Instance Variables

+- **Red** +- **Yellow** +- **Green** +- **Off** +- **Unknown** + +--- + +## carla.Actor _class_ +Base class for all actors. +Actor is anything that plays a role in the simulation and can be moved around, examples of actors are vehicles, pedestrians, and sensors. + +

Instance Variables

+- **id** (_int_) +Unique id identifying this actor. Note ids are unique during a given episode. +- **type_id** (_str_) +Id of the blueprint that created this actor, e.g. "vehicle.ford.mustang". +- **parent** (_[carla.Actor](#carla.Actor)_) +Parent actor of this instance, None if this instance is not attached to another actor. +- **semantic_tags** (_list(int)_) +List of semantic tags of all components of this actor, see semantic segmentation sensor for the list of available tags. E.g., a traffic light actor could contain "pole" and "traffic light" tags. +- **is_alive** (_bool_) +Returns whether this object was destroyed using this actor handle. +- **attributes** (_dict_) +Dictionary of attributes of the blueprint that created this actor. + +

Methods

+- **destroy**(**self**) +Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. It has no effect if the Actor was already successfully destroyed. + - **Return:** _bool_ + - **Warning:** _This function blocks until the destruction operation is completed by the simulator. +_ +- **get_world**(**self**) +Returns the world this actor belongs to. + - **Return:** _[carla.World](#carla.World)_ +- **get_location**(**self**) +Returns the actor's current location. + - **Return:** _[carla.Location](#carla.Location)_ + - **Note:** _This function does not call the simulator, it returns the location received in the last tick. +_ +- **get_transform**(**self**) +Returns the actor's current transform. + - **Return:** _[carla.Transform](#carla.Transform)_ + - **Note:** _This function does not call the simulator, it returns the transform received in the last tick. +_ +- **get_velocity**(**self**) +Returns the actor's current 3D velocity. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the velocity received in the last tick. +_ +- **get_angular_velocity**(**self**) +Returns the actor's current 3D angular velocity. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the angular velocity received in the last tick. +_ +- **get_acceleration**(**self**) +Returns the actor's current 3D acceleration. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Note:** _This function does not call the simulator, it returns the acceleration received in the last tick. +_ +- **set_location**(**self**, **location**) +Teleport the actor to a given location. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) +- **set_transform**(**self**, **transform**) +Teleport the actor to a given transform. + - **Parameters:** + - `transform` (_[carla.Transform](#carla.Transform)_) +- **set_velocity**(**self**, **velocity**) +Set the actor's velocity. + - **Parameters:** + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) +- **set_angular_velocity**(**self**, **angular_velocity**) +Set the actor's angular velocity. + - **Parameters:** + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) +- **add_impulse**(**self**, **impulse**) +Add impulse to the actor. + - **Parameters:** + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) +- **set_simulate_physics**(**self**, **enabled**=True) +Enable or disable physics simulation on this actor. + - **Parameters:** + - `enabled` (_bool_) +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.ActorAttribute _class_ +Class that defines an attribute of a [carla.ActorBlueprint](#carla.ActorBlueprint). + +

Instance Variables

+- **id** (_str_) +The attribute's identifier. +- **type** (_[carla.ActorAttributeType](#carla.ActorAttributeType)_) +The attribute parameter type. +- **recommended_values** (_list(str)_) +List of recommended values that the attribute may have. +- **is_modifiable** (_bool_) +True if the attribute is modifiable. + +

Methods

+- **as_bool**(**self**) +- **as_int**(**self**) +- **as_float**(**self**) +- **as_str**(**self**) +- **as_color**(**self**) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) +- **\__nonzero__**(**self**) +- **\__bool__**(**self**) +- **\__int__**(**self**) +- **\__float__**(**self**) +- **\__str__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ActorBlueprint _class_ +Class that contains all the necessary information for spawning an Actor. + +

Instance Variables

+- **id** (_str_) +Actor blueprint identifier, e.g. `walker.pedestrian.0001`. +- **tags** (_list(str)_) +List of tags of an actor blueprint e.g. `['0001', 'pedestrian', 'walker']`. + +

Methods

+- **has_tag**(**self**, **tag**) +Returns `true` if an actor blueprint has the tag. + - **Parameters:** + - `tag` (_str_) – e.g. 'walker'. + - **Return:** _bool_ +- **match_tags**(**self**, **wildcard_pattern**) +Test if any of the flags or id matches wildcard_pattern. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _bool_ + - **Note:** _The wildcard_pattern follows Unix shell-style wildcards. +_ +- **has_attribute**(**self**, **id**) +Returns `true` if the blueprint contains the specified attribute. + - **Parameters:** + - `id` (_str_) – e.g 'gender'. + - **Return:** _bool_ +- **get_attribute**(**self**, **id**) +Returns the current actor attribute through its id. + - **Parameters:** + - `id` (_str_) + - **Return:** _[carla.ActorAttribute](#carla.ActorAttribute)_ +- **set_attribute**(**self**, **id**, **value**) +Sets an existing attribute to the actor's blueprint. + - **Parameters:** + - `id` (_str_) + - `value` (_str_) + - **Note:** _Attribute can only be set or changed if it is modifiable +_ +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__str__**(**self**) + +--- + +## carla.ActorSnapshot _class_ +Class that provides access to the data of a [carla.Actor](#carla.Actor) in a [carla.WorldSnapshot](#carla.WorldSnapshot). + +

Instance Variables

+- **id** (_int_) +The ActorSnapshot's identifier. + +

Methods

+- **get_transform**(**self**) +Returns the actor's current transform. + - **Return:** _[carla.Transform](#carla.Transform)_ +- **get_velocity**(**self**) +Returns the actor's current 3D velocity. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_angular_velocity**(**self**) +Returns the actor's current 3D angular velocity. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_acceleration**(**self**) +Returns the actor's current 3D acceleration. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__self__**(**self**) + +--- + +## carla.BoundingBox _class_ +Bounding box helper class. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +The center of the bounding box relative to its parent actor. +- **extent** (_[carla.Vector3D](#carla.Vector3D)_) +It contains the vector from the center of the bounding box to one of the vertex of the box. +So, if you want to know the _X bounding box size_, you can just do `extent.x * 2`. + +

Methods

+- **\__init__**(**self**, **location**, **extent**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `extent` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) +- **\__str__**(**self**) + +--- + +## carla.Client _class_ +Client used to connect to a Carla server. + +

Methods

+- **\__init__**(**self**, **host**, **port**, **worker_threads**=0) +Client constructor. + - **Parameters:** + - `host` (_str_) – IP address where a CARLA Simulator instance is running. + - `port` (_int_) – TCP port where the CARLA Simulator instance is running. + - `worker_threads` (_int_) – Number of working threads used for background updates. If 0, use all available concurrency. +- **set_timeout**(**self**, **seconds**) +Set the timeout in seconds allowed to block when doing networking calls. + - **Parameters:** + - `seconds` (_float_) – New timeout value in seconds. +- **get_client_version**(**self**) +Get the client version as a string. + - **Return:** _str_ +- **get_server_version**(**self**) +Get the server version as a string. + - **Return:** _str_ +- **get_world**(**self**) +Get the world currently active in the simulation. + - **Return:** _[carla.World](#carla.World)_ +- **get_available_maps**(**self**) +Get a list of strings of the maps available on server. The result can be something like: + '/Game/Carla/Maps/Town01' + '/Game/Carla/Maps/Town02' + '/Game/Carla/Maps/Town03' + '/Game/Carla/Maps/Town04' + '/Game/Carla/Maps/Town05' + '/Game/Carla/Maps/Town06' + '/Game/Carla/Maps/Town07'. + - **Return:** _list(str)_ +- **reload_world**(**self**) +Reload the current world, note that a new world is created with default settings using the same map. All actors present in the world will be destroyed. + - **Raises:** RuntimeError +- **load_world**(**self**, **map_name**) +Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed. + - **Parameters:** + - `map_name` (_str_) – Name of the map to load, accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. +- **start_recorder**(**self**, **filename**) +If we use a simple name like 'recording.log' then it will be saved at server folder 'CarlaUE4/Saved/recording.log'. If we use some folder in the name, then it will be considered to be an absolute path, like '/home/carla/recording.log'. + - **Parameters:** + - `filename` (_str_) – Name of the file to write the recorded data. +- **stop_recorder**(**self**) +Stops the recording in progress. +- **show_recorder_file_info**(**self**, **filename**, **show_all**) +Will show info about the recorded file (frames, times, events, state, positions...) We have the option to show all the details per frame, that includes all the traffic light states, position of all actors, and animations data. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `show_all` (_bool_) – Show all detailed info, or just a summary. +- **show_recorder_collisions**(**self**, **filename**, **category1**, **category2**) +This will show which collisions were recorded in the file. We can use a filter for the collisions we want, using two categories. The categories can be: + 'h' = Hero + 'v' = Vehicle + 'w' = Walker + 't' = Traffic light + 'o' = Other + 'a' = Any +So, if you want to see only collisions about a vehicle and a walker, we would use for category1 'v' and category2 'w'. Or if you want all the collisions (filter off) you can use 'a' as both categories. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `category1` (_single char_) – Character specifying the category of the first actor. + - `category2` (_single char_) – Character specifying the category of the second actor. +- **show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**) +Shows which actors seem blocked by some reason. The idea is to calculate which actors are not moving as much as 'min_distance' for a period of 'min_time'. By default min_time = 60 seconds (1 min) and min_distance = 100 centimeters (1 m). + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `min_time` (_float_) – How many seconds has to be stoped an actor to be considered as blocked. + - `min_distance` (_float_) – How many centimeters needs to move the actor in order to be considered as moving, and not blocked. +- **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**) +Playback a file. + - **Parameters:** + - `name` (_str_) – Name of the file. + - `start` (_float_) – Time in seconds where to start the playback. If it is negative, then it starts from the end. + - `duration` (_float_) – Id of the actor to follow. If this is 0 then camera is disabled. + - `follow_id` (_int_) +- **set_replayer_time_factor**(**self**, **time_factor**) +Apply a different playback speed to current playback. Can be used several times while a playback is in curse. + - **Parameters:** + - `time_factor` (_float_) – A value of 1.0 means normal time factor. A value < 1.0 means slow motion (for example 0.5 is half speed) A value > 1.0 means fast motion (for example 2.0 is double speed). +- **apply_batch**(**self**, **commands**) +This function executes the whole list of commands on a single simulation step. For example, to set autopilot on some actors, we could use: [sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126). We don't have control about the response of each command. If we need that, we can use `apply_batch_sync()`. + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. Each command has a different number of parameters. Currently, we can use these [commands](#command.ApplyAngularVelocity): + SpawnActor + DestroyActor + ApplyVehicleControl + ApplyWalkerControl + ApplyTransform + ApplyVelocity + AplyAngularVelocity + ApplyImpulse + SetSimulatePhysics + SetAutopilot. +- **apply_batch_sync**(**self**, **commands**, **due_tick_cue**) +This function executes the whole list of commands on a single simulation step, blocks until the commands are executed, and returns a list of [`command.Response`](#command.Response) that can be used to determine whether a single command succeeded or not. [sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116). + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. For a list of commands available see function above apply_batch(). + - `due_tick_cue` (_bool_) – A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. + - **Return:** _list_ + +--- + +## carla.CollisionEvent([carla.SensorData](#carla.SensorData)) _class_ +Class that defines a registered collision. + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that measured the collision. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +Get the actor to which we collided. +- **normal_impulse** (_[carla.Vector3D](#carla.Vector3D)_) +Normal impulse result of the collision. + +--- + +## carla.Color _class_ +Class that defines a 32-bit BGRA color. + +

Instance Variables

+- **r** (_int_) +Red color (0-255). +- **g** (_int_) +Green color (0-255). +- **b** (_int_) +Blue color (0-255). +- **a** (_int_) +Alpha channel (0-255). + +

Methods

+- **\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=255) +Client constructor. + - **Parameters:** + - `r` (_int_) + - `g` (_int_) + - `b` (_int_) + - `a` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__str__**(**self**) + +--- + +## carla.GearPhysicsControl _class_ +Class that provides access to vehicle transmission details. + +

Instance Variables

+- **ratio** (_float_) +The transmission ratio of the gear. +- **down_ratio** (_float_) +The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting down. +- **up_ratio** (_float_) +The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting up. + +

Methods

+- **\__init__**(**self**, **ratio**=1.0, **down_ratio**=0.5, **up_ratio**=0.65) + - **Parameters:** + - `ratio` (_float_) + - `down_ratio` (_float_) + - `up_ratio` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.GeoLocation _class_ +Class that contains geolocation simulated data. + +

Instance Variables

+- **latitude** (_float_) +North/South value of a point on the map. +- **longitude** (_float_) +West/East value of a point on the map. +- **altitude** (_float_) +Height regarding ground level. + +

Methods

+- **\__init__**(**self**, **latitude**=0.0, **longitude**=0.0, **altitude**=0.0) + - **Parameters:** + - `latitude` (_float_) + - `longitude` (_float_) + - `altitude` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) +- **\__str__**(**self**) + +--- + +## carla.Map _class_ +Map description that provides a Waypoint query system, that extracts the information from the OpenDRIVE file. + +

Instance Variables

+- **name** (_str_) +Map name. Comes from the Unreal's UMap name if loaded from a Carla server. + +

Methods

+- **\__init__**(**self**, **name**, **xodr_content**) +Constructor for this class useful if you want to use a `XODR` (OpenDRIVE) file without importing it from any Carla server running. + - **Parameters:** + - `name` (_str_) – Name of the current map. + - `xodr_content` (_str_) – XODR content as string. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **get_spawn_points**(**self**) +Returns a list of transformations corresponding to the recommended spawn points over the map. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **get_waypoint**(**self**, **location**, **project_to_road**=True, **lane_type**=[carla.LaneType.Driving](#carla.LaneType.Driving)) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Location where you want to get the [carla.Waypoint](#carla.Waypoint). + - `project_to_road` (_bool_) – If **True**, the waypoint will be at the center of the nearest lane. +If **False**, the waypoint will be at the given location. Also, in this second case, the result may be `None` if the waypoint is not found. + - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – This parameter is used to limit the search on a certain lane type. This can be used like a flag: `LaneType.Driving & LaneType.Shoulder`. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_topology**(**self**) +It provides a minimal graph of the topology of the current OpenDRIVE file. It is constituted by a list of pairs of waypoints, where the first waypoint is the origin and the second one is the destination. It can be loaded into [NetworkX](https://networkx.github.io/). A valid output could be: `[ (w0, w1), (w0, w2), (w1, w3), (w2, w3), (w0, w4) ]`. + - **Return:** _list(tuple([carla.Waypoint](#carla.Waypoint), [carla.Waypoint](#carla.Waypoint)))_ +- **generate_waypoints**(**self**, **distance**) +Returns a list of waypoints positioned on the center of the lanes all over the map with an approximate distance between them. + - **Parameters:** + - `distance` (_float_) – Approximate distance between the waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **transform_to_geolocation**(**self**, **location**) +Converts a given [carla.Location](#carla.Location) `(x, y, z)` to a [carla.GeoLocation](#carla.GeoLocation) `(lat, lon, alt)`. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Location to convert. + - **Return:** _[carla.GeoLocation](#carla.GeoLocation)_ +- **to_opendrive**(**self**) +Returns the OpenDRIVE of the current map as string. + - **Return:** _str_ +- **save_to_disk**(**self**, **path**) +Save the OpenDRIVE of the current map to disk. + - **Parameters:** + - `path` – Path where it will be saved. +- **\__str__**(**self**) + +--- + +## carla.RadarDetection _class_ +Data contained by a [carla.RadarMeasurement](#carla.RadarMeasurement). Represents an object detection produced by the Radar sensor. + +

Instance Variables

+- **velocity** (_float_) +The velocity of the detected object towards the sensor in meters per second. +- **azimuth** (_float_) +Azimuth angle of the detection in radians. +- **altitude** (_float_) +Altitude angle of the detection in radians. +- **depth** (_float_) +Distance in meters from the sensor to the detection position. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.Rotation _class_ +Class that represents a 3D rotation. All rotation angles are stored in degrees. + +![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg) _Unreal Engine's standard (from [UE4 docs](https://wiki.unrealengine.com/Blueprint_Rotating_Movement_Component))_. + +

Instance Variables

+- **pitch** (_float_) +Rotation about Y-axis. +- **yaw** (_float_) +Rotation about Z-axis. +- **roll** (_float_) +Rotation about X-axis. + +

Methods

+- **\__init__**(**self**, **pitch**=0.0, **yaw**=0.0, **roll**=0.0) + - **Parameters:** + - `pitch` (_float_) + - `yaw` (_float_) + - `roll` (_float_) +- **get_forward_vector**(**self**) +Computes a forward vector using the current rotation. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) +- **\__str__**(**self**) + +--- + +## carla.Timestamp _class_ +Class that contains Timestamp simulated data. + +

Instance Variables

+- **frame** (_int_) +The number of frames elapsed since the simulator was launched. +- **elapsed_seconds** (_float_) +Simulated seconds elapsed since the beginning of the current episode. +- **delta_seconds** (_float_) +Simulated seconds elapsed since the previous frame. +- **platform_timestamp** (_float_) +Time-stamp of the frame at which this measurement was taken, in seconds as given by the OS. + +

Methods

+- **\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**) + - **Parameters:** + - `frame` (_int_) + - `elapsed_seconds` (_float_) + - `delta_seconds` (_float_) + - `platform_timestamp` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__str__**(**self**) + +--- + +## carla.TrafficSign([carla.Actor](#carla.Actor)) _class_ +A traffic sign actor. + +

Instance Variables

+- **trigger_volume** +A [carla.BoundingBox](#carla.BoundingBox) situated near a traffic sign where the [carla.Actor](#carla.Actor) who is inside can know about its state. + +--- + +## carla.Transform _class_ +Class that defines a transformation without scaling. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +- **rotation** (_[carla.Rotation](#carla.Rotation)_) + +

Methods

+- **\__init__**(**self**, **location**, **rotation**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `rotation` (_[carla.Rotation](#carla.Rotation)_) +- **transform**(**self**, **in_point**) +Transform a 3D point using the current transformation. + - **Parameters:** + - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied. +- **get_forward_vector**(**self**) +Computes a forward vector using the rotation of the current transformation. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) +- **\__str__**(**self**) + +--- + +## carla.Vector2D _class_ +Vector 2D helper class. + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) +- **\__add__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__mul__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__sub__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__truediv__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__self__**(**self**) + +--- + +## carla.Vector3D _class_ +Vector 3D helper class. + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) +- **z** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **\__add__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__mul__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__sub__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__truediv__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__str__**(**self**) + +--- + +## carla.VehicleControl _class_ +VehicleControl is used for controlling the basic movement of a vehicle. + +

Instance Variables

+- **throttle** (_float_) +A scalar value to control the vehicle throttle [0.0, 1.0]. +- **steer** (_float_) +A scalar value to control the vehicle steering [-1.0, 1.0]. +- **brake** (_float_) +A scalar value to control the vehicle brake [0.0, 1.0]. +- **hand_brake** (_bool_) +If true, hand brake will be used. +- **reverse** (_bool_) +If true, the vehicle will move reverse. +- **manual_gear_shift** (_bool_) +If true, the vehicle will be controlled by changing gears manually. +- **gear** (_int_) +Controls the gear value of the vehicle. + +

Methods

+- **\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=True, **reverse**=True, **manual_gear_shift**=True, **gear**=0) +VehicleControl constructor. + - **Parameters:** + - `throttle` (_float_) + - `steer` (_float_) + - `brake` (_float_) + - `hand_brake` (_bool_) + - `reverse` (_bool_) + - `manual_gear_shift` (_bool_) + - `gear` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__str__**(**self**) + +--- + +## carla.VehiclePhysicsControl _class_ +VehiclePhysicsControl is used for controlling the physics parameters of a vehicle. + +

Instance Variables

+- **torque_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the torque measured in Nm for a specific RPM of the vehicle's engine. +- **max_rpm** (_float_) +The maximum RPM of the vehicle's engine. +- **moi** (_float_) +The moment of inertia of the vehicle's engine. +- **damping_rate_full_throttle** (_float_) +Damping rate when the throttle is maximum. +- **damping_rate_zero_throttle_clutch_engaged** (_float_) +Damping rate when the throttle is zero with clutch engaged. +- **damping_rate_zero_throttle_clutch_disengaged** (_float_) +Damping rate when the throttle is zero with clutch disengaged. +- **use_gear_autobox** (_bool_) +If true, the vehicle will have an automatic transmission. +- **gear_switch_time** (_float_) +Switching time between gears. +- **clutch_strength** (_float_) +The clutch strength of the vehicle. Measured in Kgm^2/s. +- **final_ratio** (_float_) +The fixed ratio from transmission to wheels. +- **forward_gears** (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) +List of GearPhysicsControl objects. +- **mass** (_float_) +The mass of the vehicle measured in Kg. +- **drag_coefficient** (_float_) +Drag coefficient of the vehicle's chassis. +- **center_of_mass** (_[carla.Vector3D](#carla.Vector3D)_) +The center of mass of the vehicle. +- **steering_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the maximum steering for a specific forward speed. +- **wheels** (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) +List of [carla.WheelPhysicsControl](#carla.WheelPhysicsControl) objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels. + +

Methods

+- **\__init__**(**self**, **torque_curve**=[[0.0, 500.0], [5000.0, 500.0]], **max_rpm**=5000.0, **moi**=1.0, **damping_rate_full_throttle**=0.15, **damping_rate_zero_throttle_clutch_engaged**=2.0, **damping_rate_zero_throttle_clutch_disengaged**=0.35, **use_gear_autobox**=True, **gear_switch_time**=0.5, **clutch_strength**=10.0, **final_ratio**=4.0, **forward_gears**=list(), **mass**=1000.0, **drag_coefficient**=0.3, **center_of_mass**=[0.0, 0.0, 0.0], **steering_curve**=[[0.0, 1.0], [10.0, 0.5]], **wheels**=list()) +VehiclePhysicsControl constructor. + - **Parameters:** + - `torque_curve` (_list([carla.Vector2D](#carla.Vector2D))_) + - `max_rpm` (_float_) + - `moi` (_float_) + - `damping_rate_full_throttle` (_float_) + - `damping_rate_zero_throttle_clutch_engaged` (_float_) + - `damping_rate_zero_throttle_clutch_disengaged` (_float_) + - `use_gear_autobox` (_bool_) + - `gear_switch_time` (_float_) + - `clutch_strength` (_float_) + - `final_ratio` (_float_) + - `forward_gears` (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) + - `drag_coefficient` (_float_) + - `center_of_mass` (_[carla.Vector3D](#carla.Vector3D)_) + - `steering_curve` (_[carla.Vector2D](#carla.Vector2D)_) + - `wheels` (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.WalkerAIController([carla.Actor](#carla.Actor)) _class_ +Class used for controlling the automation of a pedestrian. + +

Methods

+- **start**(**self**) +Initializes walker controller. +- **stop**(**self**) +Stops walker controller. +- **go_to_location**(**self**, **destination**) +Sets the destination that the pedestrian will reach. + - **Parameters:** + - `destination` (_[carla.Location](#carla.Location)_) +- **set_max_speed**(**self**, **speed**=1.4) +Sets the speed of the pedestrian. + - **Parameters:** + - `speed` (_float_) – Speed is in m/s. +- **\__str__**(**self**) + +--- + +## carla.WalkerBoneControl _class_ +Class used for controlling the skeleton of a walker. See [walker bone control](../tuto_G_control_walker_skeletons.md). + +

Instance Variables

+- **bone_transforms** (_list([name,transform])_) +List of pairs where the first value is the bone name and the second value is the bone transform. + +

Methods

+- **\__init__**(**self**, **list(name,transform)**) + - **Parameters:** + - `list(name,transform)` (_tuple_) +- **\__str__**(**self**) + +--- + +## carla.WalkerControl _class_ +WalkerControl is used for controlling the basic movement of a walker. + +

Instance Variables

+- **direction** (_[carla.Vector3D](#carla.Vector3D)_) +Vector that controls the direction of the walker. +- **speed** (_float_) +A scalar value to control the walker speed. +- **jump** (_bool_) +If true, the walker will perform a jump. + +

Methods

+- **\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False) +WalkerControl constructor. + - **Parameters:** + - `direction` (_[carla.Vector3D](#carla.Vector3D)_) + - `speed` (_float_) + - `jump` (_bool_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__str__**(**self**) + +--- + +## carla.Waypoint _class_ +3D directed point that stores information about the road definition provided by OpenDRIVE. + +

Instance Variables

+- **id** (_int_) +Waypoint id, it's generated using a hash combination of its `road_id`, `section_id`, `lane_id` and `s` values, all them come from the OpenDRIVE. The `s` precision is set to 2 centimeters, so 2 waypoints at a distance `s` less than 2 centimeters in the same road, section and lane, will have the same `id`. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transform indicating it's position and orientation according to the current lane information. +- **is_intersection** (_bool_) +_Deprecated, use is_junction instead_. +- **is_junction** (_bool_) +True if the current Waypoint is on a junction. +- **lane_width** (_float_) +Horizontal size of the road at current `s`. +- **road_id** (_int_) +OpenDRIVE road's id. +- **section_id** (_int_) +OpenDRIVE section's id, based on the order that they are originally defined. +- **lane_id** (_int_) +OpenDRIVE lane's id, this value can be positive or negative which represents the direction of the current lane with respect to the road. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20). +- **s** (_float_) +OpenDRIVE `s` value of the current position. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Lane change definition of the current Waypoint's location, based on the traffic rules defined in the OpenDRIVE file. Basically, it tells you if a lane change can be done and in which direction. +- **lane_type** (_[carla.LaneType](#carla.LaneType)_) +The lane type of the current Waypoint, based on OpenDRIVE types. +- **right_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The right lane marking information based on the direction of the Waypoint. +- **left_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The left lane marking information based on the direction of the Waypoint. + +

Methods

+- **next**(**self**, **distance**) +Returns a list of Waypoints at a certain approximate distance from the current Waypoint, taking into account the shape of the road and its possible deviations, without performing any lane change. +The list may be empty if the road ends before the specified distance, for instance, a lane ending with the only option of incorporating to another road. + - **Parameters:** + - `distance` (_float_) – The approximate distance where to get the next Waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **get_right_lane**(**self**) +Generates a Waypoint at the center of the right lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. +Can return `None` if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_left_lane**(**self**) +Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. +Can return `None` if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **\__str__**(**self**) + +--- + +## carla.WeatherParameters _class_ +WeatherParameters class is used for requesting and changing the lighting and weather conditions inside the world. + +

Instance Variables

+- **cloudiness** (_float_) +Weather cloudiness. Values range from 0 to 100. +- **precipitation** (_float_) +Precipitation amount for controlling rain intensity. Values range from 0 to 100. +- **precipitation_deposits** (_float_) +Precipitation deposits for controlling the area of puddles on roads. Values range from 0 to 100. +- **wind_intensity** (_float_) +Wind intensity. Values range from 0 to 100. +- **sun_azimuth_angle** (_float_) +The azimuth angle of the sun in degrees. Values range from 0 to 360. +- **sun_altitude_angle** (_float_) +Altitude angle of the sun in degrees. Values range from -90 to 90. + +

Methods

+- **\__init__**(**self**, **cloudiness**=0.0, **precipitation**=0.0, **precipitation_deposits**=0.0, **wind_intensity**=0.0, **sun_azimuth_angle**=0.0, **sun_altitude_angle**=0.0) +WeatherParameters constructor. + - **Parameters:** + - `cloudiness` (_float_) + - `precipitation` (_float_) + - `precipitation_deposits` (_float_) + - `wind_intensity` (_float_) + - `sun_azimuth_angle` (_float_) + - `sun_altitude_angle` (_float_) +- **\__eq__**(**self**, **other**) +Returns True if `self` and `other` are equal. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns True if `self` and `other` are not equal. + - **Return:** _bool_ +- **\__str__**(**self**) + +--- + +## carla.WheelPhysicsControl _class_ +WheelPhysicsControl is used for controlling the physics parameters of a vehicle's wheel. + +

Instance Variables

+- **tire_friction** (_float_) +A scalar value that indicates the friction of the wheel. +- **damping_rate** (_float_) +The damping rate of the wheel. +- **max_steer_angle** (_float_) +The maximum angle in degrees that the wheel can steer. +- **radius** (_float_) +The radius of the wheel in centimeters. +- **max_brake_torque** (_float_) +The maximum brake torque in Nm. +- **max_handbrake_torque** (_float_) +The maximum handbrake torque in Nm. +- **position** (_[carla.Vector3D](#carla.Vector3D)_) +World position of the wheel. Note that it is a read-only parameter. + +

Methods

+- **\__init__**(**self**, **tire_friction**=2.0, **damping_rate**=0.25, **max_steer_angle**=70.0, **radius**=30.0, **max_brake_torque**=1500.0, **max_handbrake_torque**=3000.0, **position**=(0.0,0.0,0.0)) +WheelPhysicsControl constructor. + - **Parameters:** + - `tire_friction` (_float_) + - `damping_rate` (_float_) + - `max_steer_angle` (_float_) + - `radius` (_float_) + - `max_brake_torque` (_float_) + - `max_handbrake_torque` (_float_) + - `position` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.World _class_ +Class that contains the current loaded map. + +

Instance Variables

+- **id** (_int_) +The id of the episode associated with this world. +- **debug** (_[carla.DebugHelper](#carla.DebugHelper)_) + +

Methods

+- **get_blueprint_library**(**self**) +Return the list of blueprints available in this world. These blueprints can be used to spawn actors into the world. + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ +- **get_map**(**self**) +Return the map that describes this world. + - **Return:** _[carla.Map](#carla.Map)_ +- **get_spectator**(**self**) +Return the spectator actor. The spectator controls the view in the simulator window. + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_settings**(**self**) + - **Return:** _[carla.WorldSettings](#carla.WorldSettings)_ +- **apply_settings**(**self**, **world_settings**) +Returns the id of the frame when the settings took effect. + - **Parameters:** + - `world_settings` (_[carla.WorldSettings](#carla.WorldSettings)_) + - **Return:** _int_ +- **get_weather**(**self**) +Retrieve the weather parameters currently active in the world. + - **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_ +- **set_weather**(**self**, **weather**) +Change the weather in the simulation. + - **Parameters:** + - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) +- **get_snapshot**(**self**) +Return a snapshot of the world at this moment. + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ +- **get_actor**(**self**, **actor_id**) +Find actor by id, return None if not found. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_random_location_from_navigation**(**self**) +Retrieve a random location to be used as a destination for walkers in [carla.WalkerAIController.go_to_location](#carla.WalkerAIController.go_to_location). See [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example. + - **Return:** _[carla.Location](#carla.Location)_ +- **get_actors**(**self**) +By default it returns a list with every actor present in the world. _A list of ids can be used as a parameter_. + - **Return:** _[carla.ActorList](#carla.ActorList)_ +- **spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +Spawn an actor into the world based on the blueprint provided at transform. If a parent is provided, the actor is attached to parent. + - **Parameters:** + - `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_) + - `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor. + - `attach_to` (_[carla.Actor](#carla.Actor)_) + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +Same as SpawnActor but return none on failure instead of throwing an exception. + - **Parameters:** + - `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_) + - `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor. + - `attach_to` (_[carla.Actor](#carla.Actor)_) + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **wait_for_tick**(**self**, **seconds**=10.0) +Block calling thread until a world tick is received. + - **Parameters:** + - `seconds` (_float_) + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ +- **on_tick**(**self**, **callback**) +Returns the ID of the callback so it can be removed with `remove_on_tick`. + - **Parameters:** + - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) + - **Return:** _int_ +- **remove_on_tick**(**self**, **callback_id**) +Removes on tick callbacks. +- **tick**(**self**) +Synchronizes with the simulator and returns the id of the newly started frame (only has effect on synchronous mode). + - **Return:** _int_ +- **\__str__**(**self**) + +--- + +## carla.WorldSettings _class_ +Class that provides access to modifiable world settings. Check it out in our [section](../configuring_the_simulation/). + +

Instance Variables

+- **synchronous_mode** (_bool_) +- **no_rendering_mode** (_bool_) +- **fixed_delta_seconds** (_float_) + +

Methods

+- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0) + - **Parameters:** + - `synchronous_mode` (_bool_) + - `no_rendering_mode` (_bool_) + - `fixed_delta_seconds` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__str__**(**self**) + +--- + +## carla.WorldSnapshot _class_ +Class that represents the state of every actor in the simulation at a single frame. + +

Instance Variables

+- **id** (_int_) +The WorldSnapshot's identifier. +- **frame** (_int_) +Frame number. +- **timestamp** (_[carla.Timestamp](#carla.Timestamp)_) +Timestamp simulated data. + +

Methods

+- **has_actor**(**self**, **actor_id**) +Check if an actor is present in this snapshot. + - **Parameters:** + - `actor_id` (_int_) +- **find**(**self**, **actor_id**) +Find an ActorSnapshot by id, return None if the actor is not found. + - **Parameters:** + - `actor_id` (_int_) +- **\__len__**(**self**) +Return number of [carla.ActorSnapshot](#carla.ActorSnapshot) present in this [carla.WorldSnapshot](#carla.WorldSnapshot). + - **Return:** _int_ +- **\__iter__**(**self**) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) +- **\__self__**(**self**) + +--- + +## carla.GnssMeasurement([carla.SensorData](#carla.SensorData)) _class_ +Gnss sensor data. + +

Instance Variables

+- **latitude** (_float_) +North/South value of a point on the map. +- **longitude** (_float_) +West/East value of a point on the map. +- **altitude** (_float_) +Height regarding ground level. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.IMUMeasurement([carla.SensorData](#carla.SensorData)) _class_ +IMU sensor data regarding the sensor World's transformation. + +

Instance Variables

+- **accelerometer** (_[carla.Vector3D](#carla.Vector3D)_) +Measures linear acceleration in `m/s^2`. +- **gyroscope** (_[carla.Vector3D](#carla.Vector3D)_) +Measures angular velocity in `rad/sec`. +- **compass** (_float_) +Orientation with respect to the North (`(0.0, -1.0, 0.0)` in Unreal) in radians. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.Image([carla.SensorData](#carla.SensorData)) _class_ +Class that defines an image of 32-bit BGRA colors. + +

Instance Variables

+- **width** (_int_) +Image width in pixels. +- **height** (_int_) +Image height in pixels. +- **fov** (_float_) +Horizontal field of view of the image in degrees. +- **raw_data** (_bytes_) + +

Methods

+- **convert**(**self**, **color_converter**) +Convert the image with the applied conversion. + - **Parameters:** + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) +- **save_to_disk**(**self**, **path**, **color_converter**=Raw) +Save the image to disk. + - **Parameters:** + - `path` (_str_) – Path where it will be saved. + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **color**) + - **Parameters:** + - `pos` (_int_) + - `color` (_[carla.Color](#carla.Color)_) +- **\__str__**(**self**) + +--- + +## carla.LaneInvasionEvent([carla.SensorData](#carla.SensorData)) _class_ +Lane invasion sensor data. + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that invaded another lane. +- **crossed_lane_markings** (_list([carla.LaneMarking](#carla.LaneMarking))_) +List of lane markings that have been crossed. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.LidarMeasurement([carla.SensorData](#carla.SensorData)) _class_ +Lidar sensor measurement data. + +

Instance Variables

+- **horizontal_angle** (_float_) +Horizontal angle that the Lidar has rotated at the time of the measurement (in radians). +- **channels** (_int_) +Number of lasers. +- **raw_data** (_bytes_) +List of 3D points. + +

Methods

+- **get_point_count**(**self**, **channel**) +Retrieve the number of points that are generated by this channel. + - **Parameters:** + - `channel` (_int_) + - **Note:** _Points are sorted by channel, so this method allows to identify the channel that generated each point. +_ +- **save_to_disk**(**self**, **path**) +Save point cloud to disk. + - **Parameters:** + - `path` (_str_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **location**) + - **Parameters:** + - `pos` (_int_) + - `location` (_[carla.Location](#carla.Location)_) +- **\__str__**(**self**) + +--- + +## carla.Location([carla.Vector3D](#carla.Vector3D)) _class_ +Represents a location in the world (in meters). + +

Instance Variables

+- **x** (_float_) +- **y** (_float_) +- **z** (_float_) + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **distance**(**self**, **location**) +Computes the Euclidean distance in meters from this location to another one. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – The Location from where to compute the distance. + - **Return:** _float_ +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) +- **\__str__**(**self**) + +--- + +## carla.ObstacleDetectionEvent([carla.SensorData](#carla.SensorData)) _class_ +Obstacle detection sensor data. + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Get "self" actor. Actor that measured the collision. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +Get the actor to which we collided. +- **distance** (_float_) +Get obstacle distance. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.RadarMeasurement([carla.SensorData](#carla.SensorData)) _class_ +Measurement produced by a Radar. Consists of an array of [carla.RadarDetection](#carla.RadarDetection). + +

Instance Variables

+- **raw_data** (_bytes_) +List of [carla.RadarDetection](#carla.RadarDetection). + +

Methods

+- **get_detection_count**(**self**) +Retrieve the number of [carla.RadarDetection](#carla.RadarDetection) that are generated. +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **detection**) + - **Parameters:** + - `pos` (_int_) + - `detection` (_[carla.RadarDetection](#carla.RadarDetection)_) +- **\__str__**(**self**) + +--- + +## carla.Sensor([carla.Actor](#carla.Actor)) _class_ +A sensor actor. + +

Instance Variables

+- **is_listening** (_boolean_) +Is true if the sensor is listening for data. + +

Methods

+- **listen**(**self**, **callback**) + - **Parameters:** + - `callback` (_function_) – Register a callback to be executed each time a new measurement is received. The callback must accept a single argument containing the sensor data; the type of this object varies depending on the type of sensor, but they all derive from [carla.SensorData](#carla.SensorData). +- **stop**(**self**) +Stops listening for data. +- **\__str__**(**self**) + +--- + +## carla.TrafficLight([carla.TrafficSign](#carla.TrafficSign)) _class_ +A traffic light actor. Check out this [`recipe`](../python_cookbook/#traffic-lights-recipe)! + +

Instance Variables

+- **state** (_[carla.TrafficLightState](#carla.TrafficLightState)_) +Current traffic light state. + +

Methods

+- **set_state**(**self**, **state**) +Sets a given state to a traffic light actor. + - **Parameters:** + - `state` (_[carla.TrafficLightState](#carla.TrafficLightState)_) +- **get_state**(**self**) +Returns the current state of the traffic light. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_green_time**(**self**, **green_time**) + - **Parameters:** + - `green_time` (_float_) – Sets a given time (in seconds) to the green state to be active. +- **get_green_time**(**self**) +Returns the current time set for the green light to be active. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_yellow_time**(**self**, **yellow_time**) +Sets a given time (in seconds) to the yellow state to be active. + - **Parameters:** + - `yellow_time` (_float_) +- **get_yellow_time**(**self**) +Returns the current time set for the yellow light to be active. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **set_red_time**(**self**, **red_time**) +Sets a given time (in seconds) to the red state to be active. + - **Parameters:** + - `red_time` (_float_) +- **get_red_time**(**self**) +Returns the current time set for the red light to be active. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_elapsed_time**(**self**) +Returns the current countdown of the state of a traffic light. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **freeze**(**self**, **freeze**) +Stops the traffic light at its current state. + - **Parameters:** + - `freeze` (_bool_) +- **is_frozen**(**self**) +Returns `True` if a traffic light is frozen. + - **Return:** _bool_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_pole_index**(**self**) +Returns the index of the pole in the traffic light group. + - **Return:** _int_ +- **get_group_traffic_lights**(**self**) +Returns all traffic lights in the group this one belongs to. + - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ + - **Note:** _This function calls the simulator. +_ +- **\__str__**(**self**) + +--- + +## carla.Vehicle([carla.Actor](#carla.Actor)) _class_ +A vehicle actor. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The vehicle's bounding box. + +

Methods

+- **apply_control**(**self**, **control**) +Apply control to this vehicle. The control will take effect on next tick. + - **Parameters:** + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **get_control**(**self**) +Returns the control last applied to this vehicle. + - **Return:** _[carla.VehicleControl](#carla.VehicleControl)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **apply_physics_control**(**self**, **physics_control**) +Apply physics control to this vehicle. The control will take effect on the next tick. + - **Parameters:** + - `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **get_physics_control**(**self**) +Returns the physics control last applied to this vehicle. + - **Return:** _[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_ + - **Warning:** _This function does call the simulator to retrieve the value._ +- **set_autopilot**(**self**, **enabled**=True) +Switch on/off this vehicle's server-side autopilot. + - **Parameters:** + - `enabled` (_bool_) +- **get_speed_limit**(**self**) +Returns the speed limit currently affecting this vehicle. Note that the speed limit is only updated when passing by a speed limit signal, right after spawning a vehicle it might not reflect the actual speed limit of the current road. + - **Return:** _float_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_traffic_light_state**(**self**) +Returns the state of the traffic light currently affecting this vehicle. If no traffic light is currently affecting the vehicle, return Green. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **is_at_traffic_light**(**self**) +Returns whether a traffic light is affecting this vehicle. + - **Return:** _bool_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **get_traffic_light**(**self**) +Retrieve the traffic light actor currently affecting this vehicle. + - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.Walker([carla.Actor](#carla.Actor)) _class_ +A walking actor, pedestrian. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The walker's bounding box. + +

Methods

+- **apply_control**(**self**, **control**) +Apply control to this walker. + - **Parameters:** + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) + - **Note:** _The control will take effect on the next tick. +_ +- **apply_control**(**self**, **control**) +Apply bone control to this walker. + - **Parameters:** + - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_) + - **Note:** _The control will take effect on the next tick. +_ +- **get_control**(**self**) +Returns the control last applied to this walker. + - **Return:** _[carla.WalkerControl](#carla.WalkerControl)_ + - **Note:** _This function does not call the simulator, it returns the data received in the last tick. +_ +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## command.ApplyAngularVelocity _class_ +Set the actor's angular velocity. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **angular_velocity** (_[carla.Vector3D](#carla.Vector3D)_) +The 3D angular velocity that will be applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **angular_velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyImpulse _class_ +Adds impulse to the actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **impulse** (_[carla.Vector3D](#carla.Vector3D)_) +Impulse applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **impulse**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyTransform _class_ +Sets a new transform to the actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transformation to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **transform**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `transform` (_[carla.Transform](#carla.Transform)_) + +--- + +## command.ApplyVehicleControl _class_ +Apply control to the vehicle. + +

Instance Variables

+- **actor_id** (_int_) +Vehicle actor affected by the command. +- **control** (_[carla.VehicleControl](#carla.VehicleControl)_) +Vehicle control to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) + +--- + +## command.ApplyVelocity _class_ +Sets actor's velocity. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **velocity** (_[carla.Vector3D](#carla.Vector3D)_) +The 3D velocity applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyWalkerControl _class_ +Apply control to the walker. + +

Instance Variables

+- **actor_id** (_int_) +Walker actor affected by the command. +- **control** (_[carla.VehicleControl](#carla.VehicleControl)_) +Walker control to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) + +--- + +## command.ApplyWalkerState _class_ +Apply a state to the walker actor. + +

Instance Variables

+- **actor_id** (_int_) +Walker actor affected by the command. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transform to be applied. +- **speed** (_float_) +Speed to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **transform**, **speed**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `transform` (_[carla.Transform](#carla.Transform)_) + - `speed` (_float_) + +--- + +## command.DestroyActor _class_ +Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. It has no effect if the Actor was already successfully destroyed. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. + +

Methods

+- **\__init__**(**self**, **actor**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + +--- + +## command.Response _class_ +Execution result of a command, contains either an error string or an actor ID, depending on whether or not the command succeeded. See [carla.Client.apply_batch_sync](#carla.Client.apply_batch_sync). + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **error** (_str_) + +

Methods

+- **has_error**(**self**) + +--- + +## command.SetAutopilot _class_ +Switch on/off vehicle's server-side autopilot. + +

Instance Variables

+- **actor_id** (_int_) +Actor that is affected by the command. +- **enabled** (_bool_) +If the autopilot is enabled or not. + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `enabled` (_bool_) + +--- + +## command.SetSimulatePhysics _class_ +Whether an actor will be affected by physics or not. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **enabled** (_bool_) +If physics will affect the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) + - `enabled` (_bool_) + +--- + +## command.SpawnActor _class_ +Spawn an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to parent. + +

Instance Variables

+- **transform** (_[carla.Transform](#carla.Transform)_) +Transform to be applied. +- **parent_id** (_int_) +Parent's actor id. + +

Methods

+- **\__init__**(**self**) +- **\__init__**(**self**, **blueprint**, **transform**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) +- **\__init__**(**self**, **blueprint**, **transform**, **parent**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) + - `parent` (_[carla.Actor](#carla.Actor) or int_) +- **then**(**self**, **command**) +Link another command to be executed right after. + - **Parameters:** + - `command` (_[carla.Command](#carla.Command)_) – CommandType. + +--- \ No newline at end of file diff --git a/Docs/APIs/python_api_098.md b/Docs/APIs/python_api_098.md new file mode 100644 index 000000000..a9f7deeb1 --- /dev/null +++ b/Docs/APIs/python_api_098.md @@ -0,0 +1,2326 @@ +# Python API reference (0.9.8) + +This reference contains all the details about the Python API as it was for __CARLA 0.9.8__. + +
+

+ +Back to latest +

+
+ +## carla.Actor +CARLA defines actors as anything that plays a role in the simulation or can be moved around. That includes: pedestrians, vehicles, sensors and traffic signs (considering traffic lights as part of these). Actors are spawned in the simulation by [carla.World](#carla.World) and they need for a [carla.ActorBlueprint](#carla.ActorBlueprint) to be created. These blueprints belong into a library provided by CARLA, find more about them [here](../bp_library.md). + +

Instance Variables

+- **attributes** (_dict_) +A dictionary containing the attributes of the blueprint this actor was based on. +- **id** (_int_) +Identifier for this actor. Unique during a given episode. +- **parent** (_[carla.Actor](#carla.Actor)_) +Actors may be attached to a parent actor that they will follow around. This is said actor. +- **semantic_tags** (_list(int)_) +A list of semantic tags provided by the blueprint listing components for this actor. E.g. a traffic light could be tagged with "pole" and "traffic light". These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](../ref_sensors.md#semantic-segmentation-camera). +- **type_id** (_str_) +The identifier of the blueprint this actor was based on, e.g. "vehicle.ford.mustang". + +

Methods

+- **\__str__**(**self**) +Parses a summary of this actor's information to string. + - **Return:** _str_ +- **add_impulse**(**self**, **impulse**) +Adds an impulse to the actor. + - **Parameters:** + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) +- **destroy**(**self**) +Tells the simulator to destroy this actor and returns True if it was successful. It has no effect if it was already destroyed. + - **Return:** _bool_ + - **Warning:** _This method blocks the script until the destruction is completed by the simulator. +_ +- **get_acceleration**(**self**) +Returns the actor's 3D acceleration vector the client recieved during last tick. The method does not call the simulator. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_angular_velocity**(**self**) +Returns the actor's angular velocity vector the client recieved during last tick. The method does not call the simulator. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_location**(**self**) +Returns the actor's location the client recieved during last tick. The method does not call the simulator. + - **Return:** _[carla.Location](#carla.Location)_ +- **get_transform**(**self**) +Returns the actor's transform (location and rotation) the client recieved during last tick. The method does not call the simulator. + - **Return:** _[carla.Transform](#carla.Transform)_ +- **get_velocity**(**self**) +Returns the actor's velocity vector the client recieved during last tick. The method does not call the simulator. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_world**(**self**) +Returns the world this actor belongs to. + - **Return:** _[carla.World](#carla.World)_ +- **set_angular_velocity**(**self**, **angular_velocity**) +Changes the actor's angular velocity vector. + - **Parameters:** + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) +- **set_location**(**self**, **location**) +Teleports the actor to a given location. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) +- **set_simulate_physics**(**self**, **enabled**=True) +Enables or disables the simulation of physics on this actor. + - **Parameters:** + - `enabled` (_bool_) +- **set_transform**(**self**, **transform**) +Teleports the actor to a given transform (location and rotation). + - **Parameters:** + - `transform` (_[carla.Transform](#carla.Transform)_) +- **set_velocity**(**self**, **velocity**) +Sets the actor's velocity vector. + - **Parameters:** + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## carla.ActorAttribute +CARLA provides a library of blueprints for actors that can be accessed as [carla.BlueprintLibrary](#carla.BlueprintLibrary). Each of these blueprints has a series of attributes defined internally. Some of these are modifiable, others are not. A list of recommended values is provided for those that can be set. + +

Instance Variables

+- **id** (_str_) +The attribute's name and identifier in the library. +- **type** (_[carla.ActorAttributeType](#carla.ActorAttributeType)_) +The attribute's parameter type. +- **recommended_values** (_list(str)_) +A list of values suggested by those who designed the blueprint. +- **is_modifiable** (_bool_) +It is True if the attribute's value can be modified. + +

Methods

+- **as_bool**(**self**) +Reads the attribute as boolean value. +- **as_color**(**self**) +Reads the attribute as [carla.Color](#carla.Color). +- **as_int**(**self**) +Reads the attribute as int. +- **as_float**(**self**) +Reads the attribute as float. +- **as_str**(**self**) +Reads the attribute as string. +- **\__bool__**(**self**) +Internal method to manage the attribute as bool. +- **\__int__**(**self**) +Internal method to manage the attribute as int. +- **\__float__**(**self**) +Internal method to manage the attribute as float. +- **\__str__**(**self**) +Parses the attribute ID and its value to string. +- **\__eq__**(**self**, **other**) +Returns true if this actor's attribute and `other` are the same. + - **Parameters:** + - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if this actor's attribute and `other` are different. + - **Parameters:** + - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) + - **Return:** _bool_ +- **\__nonzero__**(**self**) +Returns true if this actor's attribute is not zero or null. + - **Return:** _bool_ + +--- + +## carla.ActorAttributeType +CARLA provides a library of blueprints for actors in [carla.BlueprintLibrary](#carla.BlueprintLibrary) with different attributes each. This class defines the types those at [carla.ActorAttribute](#carla.ActorAttribute) can be as a series of enum. All this information is managed internally and listed here for a better comprehension of how CARLA works. + +

Instance Variables

+- **Bool** +- **Int** +- **Float** +- **RGBColor** +- **String** + +--- + +## carla.ActorBlueprint +CARLA provides a blueprint library for actors that can be consulted through [carla.BlueprintLibrary](#carla.BlueprintLibrary). Each of these consists of an identifier for the blueprint and a series of attributes that may be modifiable or not. This class is the intermediate step between the library and the actor creation. Actors need an actor blueprint to be spawned. These store the information for said blueprint in an object with its attributes and some tags to categorize them. The user can then customize some attributes and eventually spawn the actors through [carla.World](#carla.World). + +

Instance Variables

+- **id** (_str_) +The identifier of said blueprint inside the library. E.g. `walker.pedestrian.0001`. +- **tags** (_list(str)_) +A list of tags each blueprint has that helps describing them. E.g. `['0001', 'pedestrian', 'walker']`. + +

Methods

+- **\__iter__**(**self**) +Allows iteration within this class. +- **\__len__**(**self**) +Returns the amount of attributes for this blueprint. +- **\__str__**(**self**) +Parses the information of this blueprint to string. +- **has_attribute**(**self**, **id**) +Returns True if the blueprint contains the attribute `id`. + - **Parameters:** + - `id` (_str_) – e.g. `gender` would return **True** for pedestrians' blueprints. + - **Return:** _bool_ +- **has_tag**(**self**, **tag**) +Returns True if the blueprint has the specified `tag` listed. + - **Parameters:** + - `tag` (_str_) – e.g. 'walker'. + - **Return:** _bool_ +- **match_tags**(**self**, **wildcard_pattern**) +Returns True if any of the tags listed for this blueprint matches `wildcard_pattern`. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _bool_ +- **get_attribute**(**self**, **id**) +Returns the actor's attribute with `id` as identifier if existing. + - **Parameters:** + - `id` (_str_) + - **Return:** _[carla.ActorAttribute](#carla.ActorAttribute)_ +- **set_attribute**(**self**, **id**, **value**) +If the `id` attribute is modifiable, changes its value to `value`. + - **Parameters:** + - `id` (_str_) – The identifier for the attribute that is intended to be changed. + - `value` (_str_) – The new value for said attribute. + +--- + +## carla.ActorList +A class that contains every actor present on the scene and provides access to them. The list is automatically created and updated by the server and it can be returned using [carla.World](#carla.World). + +

Methods

+- **\__getitem__**(**self**, **pos**) +Returns the actor corresponding to `pos` position in the list. + - **Parameters:** + - `pos` (_int_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **\__iter__**(**self**) +Allows the iteration for this object. +- **\__len__**(**self**) +Returns the amount of actors listed. + - **Return:** _int_ +- **\__str__**(**self**) +Parses to the ID for every actor listed. + - **Return:** _str_ +- **filter**(**self**, **wildcard_pattern**) +Filters a list of Actors matching `wildcard_pattern` against their variable **type_id** (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _list_ +- **find**(**self**, **actor_id**) +Finds an actor using its identifier and returns it or None if it is not present. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _[carla.Actor](#carla.Actor)_ + +--- + +## carla.ActorSnapshot +A class that comprises all the information for an actor at a certain moment in time. These objects are contained in a [carla.WorldSnapshot](#carla.WorldSnapshot) and sent to the client once every tick. + +

Instance Variables

+- **id** (_int_) +An identifier for the snapshot itself. + +

Methods

+- **get_acceleration**(**self**) +Returns the acceleration vector registered for an actor in that tick. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_angular_velocity**(**self**) +Returns the angular velocity vector registered for an actor in that tick. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **get_transform**(**self**) +Returns the actor's transform (location and rotation) for an actor in that tick. + - **Return:** _[carla.Transform](#carla.Transform)_ +- **get_velocity**(**self**) +Returns the velocity vector registered for an actor in that tick. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + +--- + +## carla.AttachmentType +Class that defines attachment options between an actor and its parent. When spawning actors, these can be attached to another actor so their position changes accordingly. This is specially useful for cameras and sensors. [Here](../ref_code_recipes.md#attach-sensors-recipe) is a brief recipe in which we can see how sensors can be attached to a car when spawned. Note that the attachment type is declared as an enum within the class. + +

Instance Variables

+- **Rigid** +With this fixed attatchment the object follow its parent position strictly. +- **SpringArm** +An attachment that expands or retracts depending on camera situation. SpringArms are an Unreal Engine component so [check this out](../ref_code_recipes.md#attach-sensors-recipe) to learn some more about them. + +--- + +## carla.BlueprintLibrary +A class that contains the blueprints provided for actor spawning. Its main application is to return [carla.ActorBlueprint](#carla.ActorBlueprint) objects needed to spawn actors. Each blueprint has an identifier and attributes that may or may not be modifiable. The library is automatically created by the server and can be accessed through [carla.World](#carla.World). + + [Here](../bp_library.md) is a reference containing every available blueprint and its specifics. + +

Methods

+- **\__getitem__**(**self**, **pos**) +Returns the blueprint stored in `pos` position inside the data structure containing them. + - **Parameters:** + - `pos` (_int_) + - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ +- **\__iter__**(**self**) +Method that allows iteration of this class. +- **\__len__**(**self**) +Returns the amount of blueprints comprising the library. + - **Return:** _int_ +- **\__str__**(**self**) +Parses the identifiers for every blueprint to string. + - **Return:** _string_ +- **filter**(**self**, **wildcard_pattern**) +Filters a list of blueprints matching the `wildcard_pattern` against the id and tags of every blueprint contained in this library and returns the result as a new one. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard. + - **Parameters:** + - `wildcard_pattern` (_str_) + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ +- **find**(**self**, **id**) +Returns the blueprint corresponding to that identifier. + - **Parameters:** + - `id` (_str_) + - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ + +--- + +## carla.BoundingBox +Helper class defining a box location and its dimensions that will later be used by [carla.DebugHelper](#carla.DebugHelper) or a [carla.Client](#carla.Client) to draw shapes and detect collisions. Bounding boxes normally act for object colliders. Check out this [recipe](../ref_code_recipes.md#debug-bounding-box-recipe) where the user takes a snapshot of the world and then proceeds to draw bounding boxes for traffic lights. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +The center of the bounding box relative to its parent actor. +- **extent** (_[carla.Vector3D](#carla.Vector3D)_) +Vector from the center of the box to one vertex. The value in each axis equals half the size of the box for that axis. +`extent.x * 2` would return the size of the box in the X-axis. + +

Methods

+- **\__init__**(**self**, **location**, **extent**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Point to center the box. + - `extent` (_[carla.Vector3D](#carla.Vector3D)_) – Vector containing half the size of the box for every axis. +- **contains**(**self**, **world_point**, **transform**) +Returns **True** if a point passed in world space is inside this bounding box. + - **Parameters:** + - `world_point` (_[carla.Location](#carla.Location)_) – The point in world space to be checked. + - `transform` (_[carla.Transform](#carla.Transform)_) – Contains location and rotation needed to convert this object's local space to world space. + - **Return:** _bool_ +- **get_local_vertices**(**self**) +Returns a list containing the locations of this object's vertices in local space. + - **Return:** _list([carla.Location](#carla.Location))_ +- **get_world_vertices**(**self**, **transform**) +Returns a list containing the locations of this object's vertices in world space. + - **Parameters:** + - `transform` (_[carla.Transform](#carla.Transform)_) – Contains location and rotation needed to convert this object's local space to world space. + - **Return:** _list([carla.Location](#carla.Location))_ +- **\__eq__**(**self**, **other**) +Returns true if both location and extent are equal for this and `other`. + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if either location or extent are different for this and `other`. + - **Parameters:** + - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) + - **Return:** _bool_ +- **\__str__**(**self**) +Parses the location and extent of the bounding box to string. + - **Return:** _str_ + +--- + +## carla.Client +The Client connects CARLA to the server which runs the simulation. Both server and client contain a CARLA library (libcarla) with some differences that allow communication between them. Many clients can be created and each of these will connect to the RPC server inside the simulation to send commands. The simulation runs server-side. Once the connection is established, the client will only receive data retrieved from the simulation. Walkers are the exception. The client is in charge of managing pedestrians so, if you are running a simulation with multiple clients, some issues may arise. For example, if you spawn walkers through different clients, collisions may happen, as each client is only aware of the ones it is in charge of. + + The client also has a recording feature that saves all the information of a simulation while running it. This allows the server to replay it at will to obtain information and experiment with it. [Here](../adv_recorder.md) is some information about how to use this recorder. + +

Methods

+- **\__init__**(**self**, **host**=127.0.0.1, **port**=2000, **worker_threads**=0) +Client constructor. + - **Parameters:** + - `host` (_str_) – IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1). + - `port` (_int_) – TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001. + - `worker_threads` (_int_) – Number of working threads used for background updates. If 0, use all available concurrency. +- **apply_batch**(**self**, **commands**) +Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the **apply_batch_sync()** function right below this one. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once. + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. Each command is different and has its own parameters. These are supported so far: + [SpawnActor](#command.SpawnActor) + [DestroyActor](#command.DestroyActor) + [ApplyVehicleControl](#command.ApplyVehicleControl) + [ApplyWalkerControl](#command.ApplyWalkerControl) + [ApplyTransform](#command.ApplyTransform) + [ApplyVelocity](#command.ApplyVelocity) + [ApplyAngularVelocity](#command.ApplyAngularVelocity) + [ApplyImpulse](#command.ApplyImpulse) + [SetSimulatePhysics](#command.SetSimulatePhysics) + [SetAutopilot](#command.SetAutopilot). +- **apply_batch_sync**(**self**, **commands**, **due_tick_cue**=False) +Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of command.Response that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116) is an example of it being used to spawn actors. + - **Parameters:** + - `commands` (_list_) – A list of commands to execute in batch. The commands available are listed right above, in the function **apply_batch()**. + - `due_tick_cue` (_bool_) – A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. It is __False__ by default. + - **Return:** _list(command.Response)_ +- **get_available_maps**(**self**) +Returns a list of strings containing the paths of the maps available on server. These paths are dynamic, they will be created during the simulation and so you will not find them when looking up in your files. One of the possible returns for this method would be: + ['/Game/Carla/Maps/Town01', + '/Game/Carla/Maps/Town02', + '/Game/Carla/Maps/Town03', + '/Game/Carla/Maps/Town04', + '/Game/Carla/Maps/Town05', + '/Game/Carla/Maps/Town06', + '/Game/Carla/Maps/Town07']. + - **Return:** _list(str)_ +- **get_client_version**(**self**) +Returns the client libcarla version by consulting it in the "Version.h" file. Both client and server can use different libcarla versions but some issues may arise regarding unexpected incompatibilities. + - **Return:** _str_ +- **get_server_version**(**self**) +Returns the server libcarla version by consulting it in the "Version.h" file. Both client and server should use the same libcarla version. + - **Return:** _str_ +- **get_world**(**self**) +Returns the world object currently active in the simulation. This world will be later used for example to load maps. + - **Return:** _[carla.World](#carla.World)_ +- **load_world**(**self**, **map_name**) +Creates a new world with default settings using `map_name` map. All actors in the current world will be destroyed. + - **Parameters:** + - `map_name` (_str_) – Name of the map to be used in this world. Accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. Remember that these paths are dynamic. +- **get_trafficmanager**(**self**, **client_connection**=8000) +Returns an instance of the traffic manager related to the specified port. If it does not exist, this will be created. + - **Parameters:** + - `client_connection` (_int_) – Port that will be used by the traffic manager. Default is `8000`. + - **Return:** _[carla.TrafficManager](#carla.TrafficManager)_ +- **reload_world**(**self**) +Reload the current world, note that a new world is created with default settings using the same map. All actors present in the world will be destroyed, __but__ traffic manager instances will stay alive. + - **Raises:** RuntimeError when corresponding. +- **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**) +Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed, __but__ traffic manager instances will stay alive. + - **Parameters:** + - `name` (_str_) – Name of the file containing the information of the simulation. + - `start` (_float_) – Time in seconds where to start playing the simulation. Negative is read as beginning from the end, being -10 just 10 seconds before the recording finished. + - `duration` (_float_) – Time in seconds that will be reenacted using the information `name` file. If the end is reached, the simulation will continue. + - `follow_id` (_int_) – ID of the actor to follow. If this is 0 then camera is disabled. +- **generate_opendrive_world**(**self**, **opendrive**) +Loads a new world with a basic physical topology generated from an OpenDRIVE file passed as `string`. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks. + - **Parameters:** + - `opendrive` (_str_) – OpenDRIVE data as `string`. +- **set_replayer_time_factor**(**self**, **time_factor**=1.0) +When used, the time speed of the reenacted simulation is modified at will. It can be used several times while a playback is in curse. + - **Parameters:** + - `time_factor` (_float_) – 1.0 means normal time speed. Greater than 1.0 means fast motion (2.0 would be double speed) and lesser means slow motion (0.5 would be half speed). +- **set_timeout**(**self**, **seconds**) +Sets in seconds the maxixum time a network call is allowed before blocking it and raising a timeout exceeded error. + - **Parameters:** + - `seconds` (_float_) – New timeout value in seconds. Default is 5 seconds. +- **show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**) +The terminal will show the information registered for actors considered blocked. An actor is considered blocked when it does not move a minimum distance in a period of time, being these `min_distance` and `min_time`. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `min_time` (_float_) – Minimum time in seconds the actor has to move a minimum distance before being considered blocked. Default is 60 seconds. + - `min_distance` (_float_) – Minimum distance in centimeters the actor has to move to not be considered blocked. Default is 100 centimeters. +- **show_recorder_collisions**(**self**, **filename**, **category1**, **category2**) +The terminal will show the collisions registered by the recorder. These can be filtered by specifying the type of actor involved. The categories will be specified in `category1` and `category2` as follows: + 'h' = Hero, the one vehicle that can be controlled manually or managed by the user. + 'v' = Vehicle + 'w' = Walker + 't' = Traffic light + 'o' = Other + 'a' = Any +If you want to see only collisions between a vehicles and a walkers, use for `category1` as 'v' and `category2` as 'w' or vice versa. If you want to see all the collisions (filter off) you can use 'a' for both parameters. + - **Parameters:** + - `filename` (_str_) – Name or absolute path of the file recorded, depending on your previous choice. + - `category1` (_single char_) – Character variable specifying a first type of actor involved in the collision. + - `category2` (_single char_) – Character variable specifying the second type of actor involved in the collision. +- **show_recorder_file_info**(**self**, **filename**, **show_all**=False) +The information saved by the recorder will be parsed and shown in your terminal as text (frames, times, events, state, positions...). The information shown can be specified by using the `show_all` parameter. [Here](../ref_recorder_binary_file_format.md) is some more information about how to read the recorder file. + - **Parameters:** + - `filename` (_str_) – Name or absolute path of the file recorded, depending on your previous choice. + - `show_all` (_bool_) – When true, will show all the details per frame (traffic light states, positions of all actors, orientation and animation data...), but by default it will only show a summary. +- **start_recorder**(**self**, **filename**) +Enables the recording feature, which will start saving every information possible needed by the server to replay the simulation. + - **Parameters:** + - `filename` (_str_) – Name of the file to write the recorded data. A simple name will save the recording in 'CarlaUE4/Saved/recording.log'. Otherwise, if some folder appears in the name, it will be considered an absolute path. +- **stop_recorder**(**self**) +Stops the recording in progress. If you specified a path in `filename`, the recording will be there. If not, look inside `CarlaUE4/Saved/`. + +--- + +## carla.CollisionEvent +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines a collision data for sensor.other.collision. The sensor creates one of this for every collision detected which may be many for one simulation step. Learn more about this [here](/cameras_and_sensors/#sensorothercollision). + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +The actor the sensor is attached to, the one that measured the collision. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +The second actor involved in the collision. +- **normal_impulse** (_[carla.Vector3D](#carla.Vector3D)_) +Normal impulse resulting of the collision. + +--- + +## carla.Color +Class that defines a 32-bit RGBA color. + +

Instance Variables

+- **r** (_int_) +Red color (0-255). +- **g** (_int_) +Green color (0-255). +- **b** (_int_) +Blue color (0-255). +- **a** (_int_) +Alpha channel (0-255). + +

Methods

+- **\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=255) +Initializes a color, black by default. + - **Parameters:** + - `r` (_int_) + - `g` (_int_) + - `b` (_int_) + - `a` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Color](#carla.Color)_) +- **\__str__**(**self**) + +--- + +## carla.ColorConverter +Class that defines conversion patterns that can be applied to a [carla.Image](#carla.Image) in order to show information provided by [carla.Sensor](#carla.Sensor). Depth conversions cause a loss of accuracy, as sensors detect depth as float that is then converted to a grayscale value between 0 and 255. Take a look a this [recipe](../ref_code_recipes.md#converted-image-recipe) to see an example of how to create and save image data for sensor.camera.semantic_segmentation. + +

Instance Variables

+- **CityScapesPalette** +Converts the image to a segmentated map using tags provided by the blueprint library. Used by sensor.camera.semantic_segmentation. +- **Depth** +Converts the image to a linear depth map. Used by sensor.camera.depth. +- **LogarithmicDepth** +Converts the image to a depth map using a logarithmic scale, leading to better precision for small distances at the expense of losing it when further away. +- **Raw** +No changes applied to the image. + +--- + +## carla.DebugHelper +Helper class part of [carla.World](#carla.World) that defines methods for creating debug shapes. By default, shapes last one second. They can be permanent, but take into account the resources needed to do so. Check out this [recipe](../ref_code_recipes.md#debug-bounding-box-recipe) where the user takes a snapshot of the world and then proceeds to draw bounding boxes for traffic lights. + +

Methods

+- **draw_point**(**self**, **location**, **size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f) +Draws a point `location`. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Spot in the coordinate system to center the object. + - `size` (_float_) – Density of the point. + - `color` (_[carla.Color](#carla.Color)_) – RGB code to color the object. Red by default. + - `life_time` (_float_) – Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_line**(**self**, **begin**, **end**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f) +Draws a line in between `begin` and `end`. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) – Point in the coordinate system where the line starts. + - `end` (_[carla.Location](#carla.Location)_) – Spot in the coordinate system where the line ends. + - `thickness` (_float_) – Density of the line. + - `color` (_[carla.Color](#carla.Color)_) – RGB code to color the object. Red by default. + - `life_time` (_float_) – Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1f, **arrow_size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f) +Draws an arrow from `begin` to `end` pointing in that direction. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location)_) – Point in the coordinate system where the arrow starts. + - `end` (_[carla.Location](#carla.Location)_) – Point in the coordinate system where the arrow ends and points towards to. + - `thickness` (_float_) – Density of the line. + - `arrow_size` (_float_) – Size of the tip of the arrow. + - `color` (_[carla.Color](#carla.Color)_) – RGB code to color the object. Red by default. + - `life_time` (_float_) – Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f) +Draws a box, ussually to act for object colliders. + - **Parameters:** + - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) – Object containing a location and the length of a box for every axis. + - `rotation` (_[carla.Rotation](#carla.Rotation)_) – Orientation of the box according to Unreal Engine's axis system. + - `thickness` (_float_) – Density of the lines that define the box. + - `color` (_[carla.Color](#carla.Color)_) – RGB code to color the object. Red by default. + - `life_time` (_float_) – Lifespan in seconds for the shape. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0f) +Draws a string in a given location of the simulation which can only be seen server-side. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Spot in the simulation where the text will be centered. + - `text` (_str_) – Text intended to be shown in the world. + - `draw_shadow` (_bool_) – Casts a shadow for the string that could help in visualization. It is disabled by default. + - `color` (_[carla.Color](#carla.Color)_) – RGB code to color the string. Red by default. + - `life_time` (_float_) + +--- + +## carla.GearPhysicsControl +Class that provides access to vehicle transmission details by defining a gear and when to run on it. This will be later used by [carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl) to help simulate physics. + +

Instance Variables

+- **ratio** (_float_) +The transmission ratio of the gear. +- **down_ratio** (_float_) +Quotient between current RPM and MaxRPM where the autonomous gear box should shift down. +- **up_ratio** (_float_) +Quotient between current RPM and MaxRPM where the autonomous gear box should shift up. + +

Methods

+- **\__init__**(**self**, **ratio**=1.0, **down_ratio**=0.5, **up_ratio**=0.65) + - **Parameters:** + - `ratio` (_float_) + - `down_ratio` (_float_) + - `up_ratio` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.GeoLocation +Class that contains geographical coordinates simulated data. The [carla.Map](#carla.Map) can convert simulation locations by using the tag in the OpenDRIVE file. + +

Instance Variables

+- **latitude** (_float_) +North/South value of a point on the map. +- **longitude** (_float_) +West/East value of a point on the map. +- **altitude** (_float_) +Height regarding ground level. + +

Methods

+- **\__init__**(**self**, **latitude**=0.0, **longitude**=0.0, **altitude**=0.0) + - **Parameters:** + - `latitude` (_float_) + - `longitude` (_float_) + - `altitude` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) +- **\__str__**(**self**) + +--- + +## carla.GnssMeasurement +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines the Gnss data registered by a sensor.other.gnss. It essentially reports its position with the position of the sensor and an OpenDRIVE geo-reference. + +

Instance Variables

+- **altitude** (_float_) +Height regarding ground level. +- **latitude** (_float_) +North/South value of a point on the map. +- **longitude** (_float_) +West/East value of a point on the map. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.IMUMeasurement +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines the data registered by a sensor.other.imu, regarding the sensor's transformation according to the current [carla.World](#carla.World). It essentially acts as accelerometer, gyroscope and compass. + +

Instance Variables

+- **accelerometer** (_[carla.Vector3D](#carla.Vector3D)_) +Linear acceleration in m/s^2. +- **compass** (_float_) +Orientation with regard to the North ((0.0, -1.0, 0.0) in Unreal Engine) in radians. +- **gyroscope** (_[carla.Vector3D](#carla.Vector3D)_) +Angular velocity in rad/sec. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.Image +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines an image of 32-bit BGRA colors that will be used as initial data retrieved by camera sensors. There are different camera sensors (currently three, RGB, depth and semantic segmentation) and each of these makes different use for the images. Learn more about them [here](/cameras_and_sensors/). + +

Instance Variables

+- **fov** (_float_) +Horizontal field of view of the image in degrees. +- **height** (_int_) +Image height in pixels. +- **width** (_int_) +Image width in pixels. +- **raw_data** (_bytes_) + +

Methods

+- **convert**(**self**, **color_converter**) +Converts the image following the `color_converter` pattern. + - **Parameters:** + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) +- **save_to_disk**(**self**, **path**, **color_converter**=Raw) +Saves the image to disk using a converter pattern stated as `color_converter`. The default conversion pattern is Raw that will make no changes to the image. + - **Parameters:** + - `path` (_str_) – Path that will contain the image. + - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) – Default Raw will make no changes. +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **color**) + - **Parameters:** + - `pos` (_int_) + - `color` (_[carla.Color](#carla.Color)_) +- **\__str__**(**self**) + +--- + +## carla.Junction +Class that embodies the intersections on the road described in the OpenDRIVE file according to OpenDRIVE 1.4 standards. + +

Instance Variables

+- **id** (_int_) +Identificator found in the OpenDRIVE file. +- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +Bounding box encapsulating the junction lanes. + +

Methods

+- **get_waypoints**(**self**, **lane_type**) +Returns a list of pairs of waypoints. Every tuple on the list contains first an initial and then a final waypoint within the intersection boundaries that describe the beginning and the end of said lane along the junction. Lanes follow their OpenDRIVE definitions so there may be many different tuples with the same starting waypoint due to possible deviations, as this are considered different lanes. + - **Parameters:** + - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – Type of lanes to get the waypoints. + - **Return:** _list(tuple([carla.Waypoint](#carla.Waypoint)))_ + +--- + +## carla.Landmark +Class that defines any type of traffic landmark or sign affecting a road. These class mediates between the [OpenDRIVE](http://opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.pdf) definition of the landmarks and their representation in the simulation. This class retrieves all the information defining a landmark in OpenDRIVE and facilitates information about which lanes does it affect and when. +Landmarks will be accessed by [carla.Waypoint](#carla.Waypoint) objects trying to retrieve the regulation of their lane. Therefore some attributes depend on the waypoint that is consulting the landmark and so, creating the object. + +

Instance Variables

+- **road_id** (_int_) +The OpenDRIVE ID of the road where this landmark is defined. Due to OpenDRIVE road definitions, this road may be different from the road the landmark is currently affecting. It is mostly the case in junctions where the road diverges in different routes. +Example: a traffic light is defined in one of the divergent roads in a junction, but it affects all the possible routes. +- **distance** (_float_) +Distance between the landmark and the waypoint creating the object (querying `get_landmarks` or `get_landmarks_of_type`). +- **s** (_float_) +Distance where the landmark is positioned along the geometry of the road `road_id`. +- **t** (_float_) +Lateral distance where the landmark is positioned from the edge of the road `road_id`. +- **id** (_str_) +Unique ID of the landmark in the OpenDRIVE file. +- **name** (_str_) +Name of the landmark in the in the OpenDRIVE file. +- **is_dynamic** (_bool_) +Indicates if the landmark has state changes over time such as traffic lights. +- **orientation** (_[carla.LandmarkOrientation](#carla.LandmarkOrientation)_) +Indicates which lanes the landmark is facing towards to. +- **z_offset** (_float_) +Height where the landmark is placed. +- **country** (_str_) +Country code where the landmark is defined (default to OpenDRIVE is Germany 2017). +- **type** (_str_) +Type identificator of the landmark according to the country code. +- **sub_type** (_str_) +Subtype identificator of the landmark according to the country code. +- **value** (_float_) +Value printed in the signal (e.g. speed limit, maximum weight, etc). +- **unit** (_str_) +Units of measurement for the attribute `value`. +- **height** (_float_) +Total height of the signal. +- **width** (_float_) +Total width of the signal. +- **text** (_str_) +Additional text in the signal. +- **h_offset** (_float_) +Orientation offset of the signal relative to the the definition of `road_id` at `s` in OpenDRIVE. +- **pitch** (_float_) +Pitch rotation of the signal. +- **roll** (_float_) +Roll rotation of the signal. +- **waypoint** (_[carla.Waypoint](#carla.Waypoint)_) +A waypoint placed in the lane of the one that made the query and at the `s` of the landmark. It is the first waypoint for which the landmark will be effective. +- **transform** (_[carla.Transform](#carla.Transform)_) +The location and orientation of the landmark in the simulation. + +

Methods

+- **get_lane_validities**(**self**) +Returns which lanes the landmark is affecting to. As there may be specific lanes where the landmark is not effective, the return is a list of pairs containing ranges of the __lane_id__ affected: +Example: In a road with 5 lanes, being 3 not affected: [(from_lane1,to_lane2),(from_lane4,to_lane5)]. + - **Return:** _list(tuple(int))_ + +--- + +## carla.LandmarkOrientation +Helper class to define the orientation of a landmark in the road. The definition is not directly translated from OpenDRIVE but converted for the sake of understanding. + +

Instance Variables

+- **Positive** +The landmark faces towards vehicles going on the same direction as the road's geometry definition (lanes 0 and negative in OpenDRIVE). +- **Negative** +The landmark faces towards vehicles going on the opposite direction to the road's geometry definition (positive lanes in OpenDRIVE). +- **Both** +Affects vehicles going in both directions of the road. + +--- + +## carla.LandmarkType +Helper class containing a set of commonly used landmark types as defined by the default country code in the [OpenDRIVE standard](http://opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.pdf) (Germany 2017). +__[carla.Landmark](#carla.Landmark) does not reference this class__. The landmark type is a string that varies greatly depending on the country code being used. This class only makes it easier to manage some of the most commonly used in the default set by describing them as an enum. + +

Instance Variables

+- **Danger** +Type 101. +- **LanesMerging** +Type 121. +- **CautionPedestrian** +Type 133. +- **CautionBicycle** +Type 138. +- **LevelCrossing** +Type 150. +- **StopSign** +Type 206. +- **YieldSign** +Type 205. +- **MandatoryTurnDirection** +Type 209. +- **MandatoryLeftRightDirection** +Type 211. +- **TwoChoiceTurnDirection** +Type 214. +- **Roundabout** +Type 215. +- **PassRightLeft** +Type 222. +- **AccessForbidden** +Type 250. +- **AccessForbiddenMotorvehicles** +Type 251. +- **AccessForbiddenTrucks** +Type 253. +- **AccessForbiddenBicycle** +Type 254. +- **AccessForbiddenWeight** +Type 263. +- **AccessForbiddenWidth** +Type 264. +- **AccessForbiddenHeight** +Type 265. +- **AccessForbiddenWrongDirection** +Type 267. +- **ForbiddenUTurn** +Type 272. +- **MaximumSpeed** +Type 274. +- **ForbiddenOvertakingMotorvehicles** +Type 276. +- **ForbiddenOvertakingTrucks** +Type 277. +- **AbsoluteNoStop** +Type 283. +- **RestrictedStop** +Type 286. +- **HasWayNextIntersection** +Type 301. +- **PriorityWay** +Type 306. +- **PriorityWayEnd** +Type 307. +- **CityBegin** +Type 310. +- **CityEnd** +Type 311. +- **Highway** +Type 330. +- **RecomendedSpeed** +Type 380. +- **RecomendedSpeedEnd** +Type 381. + +--- + +## carla.LaneChange +Class that defines the permission to turn either left, right, both or none (meaning only going straight is allowed). This information is stored for every [carla.Waypoint](#carla.Waypoint) according to the OpenDRIVE file. In this [recipe](../ref_code_recipes.md#lanes-recipe) the user creates a waypoint for a current vehicle position and learns which turns are permitted. + +

Instance Variables

+- **NONE** +Traffic rules do not allow turning right or left, only going straight. +- **Both** +Traffic rules allow turning either right or left. +- **Left** +Traffic rules allow turning left. +- **Right** +Traffic rules allow turning right. + +--- + +## carla.LaneInvasionEvent +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines lanes invasion for sensor.other.lane_invasion. It works only client-side and is dependant on OpenDRIVE to provide reliable information. The sensor creates one of this every time there is a lane invasion, which may be more than once per simulation step. Learn more about this [here](/cameras_and_sensors/#sensorotherlane_invasion). + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +Gets the actor the sensor is attached to, the one that invaded another lane. +- **crossed_lane_markings** (_list([carla.LaneMarking](#carla.LaneMarking))_) +List of lane markings that have been crossed and detected by the sensor. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.LaneMarking +Class that gathers all the information regarding a lane marking according to [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf) standard. + +

Instance Variables

+- **color** (_[carla.LaneMarkingColor](#carla.LaneMarkingColor)_) +Actual color of the marking. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Permissions for said lane marking to be crossed. +- **type** (_[carla.LaneMarkingType](#carla.LaneMarkingType)_) +Lane marking type. +- **width** (_float_) +Horizontal lane marking thickness. + +--- + +## carla.LaneMarkingColor +Class that defines the lane marking colors according to OpenDRIVE 1.4. + +

Instance Variables

+- **Standard** +White by default. +- **Blue** +- **Green** +- **Red** +- **White** +- **Yellow** +- **Other** + +--- + +## carla.LaneMarkingType +Class that defines the lane marking types accepted by OpenDRIVE 1.4. Take a look at this [recipe](../ref_code_recipes.md#lanes-recipe) where the user creates a [carla.Waypoint](#carla.Waypoint) for a vehicle location and retrieves from it the information about adjacent lane markings. +__Note on double types:__ Lane markings are defined under the OpenDRIVE standard that determines whereas a line will be considered "BrokenSolid" or "SolidBroken". For each road there is a center lane marking, defined from left to right regarding the lane's directions. The rest of the lane markings are defined in order from the center lane to the closest outside of the road. + +

Instance Variables

+- **NONE** +- **BottsDots** +- **Broken** +- **BrokenBroken** +- **BrokenSolid** +- **Curb** +- **Grass** +- **Solid** +- **SolidBroken** +- **SolidSolid** +- **Other** + +--- + +## carla.LaneType +Class that defines the possible lane types accepted by OpenDRIVE 1.4. This standards define the road information. For instance in this [recipe](../ref_code_recipes.md#lanes-recipe) the user creates a [carla.Waypoint](#carla.Waypoint) for the current location of a vehicle and uses it to get the current and adjacent lane types. + +

Instance Variables

+- **NONE** +- **Bidirectional** +- **Biking** +- **Border** +- **Driving** +- **Entry** +- **Exit** +- **Median** +- **OffRamp** +- **OnRamp** +- **Parking** +- **Rail** +- **Restricted** +- **RoadWorks** +- **Shoulder** +- **Sidewalk** +- **Special1** +- **Special2** +- **Special3** +- **Stop** +- **Tram** +- **Any** +Every type except for NONE. + +--- + +## carla.LidarMeasurement +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines the lidar data retrieved by a sensor.lidar.ray_cast. This essentially simulates a rotating lidar using ray-casting. Learn more about this [here](/cameras_and_sensors/#sensorlidarray_cast). + +

Instance Variables

+- **channels** (_int_) +Number of lasers shot. +- **horizontal_angle** (_float_) +Horizontal angle the Lidar is rotated at the time of the measurement (in radians). +- **raw_data** (_bytes_) +List of 3D points received as data. + +

Methods

+- **get_point_count**(**self**, **channel**) +Retrieves the number of points sorted by channel that are generated by this measure. Sorting by channel allows to identify the original channel for every point. + - **Parameters:** + - `channel` (_int_) +- **save_to_disk**(**self**, **path**) +Saves the point cloud to disk as a .ply file describing data from 3D scanners. The files generated are ready to be used within [MeshLab](http://www.meshlab.net/), an open source system for processing said files. Just take into account that axis may differ from Unreal Engine and so, need to be reallocated. + - **Parameters:** + - `path` (_str_) +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **location**) + - **Parameters:** + - `pos` (_int_) + - `location` (_[carla.Location](#carla.Location)_) +- **\__str__**(**self**) + +--- + +## carla.Location +
Inherited from _[carla.Vector3D](#carla.Vector3D)_

Represents a spot in the world. + +

Instance Variables

+- **x** (_float_) +Distance in meters from origin to spot on X axis. +- **y** (_float_) +Distance in meters from origin to spot on Y axis. +- **z** (_float_) +Distance in meters from origin to spot on Z axis. + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **\__eq__**(**self**, **other**) +Returns true if both locations are the same point in space. + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) – The other point to be compared with. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if both locations are different points in space. + - **Parameters:** + - `other` (_[carla.Location](#carla.Location)_) – The other point to be compared with. + - **Return:** _bool_ +- **\__str__**(**self**) +Parses the axis' values to string. + - **Return:** _str_ +- **distance**(**self**, **location**) +Returns Euclidean distance in meters from this location to another one. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – The other point to compute the distance with. + - **Return:** _float_ + +--- + +## carla.Map +Class containing the road information and waypoint managing. Data is retrieved from an OpenDRIVE file that describes the road. A query system is defined which works hand in hand with [carla.Waypoint](#carla.Waypoint) to translate geometrical information from the .xodr to natural world points. CARLA is currently working with [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf). + +

Instance Variables

+- **name** (_str_) +The name of the map. It corresponds to the .umap from Unreal Engine that is loaded from a CARLA server, which then references to the .xodr road description. + +

Methods

+- **\__init__**(**self**, **name**, **xodr_content**) +Constructor for this class. Though a map is automatically generated when initializing the world, using this method in no-rendering mode facilitates working with an .xodr without any CARLA server running. + - **Parameters:** + - `name` (_str_) – Name of the current map. + - `xodr_content` (_str_) – .xodr content in string format. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **generate_waypoints**(**self**, **distance**) +Returns a list of waypoints with a certain distance between them for every lane and centered inside of it. Waypoints are not listed in any particular order. Remember that waypoints closer than 2cm within the same road, section and lane will have the same identificator. + - **Parameters:** + - `distance` (_float_) – Approximate distance between waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **get_spawn_points**(**self**) +Returns a list of recommendations made by the creators of the map to be used as spawning points for the vehicles. The list includes [carla.Transform](#carla.Transform) objects with certain location and orientation. Said locations are slightly on-air in order to avoid Z-collisions, so vehicles fall for a bit before starting their way. + - **Return:** _list([carla.Transform](#carla.Transform))_ +- **get_topology**(**self**) +Returns a list of tuples describing a minimal graph of the topology of the OpenDRIVE file. The tuples contain pairs of waypoints located either at the point a road begins or ends. The first one is the origin and the second one represents another road end that can be reached. This graph can be loaded into [NetworkX](https://networkx.github.io/) to work with. Output could look like this: [(w0, w1), (w0, w2), (w1, w3), (w2, w3), (w0, w4)]. + - **Return:** _list(tuple([carla.Waypoint](#carla.Waypoint), [carla.Waypoint](#carla.Waypoint)))_ +- **get_waypoint**(**self**, **location**, **project_to_road**=True, **lane_type**=[carla.LaneType.Driving](#carla.LaneType.Driving)) +Returns a waypoint that can be located in an exact location or translated to the center of the nearest lane. Said lane type can be defined using flags such as `LaneType.Driving & LaneType.Shoulder`. + The method will return None if the waypoint is not found, which may happen only when trying to retrieve a waypoint for an exact location. That eases checking if a point is inside a certain road, as otherwise, it will return the corresponding waypoint. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – Location used as reference for the [carla.Waypoint](#carla.Waypoint). + - `project_to_road` (_bool_) – If **True**, the waypoint will be at the center of the closest lane. This is the default setting. If **False**, the waypoint will be exactly in `location`. None means said location does not belong to a road. + - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – Limits the search for nearest lane to one or various lane types that can be flagged. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_waypoint_xodr**(**self**, **road_id**, **lane_id**, **s**) +Get a waypoint if all the parameters passed are correct, otherwise return None. + - **Parameters:** + - `road_id` (_int_) – Id of the road from where getting the waypoint. + - `lane_id` (_int_) – Id of the lane to get the waypoint. + - `s` (_float_) – Specify the length from the road start. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **save_to_disk**(**self**, **path**) +Saves the .xodr OpenDRIVE file of the current map to disk. + - **Parameters:** + - `path` – Path where the file will be saved. +- **to_opendrive**(**self**) +Returns the .xodr OpenDRIVe file of the current map as string. + - **Return:** _str_ +- **transform_to_geolocation**(**self**, **location**) +Converts a given `location`, a point in the simulation, to a [carla.GeoLocation](#carla.GeoLocation), which represents world coordinates. The geographical location of the map is defined inside OpenDRIVE within the tag . + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - **Return:** _[carla.GeoLocation](#carla.GeoLocation)_ +- **\__str__**(**self**) + +--- + +## carla.ObstacleDetectionEvent +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines the obstacle data for sensor.other.obstacle. Learn more about this [here](/cameras_and_sensors/#sensorotherobstacle). + +

Instance Variables

+- **actor** (_[carla.Actor](#carla.Actor)_) +The actor the sensor is attached to. +- **other_actor** (_[carla.Actor](#carla.Actor)_) +The actor or object considered to be an obstacle. +- **distance** (_float_) +Distance between `actor` and `other`. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.RadarDetection +Data contained inside a [carla.RadarMeasurement](#carla.RadarMeasurement). Each of these represents one of the points in the cloud that a sensor.other.radar registers and contains the distance, angle and velocity in relation to the radar. + +

Instance Variables

+- **altitude** (_float_) +Altitude angle of the detection in radians. +- **azimuth** (_float_) +Azimuth angle of the detection in radians. +- **depth** (_float_) +Distance in meters from the sensor to the detection position. +- **velocity** (_float_) +The velocity of the detected object towards the sensor in m/s. + +

Methods

+- **\__str__**(**self**) + +--- + +## carla.RadarMeasurement +
Inherited from _[carla.SensorData](#carla.SensorData)_

Class that defines and gathers the measures registered by a sensor.other.radar, representing a wall of points in front of the sensor with a distance, angle and velocity in relation to it. The data consists of a [carla.RadarDetection](#carla.RadarDetection) array. + +

Instance Variables

+- **raw_data** (_bytes_) +The complete information of the [carla.RadarDetection](#carla.RadarDetection) the radar has registered. + +

Methods

+- **get_detection_count**(**self**) +Retrieves the number of entries generated, same as **\__str__()**. +- **\__len__**(**self**) +- **\__iter__**(**self**) +- **\__getitem__**(**self**, **pos**) + - **Parameters:** + - `pos` (_int_) +- **\__setitem__**(**self**, **pos**, **detection**) + - **Parameters:** + - `pos` (_int_) + - `detection` (_[carla.RadarDetection](#carla.RadarDetection)_) +- **\__str__**(**self**) + +--- + +## carla.Rotation +Class that represents a 3D rotation and therefore, an orientation in space. + +![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg) _Unreal Engine's standard (from [UE4 docs](https://wiki.unrealengine.com/Blueprint_Rotating_Movement_Component))_. + +

Instance Variables

+- **pitch** (_float_) +Degrees around the Y-axis. +- **yaw** (_float_) +Degrees around the Z-axis. +- **roll** (_float_) +Degrees around the X-axis. + +

Methods

+- **\__init__**(**self**, **pitch**=0.0, **yaw**=0.0, **roll**=0.0) + - **Parameters:** + - `pitch` (_float_) – Y rotation in degrees. + - `yaw` (_float_) – Z rotation in degrees. + - `roll` (_float_) – X rotation in degrees. +- **get_forward_vector**(**self**) +Computes the vector pointing forward according to the orientation of each axis. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **\__eq__**(**self**, **other**) +Returns true if both rotations represent the same orientation of each axis. + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) – The other rotation to be compared with. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if both rotations represent the same orientation of each axis. + - **Parameters:** + - `other` (_[carla.Rotation](#carla.Rotation)_) – The other rotation to be compared with. + - **Return:** _bool_ +- **\__str__**(**self**) +Parses the axis' orientations to string. + +--- + +## carla.Sensor +
Inherited from _[carla.Actor](#carla.Actor)_

Sensors compound a specific family of actors quite diverse and unique. They are normally spawned as attachment/sons of a vehicle (take a look at [carla.World](#carla.World) to learn about actor spawning). Sensors are thoroughly designed to retrieve different types of data that they are listening to. The data they receive is shaped as different subclasses inherited from [carla.SensorData](#carla.SensorData) (depending on the sensor). + + Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in [carla.BlueprintLibrary](#carla.BlueprintLibrary). All the information on their preferences and settlement can be found [here](/cameras_and_sensors/), but the list of those available in CARLA so far goes as follow: + Receive data on every tick: + - Gnss sensor. + - IMU sensor. + - Radar. + - [Depth camera](/cameras_and_sensors/#sensorcameradepth). + - [Lidar raycast](/cameras_and_sensors/#sensorlidarray_cast). + - [RGB camera](/cameras_and_sensors/#sensorcamerargb). + - [Semantic Segmentation camera](/cameras_and_sensors/#sensorcamerasemantic_segmentation). + Only receive data when triggered: + - [Collision detector](/cameras_and_sensors/#sensorothercollision). + - [Lane invasion detector](/cameras_and_sensors/#sensorotherlane_invasion). + - [Obstacle detector](/cameras_and_sensors/#sensorotherobstacle). + +

Instance Variables

+- **is_listening** (_boolean_) +When True the sensor will be waiting for data. + +

Methods

+- **listen**(**self**, **callback**) +The function the sensor will be calling to every time a new measurement is received. This function needs for an argument containing an object type [carla.SensorData](#carla.SensorData) to work with. + - **Parameters:** + - `callback` (_function_) – The called function with one argument containing the sensor data. +- **stop**(**self**) +Commands the sensor to stop listening for data. +- **\__str__**(**self**) + +--- + +## carla.SensorData +Base class for all the objects containing data generated by a [carla.Sensor](#carla.Sensor). This objects should be the argument of the function said sensor is listening to, in order to work with them. Each of these sensors needs for a specific type of sensor data. The relation between available sensors and their corresponding data goes like: + - Cameras (RGB, depth and semantic segmentation): [carla.Image](#carla.Image). + - Collision detector: [carla.CollisionEvent](#carla.CollisionEvent). + - Gnss detector: [carla.GnssMeasurement](#carla.GnssMeasurement). + - IMU detector: [carla.IMUMeasurement](#carla.IMUMeasurement). + - Lane invasion detector: [carla.LaneInvasionEvent](#carla.LaneInvasionEvent). + - Lidar raycast: [carla.LidarMeasurement](#carla.LidarMeasurement). + - Obstacle detector: [carla.ObstacleDetectionEvent](#carla.ObstacleDetectionEvent). + - Radar detector: [carla.RadarMeasurement](#carla.RadarMeasurement). + +

Instance Variables

+- **frame** (_int_) +Frame count when the data was generated. +- **timestamp** (_float_) +Simulation-time when the data was generated. +- **transform** (_[carla.Transform](#carla.Transform)_) +Sensor's transform when the data was generated. + +--- + +## carla.Timestamp +Class that contains time information for simulated data. This information is automatically retrieved as part of the [carla.WorldSnapshot](#carla.WorldSnapshot) the client gets on every frame, but might also be used in many other situations such as a [carla.Sensor](#carla.Sensor) retrieveing data. + +

Instance Variables

+- **frame** (_int_) +The number of frames elapsed since the simulator was launched. +- **elapsed_seconds** (_float_) +Simulated seconds elapsed since the beginning of the current episode. +- **delta_seconds** (_float_) +Simulated seconds elapsed since the previous frame. +- **platform_timestamp** (_float_) +Time register of the frame at which this measurement was taken given by the OS in seconds. + +

Methods

+- **\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**) + - **Parameters:** + - `frame` (_int_) + - `elapsed_seconds` (_float_) + - `delta_seconds` (_float_) + - `platform_timestamp` (_float_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.Timestamp](#carla.Timestamp)_) +- **\__str__**(**self**) + +--- + +## carla.TrafficLight +
Inherited from _[carla.TrafficSign](#carla.TrafficSign)_

A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differenciated by their pole index. + + Within a group the state of traffic lights is changed in a cyclic pattern: one index is chosen and it spends a few seconds in green, yellow and eventually red. The rest of the traffic lights remain frozen in red this whole time, meaning that there is a gap in the last seconds of the cycle where all the traffic lights are red. However, the state of a traffic light can be changed manually. Take a look at this [recipe](../ref_code_recipes.md#traffic-lights-recipe) to learn how to do so. + +

Instance Variables

+- **state** (_[carla.TrafficLightState](#carla.TrafficLightState)_) +Current state of the traffic light. + +

Methods

+- **freeze**(**self**, **freeze**) +Stops the traffic light at its current state. + - **Parameters:** + - `freeze` (_bool_) +- **is_frozen**(**self**) +The client returns True if a traffic light is frozen according to last tick. The method does not call the simulator. + - **Return:** _bool_ +- **get_pole_index**(**self**) +Returns the index of the pole that identifies it as part of the traffic light group of a junction. + - **Return:** _int_ +- **get_group_traffic_lights**(**self**) +Returns all traffic lights in the group this one belongs to. + - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ + - **Note:** _This function calls the simulator. +_ +- **get_elapsed_time**(**self**) +The client returns the time in seconds since current light state started according to last tick. The method does not call the simulator. + - **Return:** _float_ +- **get_state**(**self**) +The client returns the state of the traffic light according to last tick. The method does not call the simulator. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ +- **get_green_time**(**self**) +The client returns the seconds set for the traffic light to be green according to last tick. The method does not call the simulator. + - **Return:** _float_ +- **get_red_time**(**self**) +The client returns the seconds set for the traffic light to be red according to last tick. The method does not call the simulator. + - **Return:** _float_ +- **get_yellow_time**(**self**) +The client returns the the seconds set for the traffic light to be yellow according to last tick. The method does not call the simulator. + - **Return:** _float_ +- **set_state**(**self**, **state**) +Sets a given state to a traffic light actor. + - **Parameters:** + - `state` (_[carla.TrafficLightState](#carla.TrafficLightState)_) +- **set_green_time**(**self**, **green_time**) + - **Parameters:** + - `green_time` (_float_) – Sets a given time (in seconds) for the green light to be active. +- **set_red_time**(**self**, **red_time**) +Sets a given time (in seconds) for the red state to be active. + - **Parameters:** + - `red_time` (_float_) +- **set_yellow_time**(**self**, **yellow_time**) +Sets a given time (in seconds) for the yellow light to be active. + - **Parameters:** + - `yellow_time` (_float_) +- **\__str__**(**self**) + +--- + +## carla.TrafficLightState +All possible states for traffic lights. These can either change at a specific time step or be changed manually. Take a look at this [recipe](../ref_code_recipes.md#traffic-lights-recipe) to see an example. + +

Instance Variables

+- **Green** +- **Red** +- **Yellow** +- **Off** +- **Unknown** + +--- + +## carla.TrafficManager +The traffic manager is a module built on top of the CARLA API in C++. It handles any group of vehicles set to autopilot mode to populate the simulation with realistic urban traffic conditions and give the chance to user to customize some behaviours. The architecture of the traffic manager is divided in five different goal-oriented stages and a PID controller where the information flows until eventually, a [carla.VehicleControl](#carla.VehicleControl) is applied to every vehicle registered in a traffic manager. +In order to learn more, visit the [documentation](../traffic_manager) regarding this module. + +

Methods

+- **force_lane_change**(**self**, **actor**, **direction**) +Forces a vehicle to change either to the lane on its left or right, if existing, as indicated in `direction`. This method applies the lane change no matter what, disregarding possible collisions. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle being forced to change lanes. + - `direction` (_bool_) – Destination lane. __True__ is the one on the left and __False__ is the right one. +- **ignore_vehicles_percentage**(**self**, **actor**, **perc**) +During the collision detection stage, which runs every frame, this method sets a percent chance that collisions with another vehicle will be ignored for a vehicle. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle that is going to ignore other vehicles. + - `perc` (_float_) – Between 0 and 100. Amount of times collisions will be ignored. +- **ignore_walkers_percentage**(**self**, **actor**, **perc**) +During the collision detection stage, which runs every frame, this method sets a percent chance that collisions with walkers will be ignored for a vehicle. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle that is going to ignore walkers on scene. + - `perc` (_float_) – Between 0 and 100. Amount of times collisions will be ignored. +- **ignore_lights_percentage**(**self**, **actor**, **perc**) +During the traffic light stage, which runs every frame, this method sets the percent chance that traffic lights will be ignored for a vehicle. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – The actor that is going to ignore traffic lights. + - `perc` (_float_) – Between 0 and 100. Amount of times traffic lights will be ignored. +- **reset_traffic_lights**(**self**) +Resets every traffic light in the map to its initial state. +- **auto_lane_change**(**self**, **actor**, **enable**) +Turns on or off lane changing behaviour for a vehicle. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle whose settings are changed. + - `enable` (_bool_) – __True__ is default and enables lane changes. __False__ will disable them. +- **distance_to_leading_vehicle**(**self**, **actor**, **distance**) +Sets the minimum distance in meters that a vehicle has to keep with the others. The distance is in meters and will affect the minimum moving distance. It is computed from front to back of the vehicle objects. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle whose minimum distance is being changed. + - `distance` (_float_) – Meters between both vehicles. +- **collision_detection**(**self**, **reference_actor**, **other_actor**, **detect_collision**) +Tunes on/off collisions between a vehicle and another specific actor. In order to ignore all other vehicles, traffic lights or walkers, use the specific __ignore__ methods described in this same section. + - **Parameters:** + - `reference_actor` (_[carla.Actor](#carla.Actor)_) – Vehicle that is going to ignore collisions. + - `other_actor` (_[carla.Actor](#carla.Actor)_) – The actor that `reference_actor` is going to ignore collisions with. + - `detect_collision` (_bool_) – __True__ is default and enables collisions. __False will disable them. +- **global_percentage_speed_difference**(**self**, **percentage**) +Sets the difference the vehicle's intended speed and its current speed limit. Speed limits can be exceeded by setting the `perc` to a negative value. +Default is 30. Exceeding a speed limit can be done using negative percentages. + - **Parameters:** + - `percentage` (_float_) – Percentage difference between intended speed and the current limit. +- **global_distance_to_leading_vehicle**(**self**, **distance**) +Sets the minimum distance in meters that vehicles have to keep with the rest. The distance is in meters and will affect the minimum moving distance. It is computed from center to center of the vehicle objects. + - **Parameters:** + - `distance` (_float_) – Meters between vehicles. +- **vehicle_percentage_speed_difference**(**self**, **actor**, **percentage**) +Sets the difference the vehicle's intended speed and its current speed limit. Speed limits can be exceeded by setting the `perc` to a negative value. +Default is 30. Exceeding a speed limit can be done using negative percentages. + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle whose speed behaviour is being changed. + - `percentage` (_float_) – Percentage difference between intended speed and the current limit. + +--- + +## carla.TrafficSign +
Inherited from _[carla.Actor](#carla.Actor)_

Traffic signs appearing in the simulation except for traffic lights. These have their own class inherited from this in [carla.TrafficLight](#carla.TrafficLight). Right now, speed signs, stops and yields are mainly the ones implemented, but many others are borne in mind. + +

Instance Variables

+- **trigger_volume** +A [carla.BoundingBox](#carla.BoundingBox) situated near a traffic sign where the [carla.Actor](#carla.Actor) who is inside can know about it. + +--- + +## carla.Transform +Class that defines a transformation, a combination of location and rotation, without scaling. + +

Instance Variables

+- **location** (_[carla.Location](#carla.Location)_) +Describes a point in the coordinate system. +- **rotation** (_[carla.Rotation](#carla.Rotation)_) +Describes a rotation for an object according to Unreal Engine's axis system. + +

Methods

+- **\__init__**(**self**, **location**, **rotation**) + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) + - `rotation` (_[carla.Rotation](#carla.Rotation)_) +- **\__eq__**(**self**, **other**) +Returns true if both location and rotation are equal for this and `other`. + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if any location and rotation are not equal for this and `other`. + - **Parameters:** + - `other` (_[carla.Transform](#carla.Transform)_) + - **Return:** _bool_ +- **\__str__**(**self**) +Parses both location and rotation to string. + - **Return:** _str_ +- **get_forward_vector**(**self**) +Computes a forward vector using its rotation. + - **Return:** _[carla.Vector3D](#carla.Vector3D)_ +- **transform**(**self**, **in_point**) +Translates a 3D point from global to local coordinates using the current transformation as frame of reference. + - **Parameters:** + - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied. + +--- + +## carla.Vector2D +Helper class to perform 2D operations. + +

Instance Variables

+- **x** (_float_) +X-axis value. +- **y** (_float_) +Y-axis value. + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) +- **\__add__**(**self**, **other**) +Defines addition between 2D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__sub__**(**self**, **other**) +Defines substraction between 2D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__mul__**(**self**, **other**) +Defines multiplication between 2D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__truediv__**(**self**, **other**) +Defines division between 2D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) +- **\__eq__**(**self**, **other**) +Returns true if values for every axis are equal. + - **Parameters:** + - `other` (_[carla.Vector2D](#carla.Vector2D)_) + - **Return:** _bool_ +- **\__ne__**(**self**, **bool**) +Returns true if the value for any axis is different. + - **Parameters:** + - `bool` (_[carla.Vector2D](#carla.Vector2D)_) + - **Return:** _bool_ +- **\__str__**(**self**) +Returns the axis values for the vector parsed as string. + - **Return:** _str_ + +--- + +## carla.Vector3D +Helper class to perform 3D operations. + +

Instance Variables

+- **x** (_float_) +X-axis value. +- **y** (_float_) +Y-axis value. +- **z** (_float_) +Z-axis value. + +

Methods

+- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) + - **Parameters:** + - `x` (_float_) + - `y` (_float_) + - `z` (_float_) +- **\__add__**(**self**, **other**) +Defines addition between 3D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__sub__**(**self**, **other**) +Defines substraction between 3D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__mul__**(**self**, **other**) +Defines multiplication between 3D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__truediv__**(**self**, **other**) +Defines division between 3D vectors and applies it to this. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) +Returns true if values for every axis are equal. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns true if the value for any axis is different. + - **Parameters:** + - `other` (_[carla.Vector3D](#carla.Vector3D)_) + - **Return:** _bool_ +- **\__str__**(**self**) +Returns the axis values for the vector parsed as string. + - **Return:** _str_ + +--- + +## carla.Vehicle +
Inherited from _[carla.Actor](#carla.Actor)_

One of the most important group of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in [carla.BlueprintLibrary](#carla.BlueprintLibrary) to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the traffic manager. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The vehicle's collider volume. + +

Methods

+- **get_light_state**(**self**) +Returns a flag representing the vehicle light state, this represents which lights are active or not. + - **Return:** _[carla.VehicleLightState](#carla.VehicleLightState)_ +- **set_light_state**(**self**, **light_state**) +Sets the light state of a vehicle using a VehicleLightState flag, this represents which lights are active or not. + - **Parameters:** + - `light_state` (_[carla.VehicleLightState](#carla.VehicleLightState)_) +- **apply_control**(**self**, **control**) +Applies a control object on the next tick, containing driving parameters such as throttle, steering or gear shifting. + - **Parameters:** + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **apply_physics_control**(**self**, **physics_control**) +Applies a physics control object in the next tick containing the parameters that define the vehicle as a corporeal body. E.g.: moment of inertia, mass, drag coefficient and many more. + - **Parameters:** + - `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **get_control**(**self**) +The client returns the control applied in the last tick. The method does not call the simulator. + - **Return:** _[carla.VehicleControl](#carla.VehicleControl)_ +- **get_physics_control**(**self**) +The simulator returns the last physics control applied to this vehicle. + - **Return:** _[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_ + - **Warning:** _This function does call the simulator to retrieve the value._ +- **get_speed_limit**(**self**) +The client returns the speed limit affecting this vehicle according to last tick (it does not call the simulator). The speed limit is updated when passing by a speed limit signal, so a vehicle might have none right after spawning. + - **Return:** _float_ +- **get_traffic_light**(**self**) +Retrieves the traffic light actor affecting this vehicle (if any) according to last tick. The method does not call the simulator. + - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ +- **get_traffic_light_state**(**self**) +The client returns the state of the traffic light affecting this vehicle according to last tick. The method does not call the simulator. If no traffic light is currently affecting the vehicle, returns green. + - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ +- **is_at_traffic_light**(**self**) +Vehicles will be affected by a traffic light when the light is red and the vehicle is inside its bounding box. The client returns whether a traffic light is affecting this vehicle according to last tick (it does not call the simulator). + - **Return:** _bool_ +- **set_autopilot**(**self**, **enabled**=True) +Turns on/off this vehicle's server-side autopilot. When autopilot mode is on, the vehicle will be conducted by the traffic manager client-side. + - **Parameters:** + - `enabled` (_bool_) +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.VehicleControl +Manages the basic movement of a vehicle using typical driving controls. + +

Instance Variables

+- **throttle** (_float_) +A scalar value to control the vehicle throttle [0.0, 1.0]. Default is 0.0. +- **steer** (_float_) +A scalar value to control the vehicle steering [-1.0, 1.0]. Default is 0.0. +- **brake** (_float_) +A scalar value to control the vehicle brake [0.0, 1.0]. Default is 0.0. +- **hand_brake** (_bool_) +Determines whether hand brake will be used. Default is False. +- **reverse** (_bool_) +Determines whether the vehicle will move backwards. Default is False. +- **manual_gear_shift** (_bool_) +Determines whether the vehicle will be controlled by changing gears manually. Default is False. +- **gear** (_int_) +States which gear is the vehicle running on. + +

Methods

+- **\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=True, **reverse**=True, **manual_gear_shift**=True, **gear**=0) + - **Parameters:** + - `throttle` (_float_) + - `steer` (_float_) + - `brake` (_float_) + - `hand_brake` (_bool_) + - `reverse` (_bool_) + - `manual_gear_shift` (_bool_) + - `gear` (_int_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) +- **\__str__**(**self**) + +--- + +## carla.VehicleLightState +Class that recaps the state of the lights of a vehicle, these can be used as a flags. E.g: `VehicleLightState.HighBeam & VehicleLightState.Brake` will return `True` when both are active. Lights are off by default in any situation and should be managed by the user via script. The blinkers blink automatically. _Warning: Right now, not all vehicles have been prepared to work with this functionality, this will be added to all of them in later updates_. + +

Instance Variables

+- **NONE** +All lights off. +- **Position** +- **LowBeam** +- **HighBeam** +- **Brake** +- **RightBlinker** +- **LeftBlinker** +- **Reverse** +- **Fog** +- **Interior** +- **Special1** +This is reserved for certain vehicles that can have special lights, like a siren. +- **Special2** +This is reserved for certain vehicles that can have special lights, like a siren. +- **All** +All lights on. + +--- + +## carla.VehiclePhysicsControl +Summarizes the parameters that will be used to simulate a [carla.Vehicle](#carla.Vehicle) as a physical object. The specific settings for the wheels though are stipulated using [carla.WheelPhysicsControl](#carla.WheelPhysicsControl). + +

Instance Variables

+- **torque_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the torque measured in Nm for a specific RPM of the vehicle's engine. +- **max_rpm** (_float_) +The maximum RPM of the vehicle's engine. +- **moi** (_float_) +The moment of inertia of the vehicle's engine. +- **damping_rate_full_throttle** (_float_) +Damping ratio when the throttle is maximum. +- **damping_rate_zero_throttle_clutch_engaged** (_float_) +Damping ratio when the throttle is zero with clutch engaged. +- **damping_rate_zero_throttle_clutch_disengaged** (_float_) +Damping ratio when the throttle is zero with clutch disengaged. +- **use_gear_autobox** (_bool_) +If True, the vehicle will have an automatic transmission. +- **gear_switch_time** (_float_) +Switching time between gears. +- **clutch_strength** (_float_) +The clutch strength of the vehicle in Kgm^2/s. +- **final_ratio** (_float_) +The fixed ratio from transmission to wheels. +- **forward_gears** (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) +List of objects defining the vehicle's gears. +- **mass** (_float_) +The mass of the vehicle in Kg. +- **drag_coefficient** (_float_) +Drag coefficient of the vehicle's chassis. +- **center_of_mass** (_[carla.Vector3D](#carla.Vector3D)_) +The center of mass of the vehicle. +- **steering_curve** (_list([carla.Vector2D](#carla.Vector2D))_) +Curve that indicates the maximum steering for a specific forward speed. +- **wheels** (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) +List of wheel physics objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels. + +

Methods

+- **\__init__**(**self**, **torque_curve**=[[0.0, 500.0], [5000.0, 500.0]], **max_rpm**=5000.0, **moi**=1.0, **damping_rate_full_throttle**=0.15, **damping_rate_zero_throttle_clutch_engaged**=2.0, **damping_rate_zero_throttle_clutch_disengaged**=0.35, **use_gear_autobox**=True, **gear_switch_time**=0.5, **clutch_strength**=10.0, **final_ratio**=4.0, **forward_gears**=list(), **mass**=1000.0, **drag_coefficient**=0.3, **center_of_mass**=[0.0, 0.0, 0.0], **steering_curve**=[[0.0, 1.0], [10.0, 0.5]], **wheels**=list()) +VehiclePhysicsControl constructor. + - **Parameters:** + - `torque_curve` (_list([carla.Vector2D](#carla.Vector2D))_) + - `max_rpm` (_float_) + - `moi` (_float_) + - `damping_rate_full_throttle` (_float_) + - `damping_rate_zero_throttle_clutch_engaged` (_float_) + - `damping_rate_zero_throttle_clutch_disengaged` (_float_) + - `use_gear_autobox` (_bool_) + - `gear_switch_time` (_float_) + - `clutch_strength` (_float_) + - `final_ratio` (_float_) + - `forward_gears` (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) + - `drag_coefficient` (_float_) + - `center_of_mass` (_[carla.Vector3D](#carla.Vector3D)_) + - `steering_curve` (_[carla.Vector2D](#carla.Vector2D)_) + - `wheels` (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.Walker +
Inherited from _[carla.Actor](#carla.Actor)_

This class inherits from the [carla.Actor](#carla.Actor) and defines pedestrians in the simulation. Walkers are a special type of actor that can be controlled either by an AI ([carla.WalkerAIController](#carla.WalkerAIController)) or manually via script, using a series of [carla.WalkerControl](#carla.WalkerControl) to move these and their skeletons. + +

Instance Variables

+- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) +The walker's collider defined by a bounding box. + +

Methods

+- **apply_control**(**self**, **control**) +On the next tick, the control will move the walker in a certain direction with a certain speed. Jumps can be commanded too. + - **Parameters:** + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **apply_control**(**self**, **control**) +On the next tick, the control defines a list of bone transformations that will be applied to the walker's skeleton. + - **Parameters:** + - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_) +- **get_control**(**self**) +The client returns the control applied to this walker during last tick. The method does not call the simulator. + - **Return:** _[carla.WalkerControl](#carla.WalkerControl)_ +- **\__str__**(**self**) + - **Return:** _str_ + +--- + +## carla.WalkerAIController +
Inherited from _[carla.Actor](#carla.Actor)_

Class that conducts AI control for a walker. The controllers are defined as actors, but they are quite different from the rest. They need to be attached to a parent actor during their creation, which is the walker they will be controlling (take a look at [carla.World](#carla.World) if you are yet to learn on how to spawn actors). They also need for a special blueprint (already defined in [carla.BlueprintLibrary](#carla.BlueprintLibrary) as "controller.ai.walker"). This is an empty blueprint, as the AI controller will be invisible in the simulation but will follow its parent around to dictate every step of the way. + +

Methods

+- **start**(**self**) +Enables AI control for its parent walker. +- **stop**(**self**) +Disables AI control for its parent walker. +- **go_to_location**(**self**, **destination**) +Sets the destination that the pedestrian will reach. + - **Parameters:** + - `destination` (_[carla.Location](#carla.Location)_) +- **set_max_speed**(**self**, **speed**=1.4) +Sets a speed for the walker in meters per second. + - **Parameters:** + - `speed` (_float_) – speed in m/s. An easy walking speed is set by default. +- **\__str__**(**self**) + +--- + +## carla.WalkerBoneControl +This class grants bone specific manipulation for walker. The skeletons of walkers have been unified for clarity and the transform applied to each bone are always relative to its parent. Take a look [here](../tuto_G_control_walker_skeletons.md) to learn more on how to create a walker and define its movement. + +

Instance Variables

+- **bone_transforms** (_list([name,transform])_) +List of tuples where the first value is the bone's name and the second value stores the transformation (changes in location and rotation) that will be applied to it. + +

Methods

+- **\__init__**(**self**, **list(name,transform)**) +Intializes an object containing moves to be applied on tick. These are listed with the name of the bone and the transform that will be applied to it. + - **Parameters:** + - `list(name,transform)` (_tuple_) +- **\__str__**(**self**) + +--- + +## carla.WalkerControl +This class defines specific directions that can be commanded to a [carla.Walker](#carla.Walker) to control it via script. The walker's animations will blend automatically with the parameters defined in this class when applied, though specific skeleton moves can be obtained through class.WalkerBoneControl. + + AI control can be settled for walkers, but the control used to do so is [carla.WalkerAIController](#carla.WalkerAIController). + +

Instance Variables

+- **direction** (_[carla.Vector3D](#carla.Vector3D)_) +Vector using global coordinates that will correspond to the direction of the walker. +- **speed** (_float_) +A scalar value to control the walker's speed. +- **jump** (_bool_) +If True, the walker will perform a jump. + +

Methods

+- **\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False) + - **Parameters:** + - `direction` (_[carla.Vector3D](#carla.Vector3D)_) + - `speed` (_float_) + - `jump` (_bool_) +- **\__eq__**(**self**, **other**) +Compares every variable with `other` and returns True if these are all the same. + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__ne__**(**self**, **other**) +Compares every variable with `other` and returns True if any of these differ. + - **Parameters:** + - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) +- **\__str__**(**self**) + +--- + +## carla.Waypoint +Waypoints in CARLA are described as 3D directed points. They store a certain [carla.Transform](#carla.Transform) which locates the waypoint in a road and orientates it according to the lane. They also store the road information belonging to said point regarding its lane and lane markings. All of this information is retrieved as provided by the OpenDRIVE file. + +

Instance Variables

+- **id** (_int_) +The identificator is generated using a hash combination of the road, section, lane and s values that correspond to said point in the OpenDRIVE geometry. The s precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator. +- **transform** (_[carla.Transform](#carla.Transform)_) +Position and orientation of the waypoint according to the current lane information. This data is computed the first time it is accessed. It is not created right away in order to ease computing costs when lots of waypoints are created but their specific transform is not needed. +- **road_id** (_int_) +OpenDRIVE road's id. +- **section_id** (_int_) +OpenDRIVE section's id, based on the order that they are originally defined. +- **lane_id** (_int_) +OpenDRIVE lane's id, this value can be positive or negative which represents the direction of the current lane with respect to the road. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20). +- **s** (_float_) +OpenDRIVE s value of the current position. +- **is_junction** (_bool_) +True if the current Waypoint is on a junction as defined by OpenDRIVE. +- **lane_width** (_float_) +Horizontal size of the road at current s. +- **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) +Lane change definition of the current Waypoint's location, based on the traffic rules defined in the OpenDRIVE file. It states if a lane change can be done and in which direction. +- **lane_type** (_[carla.LaneType](#carla.LaneType)_) +The lane type of the current Waypoint, based on OpenDRIVE 1.4 standard. +- **right_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The right lane marking information based on the direction of the Waypoint. +- **left_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) +The left lane marking information based on the direction of the Waypoint. + +

Methods

+- **get_left_lane**(**self**) +Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, taking into account if the lane change is allowed in this location. +Will return None if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **get_right_lane**(**self**) +Generates a waypoint at the center of the right lane based on the direction of the current waypoint, taking into account if the lane change is allowed in this location. +Will return None if the lane does not exist. + - **Return:** _[carla.Waypoint](#carla.Waypoint)_ +- **next**(**self**, **distance**) +Returns a list of waypoints at a certain approximate `distance` from the current one. It takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option. +The list may be empty if the lane is not connected to any other at the specified distance. + - **Parameters:** + - `distance` (_float_) – The approximate distance where to get the next waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **next_until_lane_end**(**self**, **distance**) +Returns a list of waypoints from this to the end of the lane separated by a certain `distance`. + - **Parameters:** + - `distance` (_float_) – The approximate distance between waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **previous**(**self**, **distance**) +This method does not return the waypoint previously visited by an actor, but a list of waypoints at an approximate `distance` but in the opposite direction of the lane. Similarly to **next()**, it takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option. +The list may be empty if the lane is not connected to any other at the specified distance. + - **Parameters:** + - `distance` (_float_) – The approximate distance where to get the previous waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **previous_until_lane_start**(**self**, **distance**) +Returns a list of waypoints from this to the start of the lane separated by a certain `distance`. + - **Parameters:** + - `distance` (_float_) – The approximate distance between waypoints. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ +- **get_landmarks**(**self**, **distance**, **stop_at_junction**=False) +Returns a list of landmarks in the road from the current waypoint until the specified distance. + - **Parameters:** + - `distance` (_float_) – Distance to search for landmarks from the current waypoint (metres in OpenDRIVE). + - `stop_at_junction` (_bool_) – Enables or disables the landmark search through junctions. + - **Return:** _list([carla.Landmark](#carla.Landmark))_ +- **get_landmarks_of_type**(**self**, **distance**, **type**, **stop_at_junction**=False) +Returns a list of landmarks in the road of a certain type from the current waypoint until the specified distance. + - **Parameters:** + - `distance` (_float_) – Distance to search for landmarks from the current waypoint (metres in OpenDRIVE). + - `type` (_str_) – Type of landmarks to search. + - `stop_at_junction` (_bool_) – Enables or disables the landmark search through junctions. + - **Return:** _list([carla.Landmark](#carla.Landmark))_ +- **\__str__**(**self**) + +--- + +## carla.WeatherParameters +This class defines objects containing lightning and weather specifications that can later be applied in [carla.World](#carla.World). So far, these conditions only intervene with [sensor.camera.rgb](/bp_library/). They neither affect the actor's physics nor other sensors. + Each of these parameters acts indepently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py). + +

Instance Variables

+- **cloudiness** (_float_) +Values range from 0 to 100, being 0 a clear sky and 100 one completely covered with clouds. +- **precipitation** (_float_) +Rain intensity values range from 0 to 100, being 0 none at all and 100 a heavy rain. +- **precipitation_deposits** (_float_) +Determines the creation of puddles. Values range from 0 to 100, being 0 none at all and 100 a road completely capped with water. Puddles are created with static noise, meaning that they will always appear at the same locations. +- **wind_intensity** (_float_) +Controls the strenght of the wind with values from 0, no wind at all, to 100, a strong wind. The wind does affect rain direction and leaves from trees, so this value is restricted to avoid animation issues. +- **fog_density** (_float_) +Fog density. It only affects the RGB camera sensor. Values range from 0 to 100. +- **fog_distance** (_float_) +Fog start distance (in meters). Values range from 0 to infinite. +- **wetness** (_float_) +Wetness intensity. It only affects the RGB camera sensor. Values range from 0 to 100. +- **sun_azimuth_angle** (_float_) +The azimuth angle of the sun in degrees. Values range from 0 to 360. Zero is an origin point in a sphere determined by Unreal Engine. +- **sun_altitude_angle** (_float_) +Altitude angle of the sun in degrees. Values range from -90 to 90 corresponding to midnight and midday each. + +

Methods

+- **\__init__**(**self**, **cloudiness**=0.0, **precipitation**=0.0, **precipitation_deposits**=0.0, **wind_intensity**=0.0, **sun_azimuth_angle**=0.0, **sun_altitude_angle**=0.0) +Method to initialize an object defining weather conditions. This class has some presets for different noon and sunset conditions listed in a note below. + - **Parameters:** + - `cloudiness` (_float_) – 0 is a clear sky, 100 complete overcast. + - `precipitation` (_float_) – 0 is no rain at all, 100 a heavy rain. + - `precipitation_deposits` (_float_) – 0 means no puddles on the road, 100 means roads completely capped by rain. + - `wind_intensity` (_float_) – 0 is calm, 100 a strong wind. + - `sun_azimuth_angle` (_float_) – 90 is midday, -90 is midnight. + - `sun_altitude_angle` (_float_) – 0 is an arbitrary North, 180 its corresponding South. + - **Note:** _ClearNoon, CloudyNoon, WetNoon, WetCloudyNoon, SoftRainNoon, MidRainyNoon, HardRainNoon, ClearSunset, CloudySunset, WetSunset, WetCloudySunset, SoftRainSunset, MidRainSunset, HardRainSunset. +_ +- **\__eq__**(**self**, **other**) +Returns True if both objects' variables are the same. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns True if both objects' variables are different. + - **Return:** _bool_ +- **\__str__**(**self**) + +--- + +## carla.WheelPhysicsControl +Class that defines specific physical parameters for wheel objects that will be part of a [carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl) to simulate vehicle it as a material object. + +

Instance Variables

+- **tire_friction** (_float_) +A scalar value that indicates the friction of the wheel. +- **damping_rate** (_float_) +Damping rate of the wheel. +- **max_steer_angle** (_float_) +Maximum angle in degrees that the wheel can steer. +- **radius** (_float_) +Radius of the wheel in centimeters. +- **max_brake_torque** (_float_) +Maximum brake torque in Nm. +- **max_handbrake_torque** (_float_) +Maximum handbrake torque in Nm. +- **position** (_[carla.Vector3D](#carla.Vector3D)_) +World position of the wheel. This is a read-only parameter. + +

Methods

+- **\__init__**(**self**, **tire_friction**=2.0, **damping_rate**=0.25, **max_steer_angle**=70.0, **radius**=30.0, **max_brake_torque**=1500.0, **max_handbrake_torque**=3000.0, **position**=(0.0,0.0,0.0)) + - **Parameters:** + - `tire_friction` (_float_) + - `damping_rate` (_float_) + - `max_steer_angle` (_float_) + - `radius` (_float_) + - `max_brake_torque` (_float_) + - `max_handbrake_torque` (_float_) + - `position` (_[carla.Vector3D](#carla.Vector3D)_) +- **\__eq__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__ne__**(**self**, **other**) + - **Parameters:** + - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) +- **\__str__**(**self**) + +--- + +## carla.World +World objects are created by the client to have a place for the simulation to happen. The world contains the map we can see, meaning the asset, not the navigation map. Navigation maps are part of the [carla.Map](#carla.Map) class. It also manages the weather and actors present in it. There can only be one world per simulation, but it can be changed anytime. + +

Instance Variables

+- **id** (_int_) +The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change everytime a world is disabled or reloaded. Keeping track is useful to avoid possible issues. +- **debug** (_[carla.DebugHelper](#carla.DebugHelper)_) +Responsible for creating different shapes for debugging. Take a look at its class to learn more about it. + +

Methods

+- **\__str__**(**self**) +The content of the world is parsed and printed as a brief report of its current state. + - **Return:** _string_ +- **apply_settings**(**self**, **world_settings**) +This method applies settings contained in an object to the simulation running and returns the ID of the frame they were implemented. + - **Parameters:** + - `world_settings` (_[carla.WorldSettings](#carla.WorldSettings)_) + - **Return:** _int_ +- **get_actor**(**self**, **actor_id**) +Looks up for an actor by ID and returns None if not found. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_actors**(**self**, **actor_ids**=None) +Retrieves a list of [carla.Actor](#carla.Actor) elements, either using a list of IDs provided or just listing everyone on stage. If an ID does not correspond with any actor, it will be excluded from the list returned, meaning that both the list of IDs and the list of actors may have different lengths. + - **Parameters:** + - `actor_ids` (_list_) – The IDs of the actors being searched. By default it is set to None and returns every actor on scene. + - **Return:** _[carla.ActorList](#carla.ActorList)_ +- **get_blueprint_library**(**self**) +Returns a list of actor blueprints available to ease the spawn of these into the world. + - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ +- **get_map**(**self**) +Returns the object containing the navigation map used to describe this world. + - **Return:** _[carla.Map](#carla.Map)_ +- **get_random_location_from_navigation**(**self**) +This can only be used with walkers. It retrieves a random location to be used as a destination using the **go_to_location()** method in [carla.WalkerAIController](#carla.WalkerAIController). This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example. + - **Return:** _[carla.Location](#carla.Location)_ +- **get_snapshot**(**self**) +Returns a snapshot of the world at a certain moment comprising all the information about the actors. + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ +- **get_spectator**(**self**) +Returns the spectator actor. The spectator is a special type of actor created by Unreal Engine, usually with ID=0, that acts as a camera and controls the view in the simulator window. + - **Return:** _[carla.Actor](#carla.Actor)_ +- **get_settings**(**self**) +Returns an object containing some data about the simulation such as synchrony between client and server or rendering mode. + - **Return:** _[carla.WorldSettings](#carla.WorldSettings)_ +- **get_weather**(**self**) +Retrieves an object containing weather parameters currently active in the simulation, mainly cloudiness, precipitation, wind and sun position. + - **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_ +- **on_tick**(**self**, **callback**) +The method will start callbacks for a defined function `callback`. It will return the ID for this callback so it can be removed with **remove_on_tick()**. + - **Parameters:** + - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) – A defined function with a snapshot as compulsory parameter that will be called every tick. + - **Return:** _int_ +- **remove_on_tick**(**self**, **callback_id**) +Stops the callback for `callback_id` started with **on_tick()**. + - **Parameters:** + - `callback_id` (_callback_) – The callback to be removed. +- **set_weather**(**self**, **weather**) +Changes the weather parameteres ruling the simulation to another ones defined in an object. + - **Parameters:** + - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) – New conditions to be applied. +- **spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +The method will create, return and spawn an actor into the world. The actor will need an available blueprint to be created and a transform (location and rotation). It can also be attached to a parent with a certain attachment type. + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) – The reference from which the actor will be created. + - `transform` (_[carla.Transform](#carla.Transform)_) – Contains the location and orientation the actor will be spawned with. + - `attach_to` (_[carla.Actor](#carla.Actor)_) – The parent object that the spawned actor will follow around. + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) – Determines how fixed and rigorous should be the changes in position according to its parent object. + - **Return:** _[carla.Actor](#carla.Actor)_ +- **tick**(**self**) +This only has effect on synchronous mode, when both client and server move together. The method tells the server when to step to the next frame and returns the id of the newly started frame. + - **Return:** _int_ +- **try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid) +Same as **spawn_actor()** but returns None on failure instead of throwing an exception. + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) – The reference from which the actor will be created. + - `transform` (_[carla.Transform](#carla.Transform)_) – Contains the location and orientation the actor will be spawned with. + - `attach_to` (_[carla.Actor](#carla.Actor)_) – The parent object that the spawned actor will follow around. + - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) – Determines how fixed and rigorous should be the changes in position according to its parent object. + - **Return:** _[carla.Actor](#carla.Actor)_ +- **wait_for_tick**(**self**, **seconds**=10.0) +The client tells the server to block calling thread until a **world_tick()** is received. + - **Parameters:** + - `seconds` (_float_) – Maximum time in seconds the server should wait for a tick. It is set to 10.0 by default. + - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ + +--- + +## carla.WorldSettings +The simulation has some advanced configuration options that are contained in this class and can be managed using [carla.World](#carla.World) and its methods. These allow the user to choose between client-server synchrony/asynchrony, activation of "no rendering mode" and either if the simulation should run with a fixed or variable time-step. Check [this](../adv_synchrony_timestep.md) out if you want to learn about it. + +

Instance Variables

+- **synchronous_mode** (_bool_) +States the synchrony between client and server. When set to true, the server will wait for a client tick in order to move forward. It is false by default. +- **no_rendering_mode** (_bool_) +When enabled, the simulation will run no rendering at all. This is mainly used to avoid overhead during heavy traffic simulations. It is false by default. +- **fixed_delta_seconds** (_float_) +Ensures that the time elapsed between two steps of the simulation is fixed. Set this to 0.0 to work with a variable time-step, as happens by default. + +

Methods

+- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0) +Creates an object containing desired settings that could later be applied through [carla.World](#carla.World) and its method **apply_settings()**. + - **Parameters:** + - `synchronous_mode` (_bool_) – Set this to true to enable client-server synchrony. + - `no_rendering_mode` (_bool_) – Set this to true to completely disable rendering in the simulation. + - `fixed_delta_seconds` (_float_) – Set this time in seconds to get a fixed time-step in between frames. 0.0 means variable time-step and it is the default mode. +- **\__eq__**(**self**, **other**) +Returns True if both objects' variables are the same. + - **Parameters:** + - `other` (_[carla.WorldSettings](#carla.WorldSettings)_) – Settings to be compared with. + - **Return:** _bool_ +- **\__ne__**(**self**, **other**) +Returns True if both objects' variables are different. + - **Parameters:** + - `other` (_[carla.WorldSettings](#carla.WorldSettings)_) – Settings to be compared with. + - **Return:** _bool_ +- **\__str__**(**self**) +Parses the established settings to a string and shows them in command line. + - **Return:** _str_ + +--- + +## carla.WorldSnapshot +This snapshot comprises all the information for every actor on scene at a certain moment of time. It creates and gives acces to a data structure containing a series of [carla.ActorSnapshot](#carla.ActorSnapshot). The client recieves a new snapshot on every tick that cannot be stored. + +

Instance Variables

+- **id** (_int_) +A value unique for every snapshot to differenciate them. +- **frame** (_int_) +Simulation frame in which the snapshot was taken. +- **timestamp** (_[carla.Timestamp](#carla.Timestamp)_) +Precise moment in time when snapshot was taken. This class works in seconds as given by the operative system. + +

Methods

+- **\__eq__**(**self**, **other**) +Returns True if both **timestamp** are the same. + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) + - **Return:** _bool_ +- **\__iter__**(**self**) +Method that enables iteration for this class using **timestamp** as reference value. +- **\__ne__**(**self**, **other**) +Returns True if both **timestamp** are different. + - **Parameters:** + - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) + - **Return:** _bool_ +- **\__len__**(**self**) +Returns the amount of [carla.ActorSnapshot](#carla.ActorSnapshot) present in this snapshot. + - **Return:** _int_ +- **find**(**self**, **actor_id**) +Given a certain actor ID, returns its corresponding snapshot or None if it is not found. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _[carla.ActorSnapshot](#carla.ActorSnapshot)_ +- **has_actor**(**self**, **actor_id**) +Given a certain actor ID, checks if there is a snapshot corresponding it and so, if the actor was present at that moment. + - **Parameters:** + - `actor_id` (_int_) + - **Return:** _bool_ + +--- + +## command.ApplyAngularVelocity +Command adaptation of **set_angular_velocity()** in [carla.Actor](#carla.Actor). Sets an actor's angular velocity. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **angular_velocity** (_[carla.Vector3D](#carla.Vector3D)_) +The 3D angular velocity that will be applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **angular_velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyImpulse +Command adaptation of **add_impulse()** in [carla.Actor](#carla.Actor). Adds impulse to an actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **impulse** (_[carla.Vector3D](#carla.Vector3D)_) +Impulse applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **impulse**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyTransform +Command adaptation of **set_transform()** in [carla.Actor](#carla.Actor). Sets a new transform to an actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transformation to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **transform**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `transform` (_[carla.Transform](#carla.Transform)_) + +--- + +## command.ApplyVehicleControl +Command adaptation of **apply_control()** in [carla.Vehicle](#carla.Vehicle). Applies a certain control to a vehicle. + +

Instance Variables

+- **actor_id** (_int_) +Vehicle actor affected by the command. +- **control** (_[carla.VehicleControl](#carla.VehicleControl)_) +Vehicle control to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) + +--- + +## command.ApplyVelocity +Command adaptation of **set_velocity()** in [carla.Actor](#carla.Actor). Sets an actor's velocity. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **velocity** (_[carla.Vector3D](#carla.Vector3D)_) +The 3D velocity applied to the actor. + +

Methods

+- **\__init__**(**self**, **actor**, **velocity**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + +## command.ApplyWalkerControl +Command adaptation of **apply_control()** in [carla.Walker](#carla.Walker). Applies a control to a walker. + +

Instance Variables

+- **actor_id** (_int_) +Walker actor affected by the command. +- **control** (_[carla.WalkerControl](#carla.WalkerControl)_) +Walker control to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **control**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) + +--- + +## command.ApplyWalkerState +Apply a state to the walker actor. Specially useful to initialize an actor them with a specific location, orientation and speed. + +

Instance Variables

+- **actor_id** (_int_) +Walker actor affected by the command. +- **transform** (_[carla.Transform](#carla.Transform)_) +Transform to be applied. +- **speed** (_float_) +Speed to be applied. + +

Methods

+- **\__init__**(**self**, **actor**, **transform**, **speed**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `transform` (_[carla.Transform](#carla.Transform)_) + - `speed` (_float_) + +--- + +## command.DestroyActor +Command adaptation of **destroy()** in [carla.Actor](#carla.Actor) that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with **apply_batch_synch()** in [carla.Client](#carla.Client) there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. + +

Methods

+- **\__init__**(**self**, **actor**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + +--- + +## command.Response +States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed). actor ID, depending on whether or not the command succeeded. The method **apply_batch_sync()** in [carla.Client](#carla.Client) returns a list of these to summarize the execution of a batch. + +

Instance Variables

+- **actor_id** (_int_) +Actor to whom the command was applied to. States that the command was successful. +- **error** (_str_) +A string stating the command has failed. + +

Methods

+- **has_error**(**self**) +Returns True if the command represents a successful execution and False if not. + - **Return:** _bool_ + +--- + +## command.SetAutopilot +Command adaptation of **set_autopilot()** in [carla.Vehicle](#carla.Vehicle). Turns on/off the vehicle's server-side autopilot. + +

Instance Variables

+- **actor_id** (_int_) +Actor that is affected by the command. +- **enabled** (_bool_) +If autopilot should be activated or not. + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `enabled` (_bool_) + +--- + +## command.SetSimulatePhysics +Command adaptation of **set_simulate_physics()** in [carla.Actor](#carla.Actor). Determines whether an actor will be affected by physics or not. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **enabled** (_bool_) +If physics should be activated or not. + +

Methods

+- **\__init__**(**self**, **actor**, **enabled**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `enabled` (_bool_) + +--- + +## command.SpawnActor +Command adaptation of **spawn_actor()** in [carla.World](#carla.World). Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it. + +

Instance Variables

+- **transform** (_[carla.Transform](#carla.Transform)_) +Transform to be applied. +- **parent_id** (_int_) +Identificator of the parent actor. + +

Methods

+- **\__init__**(**self**) +- **\__init__**(**self**, **blueprint**, **transform**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) +- **\__init__**(**self**, **blueprint**, **transform**, **parent**) + - **Parameters:** + - `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) + - `transform` (_[carla.Transform](#carla.Transform)_) + - `parent` (_[carla.Actor](#carla.Actor) or int_) +- **then**(**self**, **command**) +Links another command to be executed right after. It allows to ease very common flows such as spawning a set of vehicles by command and then using this method to set them to autopilot automatically. + - **Parameters:** + - `command` (_[carla.Command](#carla.Command)_) – CommandType. + +--- \ No newline at end of file diff --git a/Docs/python_api.md b/Docs/python_api.md index d54b97be3..ef803f8ac 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -1,4 +1,6 @@ #Python API reference +This reference contains all the details about latest version of the Python API. To consult a valid reference for a specific CARLA release, please select it from the list hereunder.
Previous references


+ ## carla.Actor CARLA defines actors as anything that plays a role in the simulation or can be moved around. That includes: pedestrians, vehicles, sensors and traffic signs (considering traffic lights as part of these). Actors are spawned in the simulation by [carla.World](#carla.World) and they need for a [carla.ActorBlueprint](#carla.ActorBlueprint) to be created. These blueprints belong into a library provided by CARLA, find more about them [here](bp_library.md). @@ -28,32 +30,42 @@ Tells the simulator to destroy this actor and returns True if it was succ - **Return:** _bool_ - **Warning:** _This method blocks the script until the destruction is completed by the simulator. _ -- **get_acceleration**(**self**) + +
Getters
+
- **get_acceleration**(**self**) Returns the actor's 3D acceleration vector the client recieved during last tick. The method does not call the simulator. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **get_angular_velocity**(**self**) Returns the actor's angular velocity vector the client recieved during last tick. The method does not call the simulator. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Setter:** _[carla.Actor.set_angular_velocity](#carla.Actor.set_angular_velocity)_ - **get_location**(**self**) Returns the actor's location the client recieved during last tick. The method does not call the simulator. - **Return:** _[carla.Location](#carla.Location)_ + - **Setter:** _[carla.Actor.set_location](#carla.Actor.set_location)_ - **get_transform**(**self**) Returns the actor's transform (location and rotation) the client recieved during last tick. The method does not call the simulator. - **Return:** _[carla.Transform](#carla.Transform)_ + - **Setter:** _[carla.Actor.set_transform](#carla.Actor.set_transform)_ - **get_velocity**(**self**) Returns the actor's velocity vector the client recieved during last tick. The method does not call the simulator. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ + - **Setter:** _[carla.Actor.set_velocity](#carla.Actor.set_velocity)_ - **get_world**(**self**) Returns the world this actor belongs to. - **Return:** _[carla.World](#carla.World)_ -- **set_angular_velocity**(**self**, **angular_velocity**) + +
Setters
+
- **set_angular_velocity**(**self**, **angular_velocity**) Changes the actor's angular velocity vector. - **Parameters:** - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) + - **Getter:** _[carla.Actor.get_angular_velocity](#carla.Actor.get_angular_velocity)_ - **set_location**(**self**, **location**) Teleports the actor to a given location. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) + - **Getter:** _[carla.Actor.get_location](#carla.Actor.get_location)_ - **set_simulate_physics**(**self**, **enabled**=True) Enables or disables the simulation of physics on this actor. - **Parameters:** @@ -62,13 +74,15 @@ Enables or disables the simulation of physics on this actor. Teleports the actor to a given transform (location and rotation). - **Parameters:** - `transform` (_[carla.Transform](#carla.Transform)_) + - **Getter:** _[carla.Actor.get_transform](#carla.Actor.get_transform)_ - **set_velocity**(**self**, **velocity**) Sets the actor's velocity vector. - **Parameters:** - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) + - **Getter:** _[carla.Actor.get_velocity](#carla.Actor.get_velocity)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -97,8 +111,8 @@ Reads the attribute as int. - **as_str**(**self**) Reads the attribute as string. -

Dunder methods

-- **\__bool__**(**self**) +
Dunder methods
+
- **\__bool__**(**self**) - **\__float__**(**self**) - **\__int__**(**self**) - **\__str__**(**self**) @@ -151,19 +165,25 @@ Returns True if any of the tags listed for this blueprint matches `wildca - **Parameters:** - `wildcard_pattern` (_str_) - **Return:** _bool_ -- **get_attribute**(**self**, **id**) + +
Getters
+
- **get_attribute**(**self**, **id**) Returns the actor's attribute with `id` as identifier if existing. - **Parameters:** - `id` (_str_) - **Return:** _[carla.ActorAttribute](#carla.ActorAttribute)_ -- **set_attribute**(**self**, **id**, **value**) + - **Setter:** _[carla.ActorBlueprint.set_attribute](#carla.ActorBlueprint.set_attribute)_ + +
Setters
+
- **set_attribute**(**self**, **id**, **value**) If the `id` attribute is modifiable, changes its value to `value`. - **Parameters:** - `id` (_str_) – The identifier for the attribute that is intended to be changed. - `value` (_str_) – The new value for said attribute. + - **Getter:** _[carla.ActorBlueprint.get_attribute](#carla.ActorBlueprint.get_attribute)_ -

Dunder methods

-- **\__iter__**(**self**) +
Dunder methods
+
- **\__iter__**(**self**) Allows iteration within this class' attributes. - **\__len__**(**self**) Returns the amount of attributes for this blueprint. @@ -186,8 +206,8 @@ Finds an actor using its identifier and returns it or None if it is not p - `actor_id` (_int_) - **Return:** _[carla.Actor](#carla.Actor)_ -

Dunder methods

-- **\__getitem__**(**self**, **pos**=int) +
Dunder methods
+
- **\__getitem__**(**self**, **pos**=int) Returns the actor corresponding to `pos` position in the list. - **Return:** _[carla.Actor](#carla.Actor)_ - **\__iter__**(**self**) @@ -209,7 +229,9 @@ A class that comprises all the information for an actor at a certain moment in t An identifier for the snapshot itself.

Methods

-- **get_acceleration**(**self**) + +
Getters
+
- **get_acceleration**(**self**) Returns the acceleration vector registered for an actor in that tick. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **get_angular_velocity**(**self**) @@ -252,8 +274,8 @@ Returns the blueprint corresponding to that identifier. - `id` (_str_) - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ -

Dunder methods

-- **\__getitem__**(**self**, **pos**=int) +
Dunder methods
+
- **\__getitem__**(**self**, **pos**=int) Returns the blueprint stored in `pos` position inside the data structure containing them. - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ - **\__iter__**(**self**) @@ -288,7 +310,9 @@ Returns **True** if a point passed in world space is inside this bounding box. - `world_point` (_[carla.Location](#carla.Location)_) – The point in world space to be checked. - `transform` (_[carla.Transform](#carla.Transform)_) – Contains location and rotation needed to convert this object's local space to world space. - **Return:** _bool_ -- **get_local_vertices**(**self**) + +
Getters
+
- **get_local_vertices**(**self**) Returns a list containing the locations of this object's vertices in local space. - **Return:** _list([carla.Location](#carla.Location))_ - **get_world_vertices**(**self**, **transform**) @@ -297,8 +321,8 @@ Returns a list containing the locations of this object's vertices in world space - `transform` (_[carla.Transform](#carla.Transform)_) – Contains location and rotation needed to convert this object's local space to world space. - **Return:** _list([carla.Location](#carla.Location))_ -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.BoundingBox](#carla.BoundingBox)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.BoundingBox](#carla.BoundingBox)) Returns true if both location and extent are equal for this and `other`. - **Return:** _bool_ - **\__ne__**(**self**, **other**=[carla.BoundingBox](#carla.BoundingBox)) @@ -384,7 +408,9 @@ Enables the recording feature, which will start saving every information possibl - `filename` (_str_) – Name of the file to write the recorded data. A simple name will save the recording in 'CarlaUE4/Saved/recording.log'. Otherwise, if some folder appears in the name, it will be considered an absolute path. - **stop_recorder**(**self**) Stops the recording in progress. If you specified a path in `filename`, the recording will be there. If not, look inside `CarlaUE4/Saved/`. -- **get_available_maps**(**self**) + +
Getters
+
- **get_available_maps**(**self**) Returns a list of strings containing the paths of the maps available on server. These paths are dynamic, they will be created during the simulation and so you will not find them when looking up in your files. One of the possible returns for this method would be: ['/Game/Carla/Maps/Town01', '/Game/Carla/Maps/Town02', @@ -408,7 +434,9 @@ Returns an instance of the traffic manager related to the specified port. If it - **get_world**(**self**) Returns the world object currently active in the simulation. This world will be later used for example to load maps. - **Return:** _[carla.World](#carla.World)_ -- **set_replayer_time_factor**(**self**, **time_factor**=1.0) + +
Setters
+
- **set_replayer_time_factor**(**self**, **time_factor**=1.0) When used, the time speed of the reenacted simulation is modified at will. It can be used several times while a playback is in curse. - **Parameters:** - `time_factor` (_float_) – 1.0 means normal time speed. Greater than 1.0 means fast motion (2.0 would be double speed) and lesser means slow motion (0.5 would be half speed). @@ -454,8 +482,8 @@ Initializes a color, black by default. - `b` (_int_) - `a` (_int_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.Color](#carla.Color)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.Color](#carla.Color)) - **\__ne__**(**self**, **other**=[carla.Color](#carla.Color)) - **\__str__**(**self**) @@ -541,8 +569,8 @@ Quotient between current RPM and MaxRPM where the autonomous gear box should shi - `down_ratio` (_float_) - `up_ratio` (_float_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.GearPhysicsControl](#carla.GearPhysicsControl)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.GearPhysicsControl](#carla.GearPhysicsControl)) - **\__ne__**(**self**, **other**=[carla.GearPhysicsControl](#carla.GearPhysicsControl)) - **\__str__**(**self**) @@ -566,8 +594,8 @@ Height regarding ground level. - `longitude` (_float_) - `altitude` (_float_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.GeoLocation](#carla.GeoLocation)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.GeoLocation](#carla.GeoLocation)) - **\__ne__**(**self**, **other**=[carla.GeoLocation](#carla.GeoLocation)) - **\__str__**(**self**) @@ -586,8 +614,8 @@ West/East value of a point on the map.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -604,8 +632,8 @@ Angular velocity in rad/sec.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -632,8 +660,8 @@ Saves the image to disk using a converter pattern stated as `color_converter`. T - `path` (_str_) – Path that will contain the image. - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) – Default Raw will make no changes. -

Dunder methods

-- **\__getitem__**(**self**, **pos**=int) +
Dunder methods
+
- **\__getitem__**(**self**, **pos**=int) - **\__iter__**(**self**) - **\__len__**(**self**) - **\__setitem__**(**self**, **pos**=int, **color**=[carla.Color](#carla.Color)) @@ -651,7 +679,9 @@ Identificator found in the OpenDRIVE file. Bounding box encapsulating the junction lanes.

Methods

-- **get_waypoints**(**self**, **lane_type**) + +
Getters
+
- **get_waypoints**(**self**, **lane_type**) Returns a list of pairs of waypoints. Every tuple on the list contains first an initial and then a final waypoint within the intersection boundaries that describe the beginning and the end of said lane along the junction. Lanes follow their OpenDRIVE definitions so there may be many different tuples with the same starting waypoint due to possible deviations, as this are considered different lanes. - **Parameters:** - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – Type of lanes to get the waypoints. @@ -711,7 +741,9 @@ A waypoint placed in the lane of the one that made the query and at the `s` of t The location and orientation of the landmark in the simulation.

Methods

-- **get_lane_validities**(**self**) + +
Getters
+
- **get_lane_validities**(**self**) Returns which lanes the landmark is affecting to. As there may be specific lanes where the landmark is not effective, the return is a list of pairs containing ranges of the __lane_id__ affected: Example: In a road with 5 lanes, being 3 not affected: [(from_lane1,to_lane2),(from_lane4,to_lane5)]. - **Return:** _list(tuple(int))_ @@ -833,8 +865,8 @@ List of lane markings that have been crossed and detected by the sensor.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -933,13 +965,15 @@ List of 3D points received as data. Saves the point cloud to disk as a .ply file describing data from 3D scanners. The files generated are ready to be used within [MeshLab](http://www.meshlab.net/), an open source system for processing said files. Just take into account that axis may differ from Unreal Engine and so, need to be reallocated. - **Parameters:** - `path` (_str_) -- **get_point_count**(**self**, **channel**) + +
Getters
+
- **get_point_count**(**self**, **channel**) Retrieves the number of points sorted by channel that are generated by this measure. Sorting by channel allows to identify the original channel for every point. - **Parameters:** - `channel` (_int_) -

Dunder methods

-- **\__getitem__**(**self**, **pos**=int) +
Dunder methods
+
- **\__getitem__**(**self**, **pos**=int) - **\__iter__**(**self**) - **\__len__**(**self**) - **\__setitem__**(**self**, **pos**=int, **location**=[carla.Location](#carla.Location)) @@ -1154,8 +1188,8 @@ Returns Euclidean distance in meters from this location to another one. - `location` (_[carla.Location](#carla.Location)_) – The other point to compute the distance with. - **Return:** _float_ -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.Location](#carla.Location)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.Location](#carla.Location)) Returns __True__ if both locations are the same point in space. - **Return:** _bool_ - **\__ne__**(**self**, **other**=[carla.Location](#carla.Location)) @@ -1198,7 +1232,9 @@ Converts a given `location`, a point in the simulation, to a [carla.GeoLocation] - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - **Return:** _[carla.GeoLocation](#carla.GeoLocation)_ -- **get_all_landmarks**(**self**) + +
Getters
+
- **get_all_landmarks**(**self**) Returns all the landmarks in the map. Landmarks retrieved using this method have a __null__ waypoint. - **Return:** _list([carla.Landmark](#carla.Landmark))_ - **get_all_landmarks_from_id**(**self**, **opendrive_id**) @@ -1238,8 +1274,8 @@ Returns a waypoint if all the parameters passed are correct. Otherwise, returns - `s` (_float_) – Specify the length from the road start. - **Return:** _[carla.Waypoint](#carla.Waypoint)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1256,8 +1292,8 @@ Distance between `actor` and `other`.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1295,8 +1331,8 @@ The velocity of the detected object towards the sensor in m/s.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1308,11 +1344,13 @@ The velocity of the detected object towards the sensor in m/s. The complete information of the [carla.RadarDetection](#carla.RadarDetection) the radar has registered.

Methods

-- **get_detection_count**(**self**) + +
Getters
+
- **get_detection_count**(**self**) Retrieves the number of entries generated, same as **\__str__()**. -

Dunder methods

-- **\__getitem__**(**self**, **pos**=int) +
Dunder methods
+
- **\__getitem__**(**self**, **pos**=int) - **\__iter__**(**self**) - **\__len__**(**self**) - **\__setitem__**(**self**, **pos**=int, **detection**=[carla.RadarDetection](#carla.RadarDetection)) @@ -1339,12 +1377,14 @@ Degrees around the X-axis. - `pitch` (_float_) – Y rotation in degrees. - `yaw` (_float_) – Z rotation in degrees. - `roll` (_float_) – X rotation in degrees. -- **get_forward_vector**(**self**) + +
Getters
+
- **get_forward_vector**(**self**) Computes the vector pointing forward according to the orientation of each axis. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.Rotation](#carla.Rotation)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.Rotation](#carla.Rotation)) Returns __True__ if both rotations represent the same orientation of each axis. - **Return:** _bool_ - **\__ne__**(**self**, **other**=[carla.Rotation](#carla.Rotation)) @@ -1392,8 +1432,8 @@ The ego acceleration component _lon_ regarding the route smoothened by an averag

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1416,8 +1456,8 @@ Current ego vehicle dynamics regarding the route.

Methods

-

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1474,8 +1514,8 @@ Erases the targets that have been appended to the route. - **drop_route**(**self**) Discards the current route. If there are targets remaining in **routing_targets**, creates a new route using those. Otherwise, a new route is created at random. -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1521,8 +1561,8 @@ The function the sensor will be calling to every time a new measurement is recei - **stop**(**self**) Commands the sensor to stop listening for data. -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1569,8 +1609,8 @@ Time register of the frame at which this measurement was taken given by the OS i - `delta_seconds` (_float_) - `platform_timestamp` (_float_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.Timestamp](#carla.Timestamp)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.Timestamp](#carla.Timestamp)) - **\__ne__**(**self**, **other**=[carla.Timestamp](#carla.Timestamp)) - **\__str__**(**self**) @@ -1593,7 +1633,9 @@ Stops the traffic light at its current state. - **is_frozen**(**self**) The client returns True if a traffic light is frozen according to last tick. The method does not call the simulator. - **Return:** _bool_ -- **get_elapsed_time**(**self**) + +
Getters
+
- **get_elapsed_time**(**self**) The client returns the time in seconds since current light state started according to last tick. The method does not call the simulator. - **Return:** _float_ - **get_group_traffic_lights**(**self**) @@ -1607,33 +1649,43 @@ Returns the index of the pole that identifies it as part of the traffic light gr - **get_state**(**self**) The client returns the state of the traffic light according to last tick. The method does not call the simulator. - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ + - **Setter:** _[carla.TrafficLight.set_state](#carla.TrafficLight.set_state)_ - **get_green_time**(**self**) The client returns the seconds set for the traffic light to be green according to last tick. The method does not call the simulator. - **Return:** _float_ + - **Setter:** _[carla.TrafficLight.set_green_time](#carla.TrafficLight.set_green_time)_ - **get_red_time**(**self**) The client returns the seconds set for the traffic light to be red according to last tick. The method does not call the simulator. - **Return:** _float_ + - **Setter:** _[carla.TrafficLight.set_red_time](#carla.TrafficLight.set_red_time)_ - **get_yellow_time**(**self**) The client returns the the seconds set for the traffic light to be yellow according to last tick. The method does not call the simulator. - **Return:** _float_ -- **set_state**(**self**, **state**) + - **Setter:** _[carla.TrafficLight.set_yellow_time](#carla.TrafficLight.set_yellow_time)_ + +
Setters
+
- **set_state**(**self**, **state**) Sets a given state to a traffic light actor. - **Parameters:** - `state` (_[carla.TrafficLightState](#carla.TrafficLightState)_) + - **Getter:** _[carla.TrafficLight.get_state](#carla.TrafficLight.get_state)_ - **set_green_time**(**self**, **green_time**) - **Parameters:** - `green_time` (_float_) – Sets a given time (in seconds) for the green light to be active. + - **Getter:** _[carla.TrafficLight.get_green_time](#carla.TrafficLight.get_green_time)_ - **set_red_time**(**self**, **red_time**) Sets a given time (in seconds) for the red state to be active. - **Parameters:** - `red_time` (_float_) + - **Getter:** _[carla.TrafficLight.get_red_time](#carla.TrafficLight.get_red_time)_ - **set_yellow_time**(**self**, **yellow_time**) Sets a given time (in seconds) for the yellow light to be active. - **Parameters:** - `yellow_time` (_float_) + - **Getter:** _[carla.TrafficLight.get_yellow_time](#carla.TrafficLight.get_yellow_time)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1748,12 +1800,14 @@ Describes a rotation for an object according to Unreal Engine's axis system. Translates a 3D point from global to local coordinates using the current transformation as frame of reference. - **Parameters:** - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied. -- **get_forward_vector**(**self**) + +
Getters
+
- **get_forward_vector**(**self**) Computes a forward vector using its rotation. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.Transform](#carla.Transform)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.Transform](#carla.Transform)) Returns __True__ if both location and rotation are equal for this and `other`. - **Return:** _bool_ - **\__ne__**(**self**, **other**=[carla.Transform](#carla.Transform)) @@ -1780,8 +1834,8 @@ Y-axis value. - `x` (_float_) - `y` (_float_) -

Dunder methods

-- **\__add__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D)) +
Dunder methods
+
- **\__add__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D)) - **\__sub__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D)) - **\__mul__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D)) - **\__truediv__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D)) @@ -1815,8 +1869,8 @@ Z-axis value. - `y` (_float_) - `z` (_float_) -

Dunder methods

-- **\__add__**(**self**, **other**=[carla.Vector3D](#carla.Vector3D)) +
Dunder methods
+
- **\__add__**(**self**, **other**=[carla.Vector3D](#carla.Vector3D)) - **\__sub__**(**self**, **other**=[carla.Vector3D](#carla.Vector3D)) - **\__mul__**(**self**, **other**=[carla.Vector3D](#carla.Vector3D)) - **\__truediv__**(**self**, **other**=[carla.Vector3D](#carla.Vector3D)) @@ -1851,12 +1905,15 @@ Applies a physics control object in the next tick containing the parameters that - **is_at_traffic_light**(**self**) Vehicles will be affected by a traffic light when the light is red and the vehicle is inside its bounding box. The client returns whether a traffic light is affecting this vehicle according to last tick (it does not call the simulator). - **Return:** _bool_ -- **get_control**(**self**) + +
Getters
+
- **get_control**(**self**) The client returns the control applied in the last tick. The method does not call the simulator. - **Return:** _[carla.VehicleControl](#carla.VehicleControl)_ - **get_light_state**(**self**) Returns a flag representing the vehicle light state, this represents which lights are active or not. - **Return:** _[carla.VehicleLightState](#carla.VehicleLightState)_ + - **Setter:** _[carla.Vehicle.set_light_state](#carla.Vehicle.set_light_state)_ - **get_physics_control**(**self**) The simulator returns the last physics control applied to this vehicle. - **Return:** _[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_ @@ -1870,7 +1927,8 @@ Retrieves the traffic light actor affecting this vehicle (if any) according to l - **get_traffic_light_state**(**self**) The client returns the state of the traffic light affecting this vehicle according to last tick. The method does not call the simulator. If no traffic light is currently affecting the vehicle, returns green. - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ -- **set_autopilot**(**self**, **enabled**=True, **port**=8000) +
Setters
+
- **set_autopilot**(**self**, **enabled**=True, **tm**=None) Registers or deletes the vehicle from a Traffic Manager's list. When __True__, the Traffic Manager passed as parameter will move the vehicle around. The autopilot takes place client-side. - **Parameters:** - `enabled` (_bool_) @@ -1879,9 +1937,10 @@ Registers or deletes the vehicle from a Traffic Manager's list. When __True__, t Sets the light state of a vehicle using a flag that represents the lights that are on and off. - **Parameters:** - `light_state` (_[carla.VehicleLightState](#carla.VehicleLightState)_) + - **Getter:** _[carla.Vehicle.get_light_state](#carla.Vehicle.get_light_state)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -1915,8 +1974,8 @@ States which gear is the vehicle running on. - `manual_gear_shift` (_bool_) - `gear` (_int_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.VehicleControl](#carla.VehicleControl)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.VehicleControl](#carla.VehicleControl)) - **\__ne__**(**self**, **other**=[carla.VehicleControl](#carla.VehicleControl)) - **\__str__**(**self**) @@ -2003,8 +2062,8 @@ VehiclePhysicsControl constructor. - `steering_curve` (_[carla.Vector2D](#carla.Vector2D)_) - `wheels` (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)) - **\__ne__**(**self**, **other**=[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)) - **\__str__**(**self**) @@ -2026,12 +2085,14 @@ On the next tick, the control will move the walker in a certain direction with a On the next tick, the control defines a list of bone transformations that will be applied to the walker's skeleton. - **Parameters:** - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_) -- **get_control**(**self**) + +
Getters
+
- **get_control**(**self**) The client returns the control applied to this walker during last tick. The method does not call the simulator. - **Return:** _[carla.WalkerControl](#carla.WalkerControl)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -2047,13 +2108,15 @@ Sets the destination that the pedestrian will reach. Enables AI control for its parent walker. - **stop**(**self**) Disables AI control for its parent walker. -- **set_max_speed**(**self**, **speed**=1.4) + +
Setters
+
- **set_max_speed**(**self**, **speed**=1.4) Sets a speed for the walker in meters per second. - **Parameters:** - `speed` (_float_) – speed in m/s. An easy walking speed is set by default. -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -2070,8 +2133,8 @@ Intializes an object containing moves to be applied on tick. These are listed wi - **Parameters:** - `list(name,transform)` (_tuple_) -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -2095,8 +2158,8 @@ If True, the walker will perform a jump. - `speed` (_float_) - `jump` (_bool_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.WalkerControl](#carla.WalkerControl)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.WalkerControl](#carla.WalkerControl)) Compares every variable with `other` and returns True if these are all the same. - **\__ne__**(**self**, **other**=[carla.WalkerControl](#carla.WalkerControl)) Compares every variable with `other` and returns True if any of these differ. @@ -2156,7 +2219,9 @@ Returns a list of waypoints from this to the start of the lane separated by a ce - **Parameters:** - `distance` (_float_) – The approximate distance between waypoints. - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ -- **get_junction**(**self**) + +
Getters
+
- **get_junction**(**self**) If the waypoint belongs to a junction this function returns the asociated junction object. Otherwise returns null. - **Return:** _[carla.Junction](#carla.Junction)_ - **get_landmarks**(**self**, **distance**, **stop_at_junction**=False) @@ -2181,8 +2246,8 @@ Generates a waypoint at the center of the right lane based on the direction of t Will return None if the lane does not exist. - **Return:** _[carla.Waypoint](#carla.Waypoint)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) --- @@ -2226,8 +2291,8 @@ Method to initialize an object defining weather conditions. This class has some - **Note:** _ClearNoon, CloudyNoon, WetNoon, WetCloudyNoon, SoftRainNoon, MidRainyNoon, HardRainNoon, ClearSunset, CloudySunset, WetSunset, WetCloudySunset, SoftRainSunset, MidRainSunset, HardRainSunset. _ -

Dunder methods

-- **\__eq__**(**self**, **other**) +
Dunder methods
+
- **\__eq__**(**self**, **other**) Returns True if both objects' variables are the same. - **Return:** _bool_ - **\__ne__**(**self**, **other**) @@ -2267,8 +2332,8 @@ World position of the wheel. This is a read-only parameter. - `max_handbrake_torque` (_float_) - `position` (_[carla.Vector3D](#carla.Vector3D)_) -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)) - **\__ne__**(**self**, **other**=[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)) - **\__str__**(**self**) @@ -2322,7 +2387,9 @@ Same as **spawn_actor()** but returns None o - `attach_to` (_[carla.Actor](#carla.Actor)_) – The parent object that the spawned actor will follow around. - `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) – Determines how fixed and rigorous should be the changes in position according to its parent object. - **Return:** _[carla.Actor](#carla.Actor)_ -- **get_actor**(**self**, **actor_id**) + +
Getters
+
- **get_actor**(**self**, **actor_id**) Looks up for an actor by ID and returns None if not found. - **Parameters:** - `actor_id` (_int_) @@ -2366,13 +2433,17 @@ Returns the spectator actor. The spectator is a special type of actor created by - **get_weather**(**self**) Retrieves an object containing weather parameters currently active in the simulation, mainly cloudiness, precipitation, wind and sun position. - **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_ -- **set_weather**(**self**, **weather**) + - **Setter:** _[carla.World.set_weather](#carla.World.set_weather)_ + +
Setters
+
- **set_weather**(**self**, **weather**) Changes the weather parameteres ruling the simulation to another ones defined in an object. - **Parameters:** - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) – New conditions to be applied. + - **Getter:** _[carla.World.get_weather](#carla.World.get_weather)_ -

Dunder methods

-- **\__str__**(**self**) +
Dunder methods
+
- **\__str__**(**self**) The content of the world is parsed and printed as a brief report of its current state. - **Return:** _string_ @@ -2397,8 +2468,8 @@ Creates an object containing desired settings that could later be applied throug - `no_rendering_mode` (_bool_) – Set this to true to completely disable rendering in the simulation. - `fixed_delta_seconds` (_float_) – Set this time in seconds to get a fixed time-step in between frames. 0.0 means variable time-step and it is the default mode. -

Dunder methods

-- **\__eq__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings)) +
Dunder methods
+
- **\__eq__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings)) Returns True if both objects' variables are the same. - **Return:** _bool_ - **\__ne__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings)) @@ -2433,8 +2504,8 @@ Given a certain actor ID, checks if there is a snapshot corresponding it and so, - `actor_id` (_int_) - **Return:** _bool_ -

Dunder methods

-- **\__iter__**(**self**) +
Dunder methods
+
- **\__iter__**(**self**) Method that enables iteration for this class using **timestamp** as reference value. - **\__len__**(**self**) Returns the amount of [carla.ActorSnapshot](#carla.ActorSnapshot) present in this snapshot. diff --git a/PythonAPI/docs/doc_gen.py b/PythonAPI/docs/doc_gen.py index ac42fcc72..092fc9feb 100755 --- a/PythonAPI/docs/doc_gen.py +++ b/PythonAPI/docs/doc_gen.py @@ -23,6 +23,8 @@ QUERY = re.compile(r'([cC]arla(\.[a-zA-Z0-9_]+)+)') def create_hyperlinks(text): return re.sub(QUERY, r'[\1](#\1)', text) +def create_getter_setter_hyperlinks(text): + return re.sub(QUERY, r'[\1](#\1)', text) def join(elem, separator=''): return separator.join(elem) @@ -72,16 +74,25 @@ class MarkdownFile: def first_title(self): self._data = join([ - self._data, '#Python API reference']) + self._data, '#Python API reference\n']) + + def button_apis(self): + self._data = join([ + self._data, + '']) def title(self, strongness, buf): self._data = join([ self._data, '\n', self.list_depth(), '#' * strongness, ' ', buf, '\n']) def title_html(self, strongness, buf): - self._data = join([ - self._data, '\n', self.list_depth(), '', buf, '\n']) - + if strongness == 5: + self._data = join([ + self._data, '\n', self.list_depth(), '', buf, '\n','
']) + else: + self._data = join([ + self._data, '\n', self.list_depth(), '', buf, '\n']) + def inherit_join(self, inh): self._data = join([ self._data,'
Inherited from ',inh,'

']) @@ -383,6 +394,68 @@ def add_doc_method(md, method, class_key): md.list_pop() +def add_doc_getter_setter(md, method, class_key,is_getter,other_list): + method_name = method['def_name'] + method_key = join([class_key, method_name], '.') + method_def = gen_doc_method_def(method, False) + md.list_pushn(join([html_key(method_key), method_def])) + + # Method doc + if valid_dic_val(method, 'doc'): + md.textn(create_hyperlinks(md.prettify_doc(method['doc']))) + + printed_title = False + if valid_dic_val(method, 'params'): + for param in method['params']: + # is_self = valid_dic_val(param, 'param_name') and param['param_name'] == 'self' + have_doc = valid_dic_val(param, 'doc') + have_type = valid_dic_val(param, 'type') + if not have_doc and not have_type: + continue + # Print the 'Parameters' title once + if not printed_title: + printed_title = True + md.list_push(bold('Parameters:') + '\n') + add_doc_method_param(md, param) + if printed_title: + md.list_pop() + + # Return doc + if valid_dic_val(method, 'return'): + md.list_push(bold('Return:') + ' ') + md.textn(italic(create_hyperlinks(method['return']))) + md.list_pop() + + # If setter/getter + for element in other_list: + el_name = element['def_name'] + if el_name[4:] == method_name[4:]: + if is_getter: + md.list_push(bold('Setter:') + ' ') + else: + md.list_push(bold('Getter:') + ' ') + md.textn(italic(create_hyperlinks(class_key+'.'+el_name))) + md.list_pop() + + # Note doc + if valid_dic_val(method, 'note'): + md.list_push(bold('Note:') + ' ') + md.textn(color(COLOR_NOTE, italic(create_hyperlinks(method['note'])))) + md.list_pop() + + # Warning doc + if valid_dic_val(method, 'warning'): + md.list_push(bold('Warning:') + ' ') + md.textn(color(COLOR_WARNING, italic(create_hyperlinks(method['warning'])))) + md.list_pop() + + # Raises error doc + if valid_dic_val(method, 'raises'): + md.list_pushn(bold('Raises:') + ' ' + method['raises']) + md.list_pop() + + md.list_pop() + def add_doc_dunder(md, dunder, class_key): dunder_name = dunder['def_name'] dunder_key = join([class_key, dunder_name], '.') @@ -510,6 +583,19 @@ class Documentation: """Generates the documentation body""" md = MarkdownFile() md.first_title() + md.textn( + "This reference contains all the details about latest version of the Python API. To consult a valid reference for a specific CARLA release, please select it from the list hereunder.
" + +"

Previous references


") for module_name in sorted(self.master_dict): module = self.master_dict[module_name] module_key = module_name @@ -536,17 +622,31 @@ class Documentation: if valid_dic_val(cl, 'methods'): method_list = list() dunder_list = list() + get_list = list() + set_list = list() for method in cl['methods']: method_name = method['def_name'] if method_name[0] == '_' and method_name != '__init__': dunder_list.append(method) + elif method_name[:4] == 'get_': + get_list.append(method) + elif method_name[:4] == 'set_': + set_list.append(method) else: method_list.append(method) md.title_html(3, 'Methods') for method in method_list: add_doc_method(md, method, class_key) + if len(get_list)>0: + md.title_html(5, 'Getters') + for method in get_list: + add_doc_getter_setter(md, method, class_key,True,set_list) + if len(set_list)>0: + md.title_html(5, 'Setters') + for method in set_list: + add_doc_getter_setter(md, method, class_key,False,get_list) if len(dunder_list)>0: - md.title_html(3, 'Dunder methods') + md.title_html(5, 'Dunder methods') for method in dunder_list: add_doc_dunder(md, method, class_key) md.separator()