maliput_malidrive
|
Defines a class for a path in a Segment object surface.
The path is defined by an elevation and superelevation Function objects and a GroundCurve reference curve. The latter is a C1 function in the z=0 plane. Its domain is constrained in \( [GroundCurve::p0(); GroundCurve::p1()] \) interval and it should map a ℝ² curve. As per notation, \( p \) is the parameter of the reference curve, not necessarily arc length \( s \), and function interpolations and function derivatives as well as headings and heading derivatives are expressed in INERTIAL Frame coordinates.
The geometry here revolves around an abstract "world function"
\( W: (p,r,h) \mapsto (x,y,z) ∈ ℝ³ \)
which maps a Lane
-frame position to its corresponding representation in world coordinates (with the caveat that instead of the lane's native longitudinal coordinate 's', the reference curve parameter 'p' is used).
W is derived from three functions which define the lane:
G: p --> (x,y) = the reference ground curve. Z: p --> z = the elevation function. Θ: p --> θ = the superelevation function.
as:
(x,y,z) = W(p,r,h) = (G(p), Z(p)) + R_αβγ*(0, r, h)
where:
R_αβγ is the roll/pitch/yaw rotation given by angles:
α = Θ(p) β = -atan2(dZ/dp, sqrt((dG_x/dp)^2 + (dG_y/dp)^2)) at p γ = atan2(dG_y/dp, dG_x/dp) at p
(R_αβγ is essentially the orientation of the (s,r,h) Lane
-frame at a location (s,0,0) on the reference-line of the lane. However, it is not necessarily the correct orientation at r != 0 or h != 0.)
The W(p,r,h) "world function" is defined by the RoadCurve referenced by a Lane's Segment. A Lane is also defined by a r0 lateral offset with respect to the reference curve of the RoadCurve. Thus, a mapping from the local (s,r,h) lane-frame of the Lane becomes:
(x,y,z) = L(s,r,h) = W(P(s, r0), r + r0, h),
where P:(s, r0) --> (p) is a (potentially non-linear) function dependent on the RoadCurve's reference-curve, elevation, and superelevation functions.
#include <src/maliput_malidrive/road_curve/road_curve.h>
Public Member Functions | |
MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (RoadCurve) | |
RoadCurve (double linear_tolerance, double scale_length, std::unique_ptr< GroundCurve > ground_curve, std::unique_ptr< Function > elevation, std::unique_ptr< Function > superelevation, bool assert_contiguity) | |
Constructs a RoadCurve. More... | |
~RoadCurve ()=default | |
double | p0 () const |
double | p1 () const |
double | LMax () const |
double | linear_tolerance () const |
double | scale_length () const |
maliput::math::Vector3 | W (const maliput::math::Vector3 &prh) const |
Evaluates \( W(p, r, h) \). More... | |
maliput::math::Vector3 | WDot (const maliput::math::Vector3 &prh) const |
Evaluates \( W'(p, r, h) \) with respect to \( p \). More... | |
maliput::math::Vector3 | WDot (const maliput::math::Vector3 &prh, const Function *lane_offset) const |
Evaluates \( W'(p, r, h) \) with respect to \( p \). More... | |
maliput::math::RollPitchYaw | Orientation (double p) const |
Evaluates the orientation in the INERTIAL Frame of the RoadCurve at p , i.e. More... | |
maliput::math::RollPitchYaw | Orientation (const maliput::math::Vector3 &prh) const |
Evaluates the orientation in the INERTIAL Frame of the RoadCurve at prh . More... | |
maliput::math::RollPitchYaw | Orientation (const maliput::math::Vector3 &prh, const Function *lane_offset) const |
Evaluates the orientation in the INERTIAL Frame of the RoadCurve at prh . More... | |
maliput::math::Vector3 | WInverse (const maliput::math::Vector3 &xyz) const |
Evaluates \( W⁻¹(x, y, z) \). More... | |
maliput::math::Vector3 | SHat (const maliput::math::Vector3 &prh, const Function *lane_offset) const |
Evaluates \( W'(p, r, h) / |W'(p, r, h)|` with respect to \) p \(. @param prh A vector in the RoadCurve domain. @return A normalized tangent vector in the direction of increasing \) p \( at @p prh. maliput::math::Vector3 SHat(const maliput::math::Vector3& prh) const; Evaluates \) W'(p, r, h) / |W'(p, r, h)|` with respect to \( p \). More... | |
maliput::math::Vector3 | RHat (const maliput::math::Vector3 &prh) const |
Evaluates the r-axis unit vector at \( (p, r, h) \). More... | |
maliput::math::Vector3 | RHat (const maliput::math::Vector3 &prh, const Function *lane_offset) const |
Evaluates the r-axis unit vector at \( (p, r, h) \). More... | |
maliput::math::Vector3 | HHat (double p, const maliput::math::Vector3 &s_hat) const |
Evaluates the h-axis unit vector at \( (p, r, h) \). More... | |
double | PFromP (double xodr_p) const |
Calculates the \( p \) value that matches with the \( p \) value in the XODR description. More... | |
RoadCurve | ( | double | linear_tolerance, |
double | scale_length, | ||
std::unique_ptr< GroundCurve > | ground_curve, | ||
std::unique_ptr< Function > | elevation, | ||
std::unique_ptr< Function > | superelevation, | ||
bool | assert_contiguity | ||
) |
Constructs a RoadCurve.
linear_tolerance | It is expected to be the same as maliput::api::RoadGeometry::linear_tolerance(). It must be non negative. It is used to integrate an offset RoadCurve's arc length and adjust integration parameters accordingly. |
scale_length | It is expected to be the same as maliput::api::RoadGeometry::scale_length(). It must be non negative. It is used to integrate an offset RoadCurve's arc length and adjust integration parameters accordingly. |
ground_curve | The reference GroundCurve of this RoadCurve. It must not be nullptr and must be G¹. |
elevation | The elevation Function of this RoadCurve. It must not be nullptr. |
superelevation | The superelevation Function of this RoadCurve. It must not be nullptr. |
assert_contiguity | True for assert contiguity for elevation and superelevation functions. |
maliput::common::assertion_error | When linear_tolerance or scale_length are negative. |
maliput::common::assertion_error | When ground_curve or elevation or superelevation are nullptr. |
maliput::common::assertion_error | When ground_curve or elevation or superelevation are not G¹. |
maliput::common::assertion_error | When ground_curve is not G¹. |
maliput::common::assertion_error | When ground_curve , elevation and superelevation do not share the same range within linear_tolerance . |
|
default |
maliput::math::Vector3 HHat | ( | double | p, |
const maliput::math::Vector3 & | s_hat | ||
) | const |
Evaluates the h-axis unit vector at \( (p, r, h) \).
p | The GroundCurve parameter. |
s_hat | A normalized tangent vector in the direction of increasing \( p \). |
p
, i.e. at \( (p, 0, 0) \). It is orthogonal to s_hat
by construction. maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When p is not in range [p0, p1]. |
double linear_tolerance | ( | ) | const |
double LMax | ( | ) | const |
MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN | ( | RoadCurve | ) |
maliput::math::RollPitchYaw Orientation | ( | const maliput::math::Vector3 & | prh | ) | const |
maliput::math::RollPitchYaw Orientation | ( | const maliput::math::Vector3 & | prh, |
const Function * | lane_offset | ||
) | const |
Evaluates the orientation in the INERTIAL Frame of the RoadCurve at prh
.
prh | A vector in the RoadCurve domain. |
lane_offset | Holds the function, \( r(p) \), that describes the lateral offset at p. Used to calculate the derivative at prh . |
prh
. maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When prh .x() is not in range [p0, p1]. |
maliput::math::RollPitchYaw Orientation | ( | double | p | ) | const |
Evaluates the orientation in the INERTIAL Frame of the RoadCurve at p
, i.e.
at \( (p, 0, 0) \).
p | The GroundCurve parameter. |
p
. double p0 | ( | ) | const |
double p1 | ( | ) | const |
double PFromP | ( | double | xodr_p | ) | const |
Calculates the \( p \) value that matches with the \( p \) value in the XODR description.
xodr_p | The parameter in the XODR description. |
maliput::math::Vector3 RHat | ( | const maliput::math::Vector3 & | prh | ) | const |
Evaluates the r-axis unit vector at \( (p, r, h) \).
prh | A vector in the RoadCurve domain. |
prh
. maliput::math::Vector3 RHat | ( | const maliput::math::Vector3 & | prh, |
const Function * | lane_offset | ||
) | const |
Evaluates the r-axis unit vector at \( (p, r, h) \).
prh | A vector in the RoadCurve domain. |
lane_offset | Holds the function, \( r(p) \), that describes the lateral offset at p. Used to calculate the derivative at prh . |
prh
. maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When prh .x() is not in range [p0, p1]. |
double scale_length | ( | ) | const |
maliput::math::Vector3 SHat | ( | const maliput::math::Vector3 & | prh, |
const Function * | lane_offset | ||
) | const |
Evaluates \( W'(p, r, h) / |W'(p, r, h)|` with respect to \) p \(. @param prh A vector in the RoadCurve domain. @return A normalized tangent vector in the direction of increasing \) p \( at @p prh. maliput::math::Vector3 SHat(const maliput::math::Vector3& prh) const; Evaluates \) W'(p, r, h) / |W'(p, r, h)|` with respect to \( p \).
prh | A vector in the RoadCurve domain. |
lane_offset | Holds the function, \( r(p) \), that describes the lateral offset at p. Used to calculate the derivative at prh . |
prh
. maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When prh .x() is not in range [p0, p1]. |
maliput::math::Vector3 W | ( | const maliput::math::Vector3 & | prh | ) | const |
maliput::math::Vector3 WDot | ( | const maliput::math::Vector3 & | prh | ) | const |
Evaluates \( W'(p, r, h) \) with respect to \( p \).
prh | A vector in the RoadCurve domain. |
prh
. maliput::math::Vector3 WDot | ( | const maliput::math::Vector3 & | prh, |
const Function * | lane_offset | ||
) | const |
Evaluates \( W'(p, r, h) \) with respect to \( p \).
prh | A vector in the RoadCurve domain. |
lane_offset | Holds the function, \( r(p) \), that describes the lateral offset at p. Used to calculate the derivative at prh . |
prh
. maliput::common::assertion_error | When lane_offset is nullptr. |
maliput::common::assertion_error | When prh .x() is not in range [p0, p1]. |
maliput::common::assertion_error | When lane_offset ->p0() is not in range [p0, p1]. |
maliput::common::assertion_error | When lane_offset ->p1() is not in range [p0, p1]. |
maliput::math::Vector3 WInverse | ( | const maliput::math::Vector3 & | xyz | ) | const |
Evaluates \( W⁻¹(x, y, z) \).
xyz | A point in ℝ³ that would be used to minimize the Euclidean distance the image of \( W \). |
xyz
.