maliput
RoadGeometry Class Referenceabstract

Detailed Description

Abstract API for the geometry of a road network, including both the network topology and the geometry of its embedding in 3-space.

#include <include/maliput/api/road_geometry.h>

Inheritance diagram for RoadGeometry:
[legend]

Classes

class  IdIndex
 Abstract interface for a collection of methods which allow accessing objects in a RoadGeometry's object graph (Lanes, Segments, Junctions, BranchPoints) by their unique id's. More...
 

Public Member Functions

virtual ~RoadGeometry ()=default
 
RoadGeometryId id () const
 Returns the persistent identifier. More...
 
int num_junctions () const
 Returns the number of Junctions in the RoadGeometry. More...
 
const Junctionjunction (int index) const
 Returns the Junction indexed by index. More...
 
int num_branch_points () const
 Returns the number of BranchPoints in the RoadGeometry. More...
 
const BranchPointbranch_point (int index) const
 Returns the BranchPoint indexed by index. More...
 
const IdIndexById () const
 Accesses the IdIndex interface, which allows getting elements of the RoadGeometry's object graph by their unique id's. More...
 
RoadPositionResult ToRoadPosition (const InertialPosition &inertial_position, const std::optional< RoadPosition > &hint=std::nullopt) const
 Determines the RoadPosition corresponding to InertialPosition inertial_position. More...
 
std::vector< RoadPositionResultFindRoadPositions (const InertialPosition &inertial_position, double radius) const
 Obtains all RoadPositions within radius of inertial_position. More...
 
double linear_tolerance () const
 Returns the tolerance guaranteed for linear measurements (positions). More...
 
double angular_tolerance () const
 Returns the tolerance guaranteed for angular measurements (orientations). More...
 
double scale_length () const
 Returns the characteristic scale length expressed by this RoadGeometry. More...
 
std::vector< std::string > CheckInvariants () const
 Verifies certain invariants guaranteed by the API. More...
 
std::vector< InertialPositionSampleAheadWaypoints (const LaneSRoute &lane_s_route, double path_length_sampling_rate) const
 Samples lane_s_route at path_length_sampling_rate and converts those LanePositions into InertialPositions. More...
 
math::Vector3 inertial_to_backend_frame_translation () const
 The Backend Frame is an inertial frame similar to the Inertial Frame that differ one from another by an isometric transformation. More...
 

Protected Member Functions

 RoadGeometry ()=default
 

Constructor & Destructor Documentation

◆ ~RoadGeometry()

virtual ~RoadGeometry ( )
virtualdefault

Reimplemented in RoadGeometry.

◆ RoadGeometry()

RoadGeometry ( )
protecteddefault

Member Function Documentation

◆ angular_tolerance()

double angular_tolerance ( ) const

Returns the tolerance guaranteed for angular measurements (orientations).

◆ branch_point()

const BranchPoint* branch_point ( int  index) const

Returns the BranchPoint indexed by index.

Precondition
index must be >= 0 and < num_branch_points().

◆ ById()

const IdIndex& ById ( ) const

Accesses the IdIndex interface, which allows getting elements of the RoadGeometry's object graph by their unique id's.

◆ CheckInvariants()

std::vector< std::string > CheckInvariants ( ) const

Verifies certain invariants guaranteed by the API.

Returns a vector of strings describing violations of invariants. Return value with size() == 0 indicates success.

◆ FindRoadPositions()

std::vector< RoadPositionResult > FindRoadPositions ( const InertialPosition inertial_position,
double  radius 
) const

Obtains all RoadPositions within radius of inertial_position.

Only Lanes whose segment regions include points that are within radius of inertial_position are included in the search. For each of these Lanes, include the RoadPosition or RoadPositions with the minimum distance to inertial_position in the returned result.

Parameters
inertial_positionThe inertial position to convert into one or more RoadPositions.
radiusThe maximum distance from inertial_position to search. It must not be negative.
Returns
A vector of RoadPositionResults representing the possible RoadPositions. When radius is zero, the vector contains results with distance parameter being less or equal to linear_tolerance. When radius is infinity, the query should return the closest point for each lane.
Exceptions
maliput::common::assertion_errorWhen radius is negative.

Note that derivative implementations may choose to violate the above semantics for performance reasons. See docstrings of derivative implementations for details.

◆ id()

RoadGeometryId id ( ) const

Returns the persistent identifier.

◆ inertial_to_backend_frame_translation()

math::Vector3 inertial_to_backend_frame_translation ( ) const

The Backend Frame is an inertial frame similar to the Inertial Frame that differ one from another by an isometric transformation.

This method returns the translation vector between both frames.

For an explanation on the two different frames, see the explanation in maliput_design.h.

Returns
maliput's Inertial Frame to Backend Frame translation vector.

◆ junction()

const Junction* junction ( int  index) const

Returns the Junction indexed by index.

Precondition
index must be >= 0 and < num_junctions().

◆ linear_tolerance()

double linear_tolerance ( ) const

Returns the tolerance guaranteed for linear measurements (positions).

◆ num_branch_points()

int num_branch_points ( ) const

Returns the number of BranchPoints in the RoadGeometry.

Return value is non-negative.

◆ num_junctions()

int num_junctions ( ) const

Returns the number of Junctions in the RoadGeometry.

Return value is non-negative.

◆ SampleAheadWaypoints()

std::vector< InertialPosition > SampleAheadWaypoints ( const LaneSRoute lane_s_route,
double  path_length_sampling_rate 
) const

Samples lane_s_route at path_length_sampling_rate and converts those LanePositions into InertialPositions.

When path_length_sampling_rate is smaller than linear_tolerance, linear_tolerance will be used instead. When path_length_sampling_rate is bigger than total lane_s_route length (accumulated length of all LaneSRoute::ranges()) the minimum will be considered and two samples are taken. When total lane_s_route's length is not an integral multiple of path_length_sampling_rate, the last sampling step will be the remaining distance long only.

Parameters
lane_s_routeA lane route.
path_length_sampling_rateThe s coordinate sampling rate to sample lane_s_route. It must be positive.
Returns
A vector of InertialPositions which result of mapping to the inertial frame the samples of LanePositions.
Exceptions
maliput::assertion_errorWhen path_length_sampling_rate is not positive.
maliput::assertion_errorWhen any LaneSRange in lane_s_route.ranges() refers to an unknown Lane.

◆ scale_length()

double scale_length ( ) const

Returns the characteristic scale length expressed by this RoadGeometry.

◆ ToRoadPosition()

RoadPositionResult ToRoadPosition ( const InertialPosition inertial_position,
const std::optional< RoadPosition > &  hint = std::nullopt 
) const

Determines the RoadPosition corresponding to InertialPosition inertial_position.

If hint is provided, its value is used to help determine the result.

Returns a RoadPositionResult. Its RoadPosition is the point in the RoadGeometry's manifold which is, in the Inertial-frame, closest to inertial_position. Its InertialPosition is the Inertial-frame equivalent of the RoadPosition and its distance is the Cartesian distance from inertial_position to the nearest point.

This method guarantees that its result satisfies the condition that result.lane->ToInertialPosition(result.pos) is within linear_tolerance() of the returned InertialPosition.

The map from RoadGeometry to the Inertial-frame is not onto (as a bounded RoadGeometry cannot completely cover the unbounded Cartesian universe). If inertial_position does represent a point contained within the volume of the RoadGeometry, then result distance is guaranteed to be less than or equal to linear_tolerance().

The map from RoadGeometry to Inertial-frame is not necessarily one-to-one. Different (s,r,h) coordinates from different Lanes, potentially from different Segments, may map to the same (x,y,z) Inertial-frame location.

If inertial_position is contained within the volumes of multiple Segments, then ToRoadPosition() will choose a Segment which yields the minimum height h value in the result. If the chosen Segment has multiple Lanes, then ToRoadPosition() will choose a Lane which contains inertial_position within its lane_bounds() if possible, and if that is still ambiguous, it will further select a Lane which minimizes the absolute value of the lateral r coordinate in the result.


The documentation for this class was generated from the following files: