maliput
LaneBoundary Class Referenceabstract

Detailed Description

Represents a boundary between adjacent lanes or at the edge of a Segment.

A LaneBoundary is owned by a Segment and serves as the interface between two adjacent lanes, or between a lane and the segment edge. For a Segment with N lanes, there are N+1 boundaries:

+r direction
<─────────────
Boundary N ... Boundary 2 Boundary 1 Boundary 0
| | | |
| Lane N-1 | ... | Lane 1 | Lane 0 |
| | | |
(left edge) (right edge)

Where:

  • Boundary 0 is the right edge (minimum r coordinate).
  • Boundary N is the left edge (maximum r coordinate).
  • Boundaries are indexed with increasing r direction.

Each LaneBoundary provides:

  • Reference to the lane on its left (if any).
  • Reference to the lane on its right (if any).
  • Query methods for lane markings at specific s-coordinates.

The design ensures that adjacent lanes share the same boundary object, avoiding redundancy and ensuring consistency. For example, Lane 1's right boundary is the same object as Lane 0's left boundary (Boundary 1).

This design is influenced by OpenDRIVE's road marking model and OSI's lane boundary concept.

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

Inheritance diagram for LaneBoundary:
[legend]

Public Types

using Id = TypeSpecificIdentifier< class LaneBoundary >
 Unique identifier for a LaneBoundary. More...
 

Public Member Functions

virtual ~LaneBoundary ()=default
 
Id id () const
 
const Segmentsegment () const
 
int index () const
 
const Lanelane_to_left () const
 
const Lanelane_to_right () const
 
std::optional< LaneMarkingResultGetMarking (double s) const
 Gets the lane marking at a specific s-coordinate along this boundary. More...
 
std::vector< LaneMarkingResultGetMarkings () const
 Gets all lane markings along this boundary. More...
 
std::vector< LaneMarkingResultGetMarkings (double s_start, double s_end) const
 Gets lane markings within a specified s-range. More...
 

Protected Member Functions

 LaneBoundary ()=default
 

Member Typedef Documentation

◆ Id

Unique identifier for a LaneBoundary.

Constructor & Destructor Documentation

◆ ~LaneBoundary()

virtual ~LaneBoundary ( )
virtualdefault

Reimplemented in LaneBoundary.

◆ LaneBoundary()

LaneBoundary ( )
protecteddefault

Member Function Documentation

◆ GetMarking()

std::optional<LaneMarkingResult> GetMarking ( double  s) const

Gets the lane marking at a specific s-coordinate along this boundary.

Parameters
sThe s-coordinate along the boundary (in the lane coordinate system). Typically in the range [0, segment_length].
Returns
The lane marking result at the specified position, including the marking details and the s-range over which it is valid. Returns std::nullopt if no marking information is available at that location.
Note
The s-coordinate system follows the lane(s) adjacent to this boundary. For consistency, implementations should use the reference lane's s-coordinate (e.g., the lane to the right, or lane to the left if there's no lane to the right).

◆ GetMarkings() [1/2]

std::vector<LaneMarkingResult> GetMarkings ( ) const

Gets all lane markings along this boundary.

Returns
A vector of LaneMarkingResult, each describing a marking and the s-range over which it is valid. The results are ordered by increasing s_start. If no markings are available, returns an empty vector.
Note
The returned ranges should cover the entire boundary length without gaps, though some ranges may have type == kNone to indicate sections without visible markings.

◆ GetMarkings() [2/2]

std::vector<LaneMarkingResult> GetMarkings ( double  s_start,
double  s_end 
) const

Gets lane markings within a specified s-range.

Parameters
s_startStart of the s-range to query [m].
s_endEnd of the s-range to query [m].
Returns
A vector of LaneMarkingResult for markings that overlap with the specified range. Results are ordered by increasing s_start. If no markings are available in the range, returns an empty vector.
Exceptions
maliput::common::assertion_errorif s_start > s_end.

◆ id()

Id id ( ) const
Returns
The unique identifier for this LaneBoundary.

◆ index()

int index ( ) const
Returns
The index of this boundary within the parent Segment.

Boundaries are indexed from 0 (rightmost, minimum r) to num_lanes() (leftmost, maximum r).

◆ lane_to_left()

const Lane* lane_to_left ( ) const
Returns
The Lane immediately to the left of this boundary (increasing r direction), or nullptr if this is the leftmost boundary of the Segment.

◆ lane_to_right()

const Lane* lane_to_right ( ) const
Returns
The Lane immediately to the right of this boundary (decreasing r direction), or nullptr if this is the rightmost boundary of the Segment.

◆ segment()

const Segment* segment ( ) const
Returns
The Segment to which this LaneBoundary belongs.

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