From 4d2e40a59ae169689adfa78c86bb574567cdffcf Mon Sep 17 00:00:00 2001 From: Axel Date: Wed, 28 Jul 2021 11:33:35 +0200 Subject: [PATCH] Updated documentation and changelog --- CHANGELOG.md | 5 +- Docs/python_api.md | 643 +++++++++++++++++++++---------------- PythonAPI/docs/actor.yml | 20 ++ PythonAPI/docs/map.yml | 3 + PythonAPI/docs/osm2odr.yml | 29 ++ PythonAPI/docs/world.yml | 42 +++ 6 files changed, 456 insertions(+), 286 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b47631c..cc416fecd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,11 +21,14 @@ - Unsupported collision dynamics * Added performance benchmarking section to documentation * Added API functions to traffic light actor `get_effect_waypoints()`, `get_light_boxes()` and `get_opendrive_id()` - * Added API functions to world `get_traffic_lights_from_waypoint()` and `get_traffic_lights_in_junction` + * Added API functions to world `get_traffic_lights_from_waypoint()`, `get_traffic_lights_in_junction` and `get_traffic_light_from_opendrive_id` + * Added API parameters to `WorldSettings`: `tile_stream_distance` and `actor_active_distance` + * Added API parameters and functions to `Osm2OdrSettings`: `proj_string`, `center_map`, `generate_traffic_lights`, `all_junctions_with_traffic_lights`, `set_osm_way_types`, and `set_traffic_light_excluded_way_types` * Added API function to enable car telemetry * CARLA is compatible with the last RoadRunner nomenclature for road assets * Fixed a bug when importing a FBX map with some **_** in the FBX name * Extended make import process for applying road painter materials (carla art tool) + * Added Large Map feature to CARLA, alowing to import large maps divided in square tiles (at most 2kmx2km per tile). Only section of a Large Map can be loaded at a time which introduces a sleep state for actors that are far away from the hero vehicle * Added creation of custom JSON file for applying decals to imported roads * Added ApplyVehiclePhysicsControl to commands * Added flush in the sublevel loading to increase carla's determinism in Opt maps diff --git a/Docs/python_api.md b/Docs/python_api.md index e44b811ac..72d20ce79 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -63,6 +63,10 @@ Sets a vehicle's velocity vector to a constant value over time. The resulting ve _ - **Warning:** _Enabling a constant velocity for a vehicle managed by the [Traffic Manager](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_traffic_manager/) may cause conflicts. This method overrides any changes in velocity by the TM. _ +- **enable_debug_telemetry**(**self**, **enabled**=True) +Enables or disables the telemetry on this vehicle. This shows information about the vehicles current state and forces applied to it in the spectator window. Only information for one vehicle can be shown so if you enable a second one, the previous will be automatically disabled. + - **Parameters:** + - `enabled` (_bool_) ##### Getters - **get_acceleration**(**self**) @@ -1007,6 +1011,8 @@ Type 310. Type 311. - **Highway** Type 330. +- **DeadEnd** +Type 357. - **RecomendedSpeed** Type 380. - **RecomendedSpeedEnd** @@ -1627,6 +1633,24 @@ Offset in the Y axis. Default value is __0.0__. Width of the lanes described in the resulting XODR map. Default value is __4.0__. - **elevation_layer_height** (_float – meters_) Defines the height separating two different [OpenStreetMap layers](https://wiki.openstreetmap.org/wiki/Key:layer). Default value is __0.0__. +- **proj_string** (_str_) +Defines the proj4 string (https://github.com/OSGeo/proj.4) that will be used to compute the projection from geocoordinates to cartesian coordinates. This string will be written in the resulting OpenDRIVE unless the options `use_offsets` or `center_map` are enabled as these options override some of the definitions in the string. +- **generate_traffic_lights** (_bool_) +Indicates wether to generate traffic light data in the OpenDRIVE. road types defined by `set_traffic_light_excluded_way_types(way_types)` will not generate traffic lights. +- **all_junctions_with_traffic_lights** (_bool_) +When disabled, the converter will generate traffic light data from the OpenStreetMaps data only. When enabled, all junctions will generate traffic lights. + +### Methods + +##### Setters +- **set_osm_way_types**(**self**, **way_types**) +Defines the OpenStreetMaps road types that will be imported to OpenDRIVE. By default the road types imported are `motorway, motorway_link, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, unclassified, residential`. For a full list of road types check https://wiki.openstreetmap.org/wiki/Main_Page . + - **Parameters:** + - `way_types` (_list(str)_) – The list of road types. +- **set_traffic_light_excluded_way_types**(**self**, **way_types**) +Defines the OpenStreetMaps road types that will not generate traffic lights even if `generate_traffic_lights` is enabled. By default the road types excluded are `motorway_link, primary_link, secondary_link, tertiary_link`. + - **Parameters:** + - `way_types` (_list(str)_) – The list of road types. --- @@ -2083,6 +2107,9 @@ Resets the state of the traffic lights of the group to the initial state at the _ ##### Getters +- **get_affected_lane_waypoints**(**self**) +Returns a list of waypoints indicating the positions and lanes where the traffic light is having an effect. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ - **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 – seconds_ @@ -2095,6 +2122,12 @@ Returns all traffic lights in the group this one belongs to. - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ - **Note:** _This method calls the simulator. _ +- **get_light_boxes**(**self**) +Returns a list of the bounding boxes encapsulating each light box of the traffic light. + - **Return:** _list([carla.BoundingBox](#carla.BoundingBox))_ +- **get_opendrive_id**(**self**) +Returns the OpenDRIVE id of this traffic light. + - **Return:** _str_ - **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_ @@ -2106,6 +2139,9 @@ The client returns the time set for the traffic light to be red, according to la 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_stop_waypoints**(**self**) +Returns a list of waypoints indicating the stop position for the traffic light. These waypoints are computed from the trigger boxes of the traffic light that indicate where a vehicle should stop. + - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ - **get_yellow_time**(**self**) The client returns the time set for the traffic light to be yellow, according to last tick. The method does not call the simulator. - **Return:** _float – seconds_ @@ -3026,6 +3062,22 @@ Provided a landmark, returns the traffic light object it describes. - **Parameters:** - `landmark` (_[carla.Landmark](#carla.Landmark)_) – The landmark object describing a traffic light. - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ +- **get_traffic_light_from_opendrive_id**(**self**, **traffic_light_id**) +Returns the traffic light actor corresponding to the indicated OpenDRIVE id. + - **Parameters:** + - `traffic_light_id` (_str_) – The OpenDRIVE id. + - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ +- **get_traffic_lights_from_waypoint**(**self**, **waypoint**, **distance**) +This function performs a search along the road in front of the specified waypoint and returns a list of traffic light actors found in the specified search distance. + - **Parameters:** + - `waypoint` (_[carla.Waypoint](#carla.Waypoint)_) – The input waypoint. + - `distance` (_float_) – Search distance. + - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ +- **get_traffic_lights_in_junction**(**self**, **junction_id**) +Returns the list of traffic light actors affecting the junction indicated in `junction_id`. + - **Parameters:** + - `junction_id` (_int_) – The id of the junction. + - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ - **get_traffic_sign**(**self**, **landmark**) Provided a landmark, returns the traffic sign object it describes. - **Parameters:** @@ -3073,6 +3125,10 @@ The maximum number of physics substepping that are allowed. By default, the valu Configure the max draw distance for each mesh of the level. - **deterministic_ragdolls** (_bool_) Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation. When enabled, pedestrians have less realistic death animation but ensures determinism. When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinsm can be ensured. +- **tile_stream_distance** (_float_) +Used for large maps only. Configures the maximum distance from the hero vehicle to stream tiled maps. Regions of the map within this range will be visible (and capable of simulating physics). Regions outside this region will not be loaded. +- **actor_active_distance** (_float_) +Used for large maps only. Configures the distance from the hero vehicle to convert actors to dormant. Actors within this range will be active, and actors outside will become dormant. ### Methods - **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0) @@ -3269,6 +3325,23 @@ Vehicle control to be applied. --- +## command.ApplyVehiclePhysicsControl +Command adaptation of __apply_physics_control()__ in [carla.Vehicle](#carla.Vehicle). Applies a new physics control to a vehicle, modifying its physical parameters. + +### Instance Variables +- **actor_id** (_int_) +Vehicle actor affected by the command. +- **control** (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) +Physics 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.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) + +--- + ## command.ApplyWalkerControl Command adaptation of __apply_control()__ in [carla.Walker](#carla.Walker). Applies a control to a walker. @@ -3470,146 +3543,37 @@ world.load_map_layer(carla.MapLayer.ParkedVehicles) -