From f2130d1ef42eb66a2d7bc3da3db02c350223f188 Mon Sep 17 00:00:00 2001 From: Axel1092 Date: Thu, 9 Apr 2020 17:37:05 +0200 Subject: [PATCH] Updated changelog. Updated Python documentation. --- CHANGELOG.md | 1 + Docs/python_api.md | 25 ++++++++++-- PythonAPI/docs/client.yml | 83 +++++++++++++++++++++++++-------------- 3 files changed, 77 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2d6c1877..0e7b33710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Added walkable pedestrian crosswalks in OpenDRIVE standalone mode * Improved mesh generation with a chunk system for better performance and bigger maps in the future * Added security features to the standalone OpenDRIVE mode aiming to prevent cars from falling down from the road + * Added junction smoothing algorithm to prevent roads from blocking other roads with level differences * Added new Behavior agent * Added automatic generation of traffic lights, stop signal and yield signal from OpenDRIVE file * Upgraded to AD RSS v3.0.0 supporting complex road layouts and i.e. intersections diff --git a/Docs/python_api.md b/Docs/python_api.md index db2ee0cfa..fd680d8a9 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -1075,6 +1075,25 @@ Distance between `actor` and `other`. --- +## carla.OpendriveGenerationParameters +This class defines the parameters used when generating a world using an OpenDRIVE file. + +

Instance Variables

+- **vertex_distance** +The distance between vertices when generating the world mesh from OpenDRIVE. +- **max_road_length** +Max road length for a single mesh portion. +- **wall_height** +Defines the height of walls added to roads to prevent vehicles from falling. +- **additional_width** +Additional with to junction lanes to prevent vehicles from falling. +- **smooth_junctions** +When this variable is `True` the generated junctions will be smoothed to prevent roads from blocking other roads. +- **enable_mesh_visibility** +This variable indicates whether the mesh should be rendered to reduce the rendering overhead. + +--- + ## 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. @@ -1445,7 +1464,7 @@ All possible states for traffic lights. These can either change at a specific ti --- ## 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. +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](adv_traffic_manager.md) regarding this module.

Methods

@@ -1475,7 +1494,7 @@ Sets the minimum distance in meters that vehicles have to keep with the rest. Th - **Parameters:** - `distance` (_float_) – Meters between vehicles. - **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. +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. @@ -1497,7 +1516,7 @@ During the collision detection stage, which runs every frame, this method sets a - **reset_traffic_lights**(**self**) Resets every traffic light in the map to its initial state. - **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. +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. diff --git a/PythonAPI/docs/client.yml b/PythonAPI/docs/client.yml index cf847c94f..dbf7447df 100644 --- a/PythonAPI/docs/client.yml +++ b/PythonAPI/docs/client.yml @@ -40,7 +40,7 @@ - param_name: commands type: list doc: > - A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. + A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. doc: > 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 all at once. @@ -55,7 +55,7 @@ type: bool default: false doc: > - A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. It is __False__ by default. + A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. It is __False__ by default. return: list(command.Response) doc: > 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. @@ -233,10 +233,10 @@ type: int default: 8000 doc: > - Port that will be used by the traffic manager. Default is `8000`. + Port that will be used by the traffic manager. Default is `8000`. return: carla.TrafficManager doc: > - Returns an instance of the traffic manager related to the specified port. If it does not exist, this will be created. + Returns an instance of the traffic manager related to the specified port. If it does not exist, this will be created. # -------------------------------------- - def_name: get_world params: @@ -267,8 +267,8 @@ - class_name: TrafficManager # - DESCRIPTION ------------------------ doc: > - 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 is applied to every vehicle registered in a traffic manager. - + 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 is applied to every vehicle registered in a traffic manager. + In order to learn more, visit the [documentation](adv_traffic_manager.md) regarding this module. # - PROPERTIES ------------------------- instance_variables: @@ -283,16 +283,16 @@ - param_name: enable type: bool doc: > - __True__ is default and enables lane changes. __False__ will disable them. + __True__ is default and enables lane changes. __False__ will disable them. doc: > - Turns on or off lane changing behaviour for a vehicle. + Turns on or off lane changing behaviour for a vehicle. # -------------------------------------- - def_name: collision_detection params: - param_name: reference_actor type: carla.Actor doc: > - Vehicle that is going to ignore collisions. + Vehicle that is going to ignore collisions. - param_name: other_actor type: carla.Actor doc: > @@ -300,7 +300,7 @@ - param_name: detect_collision type: bool doc: > - __True__ is default and enables collisions. __False will disable them. + __True__ is default and enables collisions. __False will disable them. doc: > 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. # -------------------------------------- @@ -309,11 +309,11 @@ - param_name: actor type: carla.Actor doc: > - Vehicle whose minimum distance is being changed. + Vehicle whose minimum distance is being changed. - param_name: distance type: float doc: > - Meters between both vehicles. + Meters between both vehicles. doc: > 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. # -------------------------------------- @@ -322,20 +322,20 @@ - param_name: actor type: carla.Actor doc: > - Vehicle being forced to change lanes. + Vehicle being forced to change lanes. - param_name: direction type: bool - doc: > - Destination lane. __True__ is the one on the left and __False__ is the right one. + doc: > + Destination lane. __True__ is the one on the left and __False__ is the right one. doc: > - 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. + 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. # -------------------------------------- - def_name: global_distance_to_leading_vehicle params: - param_name: distance type: float doc: > - Meters between vehicles. + Meters between vehicles. doc: > 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. # -------------------------------------- @@ -346,9 +346,9 @@ doc: > Percentage difference between intended speed and the current limit. doc: > - 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. + 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. # -------------------------------------- - def_name: ignore_lights_percentage params: @@ -361,7 +361,7 @@ doc: > Between 0 and 100. Amount of times traffic lights will be ignored. doc: > - During the traffic light stage, which runs every frame, this method sets the percent chance that traffic lights will be ignored for a vehicle. + During the traffic light stage, which runs every frame, this method sets the percent chance that traffic lights will be ignored for a vehicle. # -------------------------------------- - def_name: ignore_vehicles_percentage params: @@ -372,7 +372,7 @@ - param_name: perc type: float doc: > - Between 0 and 100. Amount of times collisions will be ignored. + Between 0 and 100. Amount of times collisions will be ignored. doc: > 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. # -------------------------------------- @@ -385,28 +385,28 @@ - param_name: perc type: float doc: > - Between 0 and 100. Amount of times collisions will be ignored. + Between 0 and 100. Amount of times collisions will be ignored. doc: > 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. # -------------------------------------- - def_name: reset_traffic_lights doc: > - Resets every traffic light in the map to its initial state. + Resets every traffic light in the map to its initial state. # -------------------------------------- - def_name: vehicle_percentage_speed_difference params: - param_name: actor type: carla.Actor doc: > - Vehicle whose speed behaviour is being changed. + Vehicle whose speed behaviour is being changed. - param_name: percentage type: float doc: > - Percentage difference between intended speed and the current limit. + Percentage difference between intended speed and the current limit. doc: > - 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. + 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. # -------------------------------------- - def_name: set_hybrid_physics_mode params: @@ -428,3 +428,28 @@ doc: > With hybrid physics on, changes the radius of the area of influence where physics are enabled. # -------------------------------------- + + - class_name: OpendriveGenerationParameters + # - DESCRIPTION ------------------------ + doc: > + This class defines the parameters used when generating a world using an OpenDRIVE file. + # - PROPERTIES ------------------------- + instance_variables: + - var_name: vertex_distance + doc: > + The distance between vertices when generating the world mesh from OpenDRIVE. + - var_name: max_road_length + doc: > + Max road length for a single mesh portion. + - var_name: wall_height + doc: > + Defines the height of walls added to roads to prevent vehicles from falling. + - var_name: additional_width + doc: > + Additional with to junction lanes to prevent vehicles from falling. + - var_name: smooth_junctions + doc: > + When this variable is `True` the generated junctions will be smoothed to prevent roads from blocking other roads. + - var_name: enable_mesh_visibility + doc: > + This variable indicates whether the mesh should be rendered to reduce the rendering overhead.