Drake
drake::maliput::rndf Namespace Reference

Namespaces

 test
 

Classes

class  ArcLengthParameterizedSpline
 An extension for ignition::math::Splines that reparameterizes them by path length. More...
 
class  BranchPoint
 An implementation of api::BranchPoint for RNDF. More...
 
class  Builder
 A class to ease the construction of a RoadGeometry from Connection and DirectedWaypoint objects. More...
 
class  Connection
 A container that holds the information needed by a Builder to construct one or more Lane objects. More...
 
class  DirectedWaypoint
 A container that holds the information needed by a Builder to construct a Lane from a sequence of ignition::rndf::Waypoint objects. More...
 
class  InverseFunctionInterpolator
 A linear interpolator for arbitrary inverse functions. More...
 
class  Junction
 An api::Junction implementation for RNDF. More...
 
class  Lane
 Base class for the RNDF implementation of api::Lane. More...
 
class  LaneEndSet
 An implementation of LaneEndSet for RNDF. More...
 
class  RoadGeometry
 An api::RoadGeometry implementation for RNDF specification. More...
 
class  Segment
 An api::Segment implementation for RNDF. More...
 
class  SplineLane
 Specialization of drake::maliput::rndf::Lane with a spline curve as its reference path. More...
 

Functions

std::vector< ignition::math::Vector3d > SplineToBezier (const ignition::math::Vector3d &p0, const ignition::math::Vector3d &t0, const ignition::math::Vector3d &p1, const ignition::math::Vector3d &t1)
 Provides the equivalent set of points in cubic Bezier base from two pairs of points and tangents at the extents of a spline. More...
 
std::vector< ignition::math::Vector3d > BezierToSpline (const ignition::math::Vector3d &p0, const ignition::math::Vector3d &p1, const ignition::math::Vector3d &p2, const ignition::math::Vector3d &p3)
 Provides the equivalent set of points in cubic spline base from four cubic Bezier control points. More...
 
std::vector< ignition::math::Vector3d > MakeBezierCurveMonotonic (const std::vector< ignition::math::Vector3d > &control_points, double scale)
 Provides a conditionally convex and monotonic Bezier curve given a vector of control points control_points. More...
 
std::unique_ptr< ignition::math::Spline > CreatePChipBasedSpline (const std::vector< ignition::math::Vector3d > &positions)
 Creates a ignition::math::Spline from a set of positions. More...
 
 GTEST_TEST (RNDFBuilderTest, ConnectionConstructorTest)
 
 GTEST_TEST (RNDFBuilderTest, ConnectionSetterAndGetterTest)
 
 GTEST_TEST (RNDFBuilderTest, ConnectionWaypointTest)
 
 GTEST_TEST (RNDFBuilderTest, DirectedWaypointDefaultConstructorTest)
 
 GTEST_TEST (RNDFBuilderTest, DirectedWaypointSetterTest)
 
 GTEST_TEST (RNDFBuilderTest, DirectedWaypointParameterConstructorTest)
 
 GTEST_TEST (RNDFBuilderTest, DirectedWaypointBoundingBoxTest)
 
 GTEST_TEST (IgnitionRNDFTest, Test)
 
 GTEST_TEST (RNDFJunctionTest, GettersTest)
 
 GTEST_TEST (RNDFJunctionTest, SegmentTest)
 
 GTEST_TEST (RNDFRoadGeometryTest, JunctionTest)
 
 GTEST_TEST (RNDFRoadGeometryTest, BranchPointTest)
 
 GTEST_TEST (RNDFRoadGeometryTest, GettersTest)
 
 GTEST_TEST (RNDFSegmentTest, MetadataLane)
 
std::unique_ptr< ignition::math::Spline > CreateSpline (const std::vector< std::tuple< ignition::math::Vector3d, ignition::math::Vector3d >> &points)
 
 GTEST_TEST (RNDFSplineHelperTest, ExceptionsInInverseFunctionInterpolator)
 
 GTEST_TEST (RNDFSplineHelperTest, ExceptionsInArcLengthParameterizedSpline)
 
 GTEST_TEST (RNDFSplineHelperTest, StraightLine)
 
 GTEST_TEST (RNDFSplineHelperTest, StraightSplineFindClosesPointTo)
 
 GTEST_TEST (RNDFSplineToBezierTest, ConversionTest)
 
 GTEST_TEST (RNDFBezierToBezierTest, ConversionTest)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, ExceptionCases)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, Case90DegreeConnection)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, CaseParallelNonColinearConnection)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, CaseParallelColinearConnection)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, CaseObliqueConnection)
 
 GTEST_TEST (RNDFMakeBezierCurveMonotonicTest, CaseObliqueNonConvexConnection)
 
 GTEST_TEST (RNDFCreatePChipBasedSplineTest, CaseExceptions)
 
 GTEST_TEST (RNDFSplineLanesTest, FlatLineLane)
 
 GTEST_TEST (RNDFSplineLanesTest, CurvedLineLane)
 
 GTEST_TEST (RNDFSplineLanesTest, Constructor)
 
 GTEST_TEST (RNDFSplineLanesTest, ComputeLength)
 
 GTEST_TEST (RNDFSplineLanesTest, TwoFlatLineLanesBoundChecks)
 

Variables

static const int kFunctionPartitionTreeDegree = 10
 
static const int kFunctionPartitionTreeMaxDepth = 10
 
static constexpr double kBezierMatrix [16]
 
static constexpr double kHermiteMatrix [16]
 
const double kLinearTolerance = 1e-12
 
const double kAngularTolerance = 1e-12
 
const double kLinearStep = 1e-2
 
const double kPathTolerance = 1e-6
 
const double kVeryExact = 1e-12
 

Function Documentation

std::vector< ignition::math::Vector3d > BezierToSpline ( const ignition::math::Vector3d &  p0,
const ignition::math::Vector3d &  p1,
const ignition::math::Vector3d &  p2,
const ignition::math::Vector3d &  p3 
)

Provides the equivalent set of points in cubic spline base from four cubic Bezier control points.

Parameters
p0A vector that describes the starting position of the curve.
p1A vector that describes the first control point of the curve.
p2A vector that describes the second control point of the curve.
p3A vector that describes the last control point of the curve.
Returns
A vector containing four spline control points. The points are returned in the following order:
  1. index 0 –> curve position at the beginning.
  2. index 1 –> curve tangent at the beginning.
  3. index 2 –> curve position at the ending.
  4. index 3 –> curve tangent at the ending.

Here is the caller graph for this function:

std::unique_ptr< ignition::math::Spline > CreatePChipBasedSpline ( const std::vector< ignition::math::Vector3d > &  positions)

Creates a ignition::math::Spline from a set of positions.

These positions are the control points where the curve must go through. The final curve is based from a PChip algorithm, which makes the interpolation safe in terms of piecewise convexity and monotonicity.

Parameters
positionsA vector of position where the spline should go through. It should have more than two points. In addition, two consecutive points that have a length of zero will throw an exception since it's not yet supported.
Returns
A ignition's Spline containing as knots the positions vector and as tangent's the PChip's interpolated value.
Exceptions
std::runtime_errorWhen positions' size is less than three.
std::runtime_errorWhen two consecutive positions' items have a distance of zero.

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< ignition::math::Spline > CreateSpline ( const std::vector< std::tuple< ignition::math::Vector3d, ignition::math::Vector3d >> &  points)

Here is the caller graph for this function:

drake::maliput::rndf::GTEST_TEST ( IgnitionRNDFTest  ,
Test   
)
drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
DirectedWaypointDefaultConstructorTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
ConnectionConstructorTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFSegmentTest  ,
MetadataLane   
)
drake::maliput::rndf::GTEST_TEST ( RNDFJunctionTest  ,
GettersTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFRoadGeometryTest  ,
JunctionTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
DirectedWaypointSetterTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFJunctionTest  ,
SegmentTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
ConnectionSetterAndGetterTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFRoadGeometryTest  ,
BranchPointTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFSplineHelperTest  ,
ExceptionsInInverseFunctionInterpolator   
)
drake::maliput::rndf::GTEST_TEST ( RNDFSplineLanesTest  ,
FlatLineLane   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
DirectedWaypointParameterConstructorTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFRoadGeometryTest  ,
GettersTest   
)
drake::maliput::rndf::GTEST_TEST ( RNDFSplineHelperTest  ,
ExceptionsInArcLengthParameterizedSpline   
)
drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
ConnectionWaypointTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFBuilderTest  ,
DirectedWaypointBoundingBoxTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineHelperTest  ,
StraightLine   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineHelperTest  ,
StraightSplineFindClosesPointTo   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineLanesTest  ,
CurvedLineLane   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineToBezierTest  ,
ConversionTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFBezierToBezierTest  ,
ConversionTest   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineLanesTest  ,
Constructor   
)
drake::maliput::rndf::GTEST_TEST ( RNDFSplineLanesTest  ,
ComputeLength   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
ExceptionCases   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFSplineLanesTest  ,
TwoFlatLineLanesBoundChecks   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
Case90DegreeConnection   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
CaseParallelNonColinearConnection   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
CaseParallelColinearConnection   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
CaseObliqueConnection   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFMakeBezierCurveMonotonicTest  ,
CaseObliqueNonConvexConnection   
)

Here is the call graph for this function:

drake::maliput::rndf::GTEST_TEST ( RNDFCreatePChipBasedSplineTest  ,
CaseExceptions   
)

Here is the call graph for this function:

std::vector< ignition::math::Vector3d > MakeBezierCurveMonotonic ( const std::vector< ignition::math::Vector3d > &  control_points,
double  scale 
)

Provides a conditionally convex and monotonic Bezier curve given a vector of control points control_points.

First it computes the intersection of the lines represented by point and tangent at the beginning and at the end of the curve. From here we have a a first branch in the behavior, if there is no intersection, we assume that all these curves are 2-D curves over the z = 0.0 api::GeoPosition frame. Then, we create two intermediate control points for them that will provide a S shape to match the curve. The change in convexity is set to be in the mid point of the extents of the curve. In case there is an intersection between the two lines, we find it and this will be the critical point. From this step, there are two types of geometries we can generate but for both, the control points at the extents remain the same. For those control points in between we use the following equations to compute them:

control_points[1] = control_points[0] + (±1.0) * scale * (critical_point - control_points[0]) control_points[2] = control_points[3] + (∓1.0) * scale * (critical_point - control_points[3])

When the curve preserves convexity, scale is multiplied by (+1.0) in both cases. However, when it is not, opposite signs are used.

Parameters
control_pointsA vector containing four Bezier control points. The first and last points are the extent points of the Bezier curve and the other two are the tangent controlling waypoints.
scaleA scale factor with a range value between 0.0 and 1.0.
Returns
A vector containing four Bezier control points. The first and last points are the extent points of the Bezier curve and the other two are the tangent controlling waypoints.
Exceptions
std::runtime_errorWhen the size of control_points is different from 4.
std::runtime_errorWhen scale is bigger than 1.0.
std::runtime_errorWhen scale is smaller than 0.0.

Here is the caller graph for this function:

std::vector< ignition::math::Vector3d > SplineToBezier ( const ignition::math::Vector3d &  p0,
const ignition::math::Vector3d &  t0,
const ignition::math::Vector3d &  p1,
const ignition::math::Vector3d &  t1 
)

Provides the equivalent set of points in cubic Bezier base from two pairs of points and tangents at the extents of a spline.

Parameters
p0A vector that describes the starting position of the curve.
t0A vector that describes the tangent at p0.
p1A vector that describes the ending position of the curve.
t1A vector that describes the tangent at p1.
Returns
A vector containing four Bezier control points. The first and last points are the extent points of the Bezier curve and the other two are the tangent controlling waypoints.

Here is the caller graph for this function:

Variable Documentation

const double kAngularTolerance = 1e-12
constexpr double kBezierMatrix[16]
static
Initial value:
= {
1.0, 0.0, 0.0, 0.0,
-3.0, 3.0, 0.0, 0.0,
3.0, -6.0, 3.0, 0.0,
-1.0, 3.0, -3.0, 1.0}
const int kFunctionPartitionTreeDegree = 10
static
const int kFunctionPartitionTreeMaxDepth = 10
static
constexpr double kHermiteMatrix[16]
static
Initial value:
= {
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
-3.0, -2.0, 3.0, -1.0,
2.0, 1.0, -2.0, 1.0}
const double kLinearStep = 1e-2
const double kLinearTolerance = 1e-12
const double kPathTolerance = 1e-6
const double kVeryExact = 1e-12