maliput_malidrive
LaneOffset Class Reference

Detailed Description

Describes a LaneOffset function behind Function interface.

It is built from the previous laneOffset and laneWidth and the current laneWidth, according with:

\( LaneOffset_{i}(p) = LaneOffset_{i-1}(p) + LaneWidth_{i-1}(p) / 2 + LaneWidth_{i}(p) / 2 \) And \( p ∈ [p0; p1] \)

The sign of \( LaneWidth_{i-1} and LaneWidth_{i }\) depend on whether the Lane is at right(-) or left(+) of the center lane.

The innest LaneOffset (immediate to the center lane) uses the information of the ReferenceLineOffset function.

TODO(#594): Generalize idea of composing cubic polynomials.

#include <src/maliput_malidrive/road_curve/lane_offset.h>

Inheritance diagram for LaneOffset:
[legend]

Classes

struct  AdjacentLaneFunctions
 Holds lane offset and width of the immediate previous lane. More...
 

Public Member Functions

 MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (LaneOffset)
 
 LaneOffset (const std::optional< AdjacentLaneFunctions > &adjacent_lane_functions, const Function *lane_width, const Function *reference_line_offset, bool at_right, double p0, double p1, double linear_tolerance)
 Constructs a LaneOffset. More...
 
- Public Member Functions inherited from Function
 MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (Function)
 
virtual ~Function ()=default
 
double f (double p) const
 Evaluates \( F(p) \). More...
 
double f_dot (double p) const
 Evaluates \( F'(p) \). More...
 
double f_dot_dot (double p) const
 Evaluates \( F''(p) \). More...
 
double p0 () const
 
double p1 () const
 
bool IsG1Contiguous () const
 

Static Public Attributes

static constexpr const bool kAtRightFromCenterLane {true}
 
static constexpr const bool kAtLeftFromCenterLane {false}
 
- Static Public Attributes inherited from Function
static constexpr double kEpsilon = 0.
 Implementations may opt to allow a tolerance or be up to kEpsilon away from [p0(); p1()]. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Function
 Function ()=default
 

Constructor & Destructor Documentation

◆ LaneOffset()

LaneOffset ( const std::optional< AdjacentLaneFunctions > &  adjacent_lane_functions,
const Function lane_width,
const Function reference_line_offset,
bool  at_right,
double  p0,
double  p1,
double  linear_tolerance 
)

Constructs a LaneOffset.

Parameters
adjacent_lane_functionsHolds LaneOffset's function and LaneWidth's function of the immediate previous lane. It is nullopt if the lane is the centerlane.
lane_widthLaneWidth's function of the current lane.
reference_line_offsetFunctions that describes the lateral shift of the road reference line.
at_rightTrue if the lane is at the right of the center lane.
p0Lower bound extreme of the parameter range. It must not be negative and must be less than p1.
p1Upper bound extreme of the parameter range. It must be greater than p0.
linear_toleranceTolerance of the range [ p0; p1] that will be used to evaluate the parameter.
Exceptions
maliput::common::assertion_errorWhen linear_tolerance is not positive.
maliput::common::assertion_errorWhen lane_width is nullptr.
maliput::common::assertion_errorWhen reference_line_offset is nullptr.
maliput::common::assertion_errorWhen adjacent_lane_functions 's offset value is nullptr.
maliput::common::assertion_errorWhen adjacent_lane_functions 's width value is nullptr.

Member Function Documentation

◆ MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN ( LaneOffset  )

Member Data Documentation

◆ kAtLeftFromCenterLane

constexpr const bool kAtLeftFromCenterLane {false}
staticconstexpr

◆ kAtRightFromCenterLane

constexpr const bool kAtRightFromCenterLane {true}
staticconstexpr

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