Python documentation.

This commit is contained in:
Axel 2020-02-17 10:34:06 +01:00 committed by Marc Garcia Puig
parent 3a27e7e5b5
commit 83180fe9a5
5 changed files with 2616 additions and 286 deletions

File diff suppressed because it is too large Load Diff

View File

@ -322,8 +322,6 @@ namespace road {
lane_tangent = static_cast<float>(computed_width.second);
}
// log_warning("Got to computetransform, road: ", road.GetId(), " ",
// road.GetLength());
// get a directed point in s and apply the computed lateral offet
DirectedPoint dp = road.GetDirectedPointIn(waypoint.s);

View File

@ -742,6 +742,7 @@ namespace road {
DirectedPoint point = GetRoad(signal->_road_id)->GetDirectedPointIn(signal->_s);
point.ApplyLateralOffset(static_cast<float>(-signal->_t));
point.location.y *= -1; // Unreal Y axis hack
point.location.z += static_cast<float>(signal->_zOffset);
geom::Transform transform(point.location, geom::Rotation(
static_cast<float>(signal->_pitch),
static_cast<float>(-(point.tangent + signal->_hOffset)),

View File

@ -251,6 +251,7 @@ void export_map() {
;
class_<cc::Landmark, boost::noncopyable, boost::shared_ptr<cc::Landmark>>("Landmark", no_init)
.add_property("road_id", &cc::Landmark::GetRoadId)
.add_property("distance", &cc::Landmark::GetDistance)
.add_property("s", &cc::Landmark::GetS)
.add_property("t", &cc::Landmark::GetT)

View File

@ -374,6 +374,40 @@
doc: >
Returns a list of waypoints from this to the start of the lane separated by a certain `distance`.
# --------------------------------------
- def_name: get_landmarks
params:
- param_name: distance
type: float
doc: >
The maximum distance to search for landmarks from the current waypoint.
- param_name: stop_at_junction
type: bool
default: False
doc: >
Enables or disables the landmark search through junctions.
return: list(carla.Landmark)
doc: >
Returns a list of landmarks in the road from the current waypoint until the specified distance.
# --------------------------------------
- def_name: get_landmarks_of_type
params:
- param_name: distance
type: float
doc: >
The maximum distance to search for landmarks from the current waypoint.
- param_name: type
type: str
doc: >
The type of landmarks to search.
- param_name: stop_at_junction
type: bool
default: False
doc: >
Enables or disables the landmark search through junctions.
return: list(carla.Landmark)
doc: >
Returns a list of landmarks in the road of a specified type from the current waypoint until the specified distance.
# --------------------------------------
- def_name: __str__
# --------------------------------------
@ -403,4 +437,236 @@
doc: >
Returns a list of pairs of waypoints. Every tuple on the list contains first an initial and then a final waypoint within the intersection boundaries that describe the beginning and the end of said lane along the junction. Lanes follow their OpenDRIVE definitions so there may be many different tuples with the same starting waypoint due to possible deviations, as this are considered different lanes.
# --------------------------------------
- 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).
# --------------------------------------
...