maliput
Segment Class Referenceabstract

Detailed Description

A Segment represents a bundle of adjacent Lanes which share a continuously traversable road surface.

Every LanePosition on a given Lane of a Segment has a corresponding LanePosition on each other Lane, all with the same height-above-surface h, that all map to the same GeoPoint in 3-space.

Segments are grouped by Junction.

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

Inheritance diagram for Segment:
[legend]

Public Member Functions

virtual ~Segment ()=default
 
SegmentId id () const
 Returns the persistent identifier. More...
 
const Junctionjunction () const
 Returns the Junction to which this Segment belongs. More...
 
int num_lanes () const
 Returns the number of Lanes contained in this Segment. More...
 
const Lanelane (int index) const
 Returns the Lane indexed by index. More...
 
int num_boundaries () const
 Returns the number of LaneBoundaries contained in this Segment. More...
 
const LaneBoundaryboundary (int index) const
 Returns the LaneBoundary indexed by index. More...
 
std::optional< bool > is_intersection () const
 Returns whether this segment is an intersection. More...
 

Protected Member Functions

 Segment ()=default
 

Constructor & Destructor Documentation

◆ ~Segment()

virtual ~Segment ( )
virtualdefault

Reimplemented in Segment.

◆ Segment()

Segment ( )
protecteddefault

Member Function Documentation

◆ boundary()

const LaneBoundary* boundary ( int  index) const

Returns the LaneBoundary indexed by index.

Boundaries are indexed from 0 (rightmost, minimum r) to num_lanes() (leftmost, maximum r). For a segment with N lanes:

+r direction
<─────────────
Boundary N ... Boundary 2 Boundary 1 Boundary 0
| | | |
| Lane N-1 | ... | Lane 1 | Lane 0 |
| | | |
(left edge) (right edge)
Precondition
index must be >= 0 and <= num_lanes().
Returns
The LaneBoundary at the given index, or nullptr if boundary information is not available for this Segment.

◆ id()

SegmentId id ( ) const

Returns the persistent identifier.

◆ is_intersection()

std::optional<bool> is_intersection ( ) const

Returns whether this segment is an intersection.

Returns
true when segment is in an intersection.
false when segment is known not to be in an intersection.
std::nullopt when intersection information is unavailable.

◆ junction()

const Junction* junction ( ) const

Returns the Junction to which this Segment belongs.

◆ lane()

const Lane* lane ( int  index) const

Returns the Lane indexed by index.

The indexing order is meaningful; numerically adjacent indices correspond to geometrically adjacent Lanes. Indices increase "to the left", i.e., in the direction of increasing r coordinate.

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

◆ num_boundaries()

int num_boundaries ( ) const

Returns the number of LaneBoundaries contained in this Segment.

For a Segment with N lanes, there are N+1 boundaries:

  • Boundary 0 is the rightmost edge (minimum r coordinate).
  • Boundary N is the leftmost edge (maximum r coordinate).

Return value is non-negative (always >= 1 for a valid Segment).

◆ num_lanes()

int num_lanes ( ) const

Returns the number of Lanes contained in this Segment.

Return value is non-negative.


The documentation for this class was generated from the following file:
maliput::utility::MaterialType::Lane
@ Lane