maliput_malidrive
|
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>
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 | |
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.
adjacent_lane_functions | Holds LaneOffset's function and LaneWidth's function of the immediate previous lane. It is nullopt if the lane is the centerlane. |
lane_width | LaneWidth's function of the current lane. |
reference_line_offset | Functions that describes the lateral shift of the road reference line. |
at_right | True if the lane is at the right of the center lane. |
p0 | Lower bound extreme of the parameter range. It must not be negative and must be less than p1 . |
p1 | Upper bound extreme of the parameter range. It must be greater than p0 . |
linear_tolerance | Tolerance of the range [ p0 ; p1 ] that will be used to evaluate the parameter. |
maliput::common::assertion_error | When linear_tolerance is not positive. |
maliput::common::assertion_error | When lane_width is nullptr. |
maliput::common::assertion_error | When reference_line_offset is nullptr. |
maliput::common::assertion_error | When adjacent_lane_functions 's offset value is nullptr. |
maliput::common::assertion_error | When adjacent_lane_functions 's width value is nullptr. |
MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN | ( | LaneOffset | ) |
|
staticconstexpr |
|
staticconstexpr |