diff --git a/.gitignore b/.gitignore index 942fbfc99..d922129e0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ TrafficManager/build Util/Build Install Plugins +!Unreal/CarlaUE4/Plugins /ExportedMaps /Import/* diff --git a/Docs/python_api.md b/Docs/python_api.md index 050d69c11..3d7ba77d1 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -801,6 +801,17 @@ Returns a list of pairs of waypoints. Every tuple on the list contains first an --- +## carla.LabelledPoint +Class that represent a position in space with a semantic label. + +

Instance Variables

+- **location** +Position in 3D space. +- **label** +Semantic tag of the point. + +--- + ## carla.Landmark Class that defines any type of traffic landmark or sign affecting a road. These class mediates between the [OpenDRIVE 1.4 standard](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.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. @@ -2702,15 +2713,34 @@ This method applies settings contained in an object to the simulation running an - **Return:** _int_ - **Warning:** _If synchronous mode is enabled, and there is a Traffic Manager running, this must be set to sync mode too. Read [this](adv_traffic_manager.md#synchronous-mode) to learn how to do it. _ +- **cast_ray**(**self**, **initial_location**, **final_location**) +Casts a ray from the specified initial_location to final_location. The function then detects all geometries intersecting the ray and returns a list of [carla.LabelledPoint](#carla.LabelledPoint) in order. + - **Parameters:** + - `initial_location` (_[carla.Location](#carla.Location)_) – The initial position of the ray. + - `final_location` (_[carla.Location](#carla.Location)_) – The final position of the ray. + - **Return:** _list([carla.LabelledPoint](#carla.LabelledPoint))_ - **freeze_all_traffic_lights**(**self**, **frozen**) Freezes or unfreezes all traffic lights in the scene. Frozen traffic lights can be modified by the user but the time will not update them until unfrozen. - **Parameters:** - `frozen` (_bool_) +- **ground_projection**(**self**, **location**, **search_distance**) +Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a [carla.Labelled](#carla.Labelled) object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – The point to be projected. + - `search_distance` (_float_) – The maximum distance to perform the projection. + - **Return:** _[carla.LabelledPoint](#carla.LabelledPoint)_ - **on_tick**(**self**, **callback**) This method is used in [__asynchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/). It starts callbacks from the client for the function defined as `callback`, and returns the ID of the callback. The function will be called everytime the server ticks. It requires a [carla.WorldSnapshot](#carla.WorldSnapshot) as argument, which can be retrieved from __wait_for_tick()__. Use __remove_on_tick()__ to stop the callbacks. - **Parameters:** - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) – Function with a snapshot as compulsory parameter that will be called when the client receives a tick. - **Return:** _int_ +- **project_point**(**self**, **location**, **direction**, **search_distance**) +Projects the specified point to the desired direction in the scene. The functions casts a ray from location in a direction and returns a [carla.Labelled](#carla.Labelled) object with the first geometry this ray intersects. If no geometry is found in the search_distance range the function returns `None`. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location)_) – The point to be projected. + - `direction` (_[carla.Vector3D](#carla.Vector3D)_) – The direction of projection. + - `search_distance` (_float_) – The maximum distance to perform the projection. + - **Return:** _[carla.LabelledPoint](#carla.LabelledPoint)_ - **remove_on_tick**(**self**, **callback_id**) Stops the callback for `callback_id` started with __on_tick()__. - **Parameters:** @@ -3196,89 +3226,6 @@ document.getElementById("snipets-container").innerHTML = null; } -