First iteration

This commit is contained in:
sergi-e 2020-09-23 22:42:30 +02:00 committed by Marc Garcia Puig
parent 549bed21f2
commit b926304b4c
4 changed files with 19 additions and 6 deletions

View File

@ -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.
@ -127,6 +132,8 @@ while True:
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()
```

View File

@ -2447,7 +2447,7 @@ Compares every variable with `other` and returns <b>True</b> if any of these dif
---
## carla.Waypoint<a name="carla.Waypoint"></a>
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. <br><br> 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.
<h3>Instance Variables</h3>
- <a name="carla.Waypoint.id"></a>**<font color="#f8805a">id</font>** (_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)_
- <a name="carla.World.get_map"></a>**<font color="#7fb800">get_map</font>**(<font color="#00a6ed">**self**</font>)
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:** <font color="#ED2F2F">_This method does call the simulation.
_</font>
- <a name="carla.World.get_traffic_light"></a>**<font color="#7fb800">get_traffic_light</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**landmark**</font>)
Provided a landmark, returns the traffic light object it describes.
- **Parameters:**

View File

@ -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.
<br><br>
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

View File

@ -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