Drake
RoadGeometry Class Referenceabstract

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

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

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
 
const 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...
 
RoadPosition ToRoadPosition (const GeoPosition &geo_position, const RoadPosition *hint, GeoPosition *nearest_position, double *distance) const
 Determines the RoadPosition corresponding to GeoPosition geo_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...
 
Does not allow copy, move, or assignment
 RoadGeometry (const RoadGeometry &)=delete
 
RoadGeometryoperator= (const RoadGeometry &)=delete
 
 RoadGeometry (RoadGeometry &&)=delete
 
RoadGeometryoperator= (RoadGeometry &&)=delete
 

Protected Member Functions

 RoadGeometry ()=default
 

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.

Constructor & Destructor Documentation

◆ RoadGeometry() [1/3]

RoadGeometry ( const RoadGeometry )
delete

◆ RoadGeometry() [2/3]

RoadGeometry ( RoadGeometry &&  )
delete

◆ ~RoadGeometry()

virtual ~RoadGeometry ( )
virtualdefault

◆ RoadGeometry() [3/3]

RoadGeometry ( )
protecteddefault

Member Function Documentation

◆ angular_tolerance()

double angular_tolerance ( ) const
inline

Returns the tolerance guaranteed for angular measurements (orientations).

◆ branch_point()

const BranchPoint* branch_point ( int  index) const
inline

Returns the BranchPoint indexed by index.

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

◆ ById()

const IdIndex& ById ( ) const
inline

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.

◆ id()

const RoadGeometryId id ( ) const
inline

Returns the persistent identifier.

◆ junction()

const Junction* junction ( int  index) const
inline

Returns the Junction indexed by index.

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

◆ linear_tolerance()

double linear_tolerance ( ) const
inline

Returns the tolerance guaranteed for linear measurements (positions).

◆ num_branch_points()

int num_branch_points ( ) const
inline

Returns the number of BranchPoints in the RoadGeometry.

Return value is non-negative.

◆ num_junctions()

int num_junctions ( ) const
inline

Returns the number of Junctions in the RoadGeometry.

Return value is non-negative.

◆ operator=() [1/2]

RoadGeometry& operator= ( RoadGeometry &&  )
delete

◆ operator=() [2/2]

RoadGeometry& operator= ( const RoadGeometry )
delete

◆ scale_length()

double scale_length ( ) const
inline

Returns the characteristic scale length expressed by this RoadGeometry.

◆ ToRoadPosition()

RoadPosition ToRoadPosition ( const GeoPosition geo_position,
const RoadPosition hint,
GeoPosition nearest_position,
double distance 
) const
inline

Determines the RoadPosition corresponding to GeoPosition geo_position.

If hint is non-null, its value is used to help determine the result.

The return value is the RoadPosition of the point in the RoadGeometry's manifold which is, in the world frame, closest to geo_position. If nearest_position is non-null, then it will be populated with the GeoPosition of that nearest point. If distance is non-null, then it will be populated with the Cartesian distance from geo_position to that nearest point.

This method guarantees that its result satisfies the condition that result.lane->ToGeoPosition(result.pos) is within linear_tolerance() of *nearest_position.

The map from RoadGeometry to the world frame is not onto (as a bounded RoadGeometry cannot completely cover the unbounded Cartesian universe). If geo_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 world 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) world frame location.

If geo_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 geo_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: