From b926304b4cc9341dfa009533c669b588cfa132b1 Mon Sep 17 00:00:00 2001 From: sergi-e Date: Wed, 23 Sep 2020 22:42:30 +0200 Subject: [PATCH] First iteration --- Docs/core_map.md | 11 +++++++++-- Docs/python_api.md | 6 ++++-- PythonAPI/docs/map.yml | 4 +++- PythonAPI/docs/world.yml | 4 +++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Docs/core_map.md b/Docs/core_map.md index 6b8ad65b0..5de8e0d7c 100644 --- a/Docs/core_map.md +++ b/Docs/core_map.md @@ -86,7 +86,7 @@ waypoints_junc = my_junction.get_waypoints() ### Waypoints -A [__carla.Waypoint__](python_api.md#carla.Waypoint) is a 3D-directed point. These are prepared to mediate between the world and the openDRIVE definition of the road. +A [__carla.Waypoint__](python_api.md#carla.Waypoint) is a 3D-directed point. These are prepared to mediate between the world and the openDRIVE definition of the road. Everything related with waypoints happens on the client-side, so there no communication with the server is needed. Each waypoint contains a [carla.Transform](python_api.md#carla.Transform). This states its location on the map and the orientation of the lane containing it. The variables `road_id`,`section_id`,`lane_id` and `s` translate this transform to the OpenDRIVE road. These combined, create the `id` of the waypoint. @@ -105,6 +105,11 @@ right_lm_color = waypoint.right_lane_marking.color --- ## Navigation in CARLA +Navigation in CARLA is managed via the waypoint API. This consists of a summary of methods in [carla.Waypoint](python_api.md#carla.Waypoint) and [carla.Map](python_api.md#carla.Map) that provide connections between waypoints, and use these to generate a map navigation. + +All the queries happen on the client-side. The client only communicates with the server when retrieving the map object that will be used for the queries. Communication with the server is not needed after that, so the computational cost of the waypoint API is heavily reduced. + + ### Navigating through waypoints Waypoints have a set of methods to connect with others and create a road flow. All of these methods follow traffic rules to determine only places where the vehicle can go. @@ -125,7 +130,9 @@ while True: ### Generating a map navigation -The instance of the map is provided by the world. It will be useful to create routes and make vehicles roam around the city and reach goal destinations. +The instance of the map is provided by the world. It will be useful to create routes and make vehicles roam around the city and reach goal destinations. + +The following method asks the server for the XODR map file, and parses it to a [carla.Map](python_api.md#carla.Map) object. It only needs to be calle once. Maps can be quite heavy, and successive calls are unnecessary and expensive. ```py map = world.get_map() diff --git a/Docs/python_api.md b/Docs/python_api.md index d7b594bea..e997b08c8 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -2447,7 +2447,7 @@ Compares every variable with `other` and returns True if any of these dif --- ## 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. +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 the information regarding waypoints and the [waypoint API](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/core_map/#navigation-in-carla) is retrieved as provided by the OpenDRIVE file. Once the client asks for the map object to the server, no longer communication will be needed.

Instance Variables

- **id** (_int_) @@ -2699,8 +2699,10 @@ Returns a dict where the keys are [carla.Actor](#carla.Actor) IDs and the values Returns an instance of [carla.LightManager](#carla.LightManager) that can be used to handle the lights in the scene. - **Return:** _[carla.LightManager](#carla.LightManager)_ - **get_map**(**self**) -Returns the object containing the navigation map used to describe this world. +Asks the server for the XODR containing the map file, and returns this parsed as a [carla.Map](#carla.Map). - **Return:** _[carla.Map](#carla.Map)_ + - **Warning:** _This method does call the simulation. +_ - **get_traffic_light**(**self**, **landmark**) Provided a landmark, returns the traffic light object it describes. - **Parameters:** diff --git a/PythonAPI/docs/map.yml b/PythonAPI/docs/map.yml index b40a42ee8..7efaa8762 100644 --- a/PythonAPI/docs/map.yml +++ b/PythonAPI/docs/map.yml @@ -300,7 +300,9 @@ - class_name: Waypoint # - DESCRIPTION ------------------------ doc: > - Waypoints in CARLA are described as 3D directed points. They store a certain 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. + Waypoints in CARLA are described as 3D directed points. They store a certain 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 the information regarding waypoints and the [waypoint API](https://carla.readthedocs.io/en/latest/core_map/#navigation-in-carla) is retrieved as provided by the OpenDRIVE file. Once the client asks for the map object to the server, no longer communication will be needed. # - PROPERTIES ------------------------- instance_variables: - var_name: id diff --git a/PythonAPI/docs/world.yml b/PythonAPI/docs/world.yml index baa3c149d..5ebc90faf 100644 --- a/PythonAPI/docs/world.yml +++ b/PythonAPI/docs/world.yml @@ -349,7 +349,9 @@ - def_name: get_map return: carla.Map doc: > - Returns the object containing the navigation map used to describe this world. + Asks the server for the XODR containing the map file, and returns this parsed as a carla.Map. + warning: > + This method does call the simulation. # -------------------------------------- - def_name: get_traffic_light return: carla.TrafficLight