Fixed docs.

This commit is contained in:
Axel 2020-03-03 13:08:41 +01:00 committed by Axel1092
parent bc186349f8
commit 75495b62c6
2 changed files with 387 additions and 10 deletions

View File

@ -674,7 +674,7 @@ Returns a list of pairs of waypoints. Every tuple on the list contains first an
---
## carla.Landmark<a name="carla.Landmark"></a>
Class that defines any type of traffic landmark or sign affecting a road. These class mediates between the [OpenDRIVE]([OpenDRIVE standard](http://opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.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.
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.
<h3>Instance Variables</h3>
@ -732,6 +732,63 @@ Returns which lanes the landmark is affecting to. As there may be specific lanes
---
## carla.Landmark<a name="carla.Landmark"></a>
Class containing the definition of a signal affecting a specific road.
<h3>Instance Variables</h3>
- <a name="carla.Landmark.road_id"></a>**<font color="#f8805a">road_id</font>** (_int_)
Id of the road where this signal is defined. This road may be different from the road this signal is currently affecting.
- <a name="carla.Landmark.distance"></a>**<font color="#f8805a">distance</font>** (_float_)
Remaining distance to the signal from the waypoint calling `get_landmarks` or `get_landmarks_of_type`.
- <a name="carla.Landmark.s"></a>**<font color="#f8805a">s</font>** (_float_)
Distance position of the signal along the geometry of the road `road_id`.
- <a name="carla.Landmark.t"></a>**<font color="#f8805a">t</font>** (_float_)
Lateral position of the signal along the geometry of the road `road_id`.
- <a name="carla.Landmark.id"></a>**<font color="#f8805a">id</font>** (_str_)
Unique id of the signal in the OpenDRIVE file.
- <a name="carla.Landmark.name"></a>**<font color="#f8805a">name</font>** (_str_)
Name of the signal in the in the OpenDRIVE file.
- <a name="carla.Landmark.is_dynamic"></a>**<font color="#f8805a">is_dynamic</font>** (_bool_)
Indicates if the signal state changes over time such as traffic lights.
- <a name="carla.Landmark.orientation"></a>**<font color="#f8805a">orientation</font>** (_LandmarkOrientation_)
Indicates if the signal state changes over time such as traffic lights.
- <a name="carla.Landmark.z_offset"></a>**<font color="#f8805a">z_offset</font>** (_float_)
Elevation from the ground of the signal.
- <a name="carla.Landmark.country"></a>**<font color="#f8805a">country</font>** (_str_)
Country code where this signal is defined (default to OpenDRIVE).
- <a name="carla.Landmark.type"></a>**<font color="#f8805a">type</font>** (_str_)
Type identification of the signal according to country code.
- <a name="carla.Landmark.sub_type"></a>**<font color="#f8805a">sub_type</font>** (_str_)
Subtype identification of the signal according to country code.
- <a name="carla.Landmark.value"></a>**<font color="#f8805a">value</font>** (_float_)
Value printed in the signal (e.g. speed limit, maximum weight, etc).
- <a name="carla.Landmark.unit"></a>**<font color="#f8805a">unit</font>** (_str_)
Units of attribute `value`.
- <a name="carla.Landmark.height"></a>**<font color="#f8805a">height</font>** (_float_)
Total height of the signal.
- <a name="carla.Landmark.width"></a>**<font color="#f8805a">width</font>** (_float_)
Total width of the signal.
- <a name="carla.Landmark.text"></a>**<font color="#f8805a">text</font>** (_str_)
Additional text in the signal.
- <a name="carla.Landmark.h_offset"></a>**<font color="#f8805a">h_offset</font>** (_float_)
Heading of the signal relative to the orientation of the road.
- <a name="carla.Landmark.pitch"></a>**<font color="#f8805a">pitch</font>** (_float_)
Pitch of the signal.
- <a name="carla.Landmark.roll"></a>**<font color="#f8805a">roll</font>** (_float_)
Roll of the signal.
- <a name="carla.Landmark.waypoint"></a>**<font color="#f8805a">waypoint</font>** (_[carla.Waypoint](#carla.Waypoint)_)
The waypoint where this signal is producing an effect in the road.
- <a name="carla.Landmark.transform"></a>**<font color="#f8805a">transform</font>** (_[carla.Transform](#carla.Transform)_)
The position and orientation of this signal in the world.
<h3>Methods</h3>
- <a name="carla.Landmark.get_lane_validities"></a>**<font color="#7fb800">get_lane_validities</font>**(<font color="#00a6ed">**self**</font>)
Returns a list of pairs of lane ids defining to which lanes this signal is producing an effect.
The pair defines a range of lanes (from_lane_id, to_lane_id).
- **Return:** _list(tuple(int))_
---
## carla.LandmarkOrientation<a name="carla.LandmarkOrientation"></a>
Helper class to define the orientation of a landmark in the road. The definition is not directly translated from OpenDRIVE but converted for the sake of understanding.
@ -745,6 +802,19 @@ Affects vehicles going in both directions of the road.
---
## carla.LandmarkOrientation<a name="carla.LandmarkOrientation"></a>
Class defining the orientation of a landmark in the road.
<h3>Instance Variables</h3>
- <a name="carla.LandmarkOrientation.Positive"></a>**<font color="#f8805a">Positive</font>**
Positive direction of the road's geometry definition (negative lanes).
- <a name="carla.LandmarkOrientation.Negative"></a>**<font color="#f8805a">Negative</font>**
Negative direction of the road's geometry definition (positive lanes).
- <a name="carla.LandmarkOrientation.Both"></a>**<font color="#f8805a">Both</font>**
Affects lanes in both directions of the road.
---
## carla.LandmarkType<a name="carla.LandmarkType"></a>
Helper class containing a set of commonly used landmark types as defined by the default country code in the [OpenDRIVE standard](http://opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.pdf) (Germany 2017).
__[carla.Landmark](#carla.Landmark) does not reference this class__. The landmark type is a string that varies greatly depending on the country code being used. This class only makes it easier to manage some of the most commonly used in the default set by describing them as an enum.
@ -821,6 +891,81 @@ Type 381.
---
## carla.LandmarkType<a name="carla.LandmarkType"></a>
Class containing a set of landmarks using the country code OpenDRIVE. See section 6.10 in the OpenDrive 1.5M specification.
<h3>Instance Variables</h3>
- <a name="carla.LandmarkType.Danger"></a>**<font color="#f8805a">Danger</font>**
Type 101.
- <a name="carla.LandmarkType.LanesMerging"></a>**<font color="#f8805a">LanesMerging</font>**
Type 121.
- <a name="carla.LandmarkType.CautionPedestrian"></a>**<font color="#f8805a">CautionPedestrian</font>**
Type 133.
- <a name="carla.LandmarkType.CautionBicycle"></a>**<font color="#f8805a">CautionBicycle</font>**
Type 138.
- <a name="carla.LandmarkType.LevelCrossing"></a>**<font color="#f8805a">LevelCrossing</font>**
Type 150.
- <a name="carla.LandmarkType.Stop"></a>**<font color="#f8805a">Stop</font>**
Type 206.
- <a name="carla.LandmarkType.Yield"></a>**<font color="#f8805a">Yield</font>**
Type 205.
- <a name="carla.LandmarkType.MandatoryTurnDirection"></a>**<font color="#f8805a">MandatoryTurnDirection</font>**
Type 209.
- <a name="carla.LandmarkType.MandatoryLeftRightDirection"></a>**<font color="#f8805a">MandatoryLeftRightDirection</font>**
Type 211.
- <a name="carla.LandmarkType.TwoChoiceTurnDirection"></a>**<font color="#f8805a">TwoChoiceTurnDirection</font>**
Type 214.
- <a name="carla.LandmarkType.Roundabout"></a>**<font color="#f8805a">Roundabout</font>**
Type 215.
- <a name="carla.LandmarkType.PassRightLeft"></a>**<font color="#f8805a">PassRightLeft</font>**
Type 222.
- <a name="carla.LandmarkType.AccessForbidden"></a>**<font color="#f8805a">AccessForbidden</font>**
Type 250.
- <a name="carla.LandmarkType.AccessForbiddenMotorvehicles"></a>**<font color="#f8805a">AccessForbiddenMotorvehicles</font>**
Type 251.
- <a name="carla.LandmarkType.AccessForbiddenTrucks"></a>**<font color="#f8805a">AccessForbiddenTrucks</font>**
Type 253.
- <a name="carla.LandmarkType.AccessForbiddenBicycle"></a>**<font color="#f8805a">AccessForbiddenBicycle</font>**
Type 254.
- <a name="carla.LandmarkType.AccessForbiddenWeight"></a>**<font color="#f8805a">AccessForbiddenWeight</font>**
Type 263.
- <a name="carla.LandmarkType.AccessForbiddenWidth"></a>**<font color="#f8805a">AccessForbiddenWidth</font>**
Type 264.
- <a name="carla.LandmarkType.AccessForbiddenHeight"></a>**<font color="#f8805a">AccessForbiddenHeight</font>**
Type 265.
- <a name="carla.LandmarkType.AccessForbiddenWrongDirection"></a>**<font color="#f8805a">AccessForbiddenWrongDirection</font>**
Type 267.
- <a name="carla.LandmarkType.ForbiddenUTurn"></a>**<font color="#f8805a">ForbiddenUTurn</font>**
Type 272.
- <a name="carla.LandmarkType.MaximumSpeed"></a>**<font color="#f8805a">MaximumSpeed</font>**
Type 274.
- <a name="carla.LandmarkType.ForbiddenOvertakingMotorvehicles"></a>**<font color="#f8805a">ForbiddenOvertakingMotorvehicles</font>**
Type 276.
- <a name="carla.LandmarkType.ForbiddenOvertakingTrucks"></a>**<font color="#f8805a">ForbiddenOvertakingTrucks</font>**
Type 277.
- <a name="carla.LandmarkType.AbsoluteNoStop"></a>**<font color="#f8805a">AbsoluteNoStop</font>**
Type 283.
- <a name="carla.LandmarkType.RestrictedStop"></a>**<font color="#f8805a">RestrictedStop</font>**
Type 286.
- <a name="carla.LandmarkType.HasWayNextIntersection"></a>**<font color="#f8805a">HasWayNextIntersection</font>**
Type 301.
- <a name="carla.LandmarkType.PriorityWay"></a>**<font color="#f8805a">PriorityWay</font>**
Type 306.
- <a name="carla.LandmarkType.PriorityWayEnd"></a>**<font color="#f8805a">PriorityWayEnd</font>**
Type 307.
- <a name="carla.LandmarkType.CityBegin"></a>**<font color="#f8805a">CityBegin</font>**
Type 310.
- <a name="carla.LandmarkType.CityEnd"></a>**<font color="#f8805a">CityEnd</font>**
Type 311.
- <a name="carla.LandmarkType.Highway"></a>**<font color="#f8805a">Highway</font>**
Type 330.
- <a name="carla.LandmarkType.RecomendedSpeed"></a>**<font color="#f8805a">RecomendedSpeed</font>**
Type 380.
- <a name="carla.LandmarkType.RecomendedSpeedEnd"></a>**<font color="#f8805a">RecomendedSpeedEnd</font>**
Type 381.
---
## carla.LaneChange<a name="carla.LaneChange"></a>
Class that defines the permission to turn either left, right, both or none (meaning only going straight is allowed). This information is stored for every [carla.Waypoint](#carla.Waypoint) according to the OpenDRIVE file. In this [recipe](ref_code_recipes.md#lanes-recipe) the user creates a waypoint for a current vehicle position and learns which turns are permitted.
@ -1868,14 +2013,14 @@ Returns a list of waypoints from this to the start of the lane separated by a ce
- <a name="carla.Waypoint.get_landmarks"></a>**<font color="#7fb800">get_landmarks</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**distance**</font>, <font color="#00a6ed">**stop_at_junction**=False</font>)
Returns a list of landmarks in the road from the current waypoint until the specified distance.
- **Parameters:**
- `distance` (_float_) Distance to search for landmarks from the current waypoint (metres in OpenDRIVE).
- `distance` (_float_) The maximum distance to search for landmarks from the current waypoint.
- `stop_at_junction` (_bool_) Enables or disables the landmark search through junctions.
- **Return:** _list([carla.Landmark](#carla.Landmark))_
- <a name="carla.Waypoint.get_landmarks_of_type"></a>**<font color="#7fb800">get_landmarks_of_type</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**distance**</font>, <font color="#00a6ed">**type**</font>, <font color="#00a6ed">**stop_at_junction**=False</font>)
Returns a list of landmarks in the road of a certain type from the current waypoint until the specified distance.
Returns a list of landmarks in the road of a specified type from the current waypoint until the specified distance.
- **Parameters:**
- `distance` (_float_) Distance to search for landmarks from the current waypoint (metres in OpenDRIVE).
- `type` (_str_) Type of landmarks to search.
- `distance` (_float_) The maximum distance to search for landmarks from the current waypoint.
- `type` (_str_) The type of landmarks to search.
- `stop_at_junction` (_bool_) Enables or disables the landmark search through junctions.
- **Return:** _list([carla.Landmark](#carla.Landmark))_
- <a name="carla.Waypoint.__str__"></a>**<font color="#7fb800">\__str__</font>**(<font color="#00a6ed">**self**</font>)

View File

@ -379,7 +379,7 @@
- param_name: distance
type: float
doc: >
Distance to search for landmarks from the current waypoint (metres in OpenDRIVE).
The maximum distance to search for landmarks from the current waypoint.
- param_name: stop_at_junction
type: bool
default: False
@ -394,11 +394,11 @@
- param_name: distance
type: float
doc: >
Distance to search for landmarks from the current waypoint (metres in OpenDRIVE).
The maximum distance to search for landmarks from the current waypoint.
- param_name: type
type: str
doc: >
Type of landmarks to search.
The type of landmarks to search.
- param_name: stop_at_junction
type: bool
default: False
@ -406,7 +406,7 @@
Enables or disables the landmark search through junctions.
return: list(carla.Landmark)
doc: >
Returns a list of landmarks in the road of a certain type from the current waypoint until the specified distance.
Returns a list of landmarks in the road of a specified type from the current waypoint until the specified distance.
# --------------------------------------
- def_name: __str__
# --------------------------------------
@ -570,7 +570,7 @@
- class_name: Landmark
# - DESCRIPTION ------------------------
doc: >
Class that defines any type of traffic landmark or sign affecting a road. These class mediates between the [OpenDRIVE]([OpenDRIVE standard](http://opendrive.org/docs/OpenDRIVEFormatSpecRev1.5M.pdf)) definition of the landmarks and their representation in the simulation.
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 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.
@ -675,4 +675,236 @@
<small>Example: In a road with 5 lanes, being 3 not affected: [(from_lane1,to_lane2),(from_lane4,to_lane5)]</small>
# --------------------------------------
- class_name: LandmarkOrientation
# - DESCRIPTION ------------------------
doc: >
Class defining the orientation of a landmark in the road.
# - PROPERTIES -------------------------
instance_variables:
- var_name: Positive
doc: >
Positive direction of the road's geometry definition (negative lanes).
- var_name: Negative
doc: >
Negative direction of the road's geometry definition (positive lanes).
- var_name: Both
doc: >
Affects lanes in both directions of the road.
# --------------------------------------
- class_name: LandmarkType
# - DESCRIPTION ------------------------
doc: >
Class containing a set of landmarks using the country code OpenDRIVE.
See section 6.10 in the OpenDrive 1.5M specification.
# - PROPERTIES -------------------------
instance_variables:
- var_name: Danger
doc: >
Type 101.
- var_name: LanesMerging
doc: >
Type 121.
- var_name: CautionPedestrian
doc: >
Type 133.
- var_name: CautionBicycle
doc: >
Type 138.
- var_name: LevelCrossing
doc: >
Type 150.
- var_name: Stop
doc: >
Type 206.
- var_name: Yield
doc: >
Type 205.
- var_name: MandatoryTurnDirection
doc: >
Type 209.
- var_name: MandatoryLeftRightDirection
doc: >
Type 211.
- var_name: TwoChoiceTurnDirection
doc: >
Type 214.
- var_name: Roundabout
doc: >
Type 215.
- var_name: PassRightLeft
doc: >
Type 222.
- var_name: AccessForbidden
doc: >
Type 250.
- var_name: AccessForbiddenMotorvehicles
doc: >
Type 251.
- var_name: AccessForbiddenTrucks
doc: >
Type 253.
- var_name: AccessForbiddenBicycle
doc: >
Type 254.
- var_name: AccessForbiddenWeight
doc: >
Type 263.
- var_name: AccessForbiddenWidth
doc: >
Type 264.
- var_name: AccessForbiddenHeight
doc: >
Type 265.
- var_name: AccessForbiddenWrongDirection
doc: >
Type 267.
- var_name: ForbiddenUTurn
doc: >
Type 272.
- var_name: MaximumSpeed
doc: >
Type 274.
- var_name: ForbiddenOvertakingMotorvehicles
doc: >
Type 276.
- var_name: ForbiddenOvertakingTrucks
doc: >
Type 277.
- var_name: AbsoluteNoStop
doc: >
Type 283.
- var_name: RestrictedStop
doc: >
Type 286.
- var_name: HasWayNextIntersection
doc: >
Type 301.
- var_name: PriorityWay
doc: >
Type 306.
- var_name: PriorityWayEnd
doc: >
Type 307.
- var_name: CityBegin
doc: >
Type 310.
- var_name: CityEnd
doc: >
Type 311.
- var_name: Highway
doc: >
Type 330.
- var_name: RecomendedSpeed
doc: >
Type 380.
- var_name: RecomendedSpeedEnd
doc: >
Type 381.
# --------------------------------------
- class_name: Landmark
# - DESCRIPTION ------------------------
doc: >
Class containing the definition of a signal affecting a specific road.
# - PROPERTIES -------------------------
instance_variables:
- var_name: road_id
type: int
doc: >
Id of the road where this signal is defined. This road may be different from the road this signal is currently affecting.
- var_name: distance
type: float
doc: >
Remaining distance to the signal from the waypoint calling `get_landmarks` or `get_landmarks_of_type`.
- var_name: s
type: float
doc: >
Distance position of the signal along the geometry of the road `road_id`.
- var_name: t
type: float
doc: >
Lateral position of the signal along the geometry of the road `road_id`.
- var_name: id
type: str
doc: >
Unique id of the signal in the OpenDRIVE file.
- var_name: name
type: str
doc: >
Name of the signal in the in the OpenDRIVE file.
- var_name: is_dynamic
type: bool
doc: >
Indicates if the signal state changes over time such as traffic lights.
- var_name: orientation
type: LandmarkOrientation
doc: >
Indicates if the signal state changes over time such as traffic lights.
- var_name: z_offset
type: float
doc: >
Elevation from the ground of the signal.
- var_name: country
type: str
doc: >
Country code where this signal is defined (default to OpenDRIVE).
- var_name: type
type: str
doc: >
Type identification of the signal according to country code.
- var_name: sub_type
type: str
doc: >
Subtype identification of the signal according to country code.
- var_name: value
type: float
doc: >
Value printed in the signal (e.g. speed limit, maximum weight, etc).
- var_name: unit
type: str
doc: >
Units of attribute `value`.
- var_name: height
type: float
doc: >
Total height of the signal.
- var_name: width
type: float
doc: >
Total width of the signal.
- var_name: text
type: str
doc: >
Additional text in the signal.
- var_name: h_offset
type: float
doc: >
Heading of the signal relative to the orientation of the road.
- var_name: pitch
type: float
doc: >
Pitch of the signal.
- var_name: roll
type: float
doc: >
Roll of the signal.
- var_name: waypoint
type: carla.Waypoint
doc: >
The waypoint where this signal is producing an effect in the road.
- var_name: transform
type: carla.Transform
doc: >
The position and orientation of this signal in the world.
# - METHODS ----------------------------
methods:
- def_name: get_lane_validities
return: list(tuple(int))
doc: >
Returns a list of pairs of lane ids defining to which lanes this signal is producing an effect.
The pair defines a range of lanes (from_lane_id, to_lane_id).
# --------------------------------------
...