Drake
road_curve.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <utility>
4 
9 #include "drake/common/unused.h"
10 
11 namespace drake {
12 namespace maliput {
13 namespace multilane {
14 
24 class RoadCurve {
25  public:
27 
28  virtual ~RoadCurve() = default;
29 
30  const CubicPolynomial& elevation() const { return elevation_; }
31 
32  const CubicPolynomial& superelevation() const { return superelevation_; }
33 
37  double trajectory_length() const {
38  return elevation_.s_p(1.0) * p_scale();
39  }
40 
44  virtual Vector2<double> xy_of_p(double p) const = 0;
45 
50  virtual Vector2<double> xy_dot_of_p(double p) const = 0;
51 
57  virtual double heading_of_p(double p) const = 0;
58 
63  virtual double heading_dot_of_p(double p) const = 0;
64 
68  virtual double p_scale() const = 0;
69 
88  const Vector3<double>& geo_coordinate,
89  const api::RBounds& lateral_bounds,
90  const api::HBounds& height_bounds) const = 0;
91 
100  virtual bool IsValid(
101  const api::RBounds& lateral_bounds,
102  const api::HBounds& height_bounds) const = 0;
103 
104  protected:
140  : elevation_(elevation), superelevation_(superelevation) {}
141 
142  private:
143  // A polynomial that represents the elevation change as a function of p.
144  CubicPolynomial elevation_;
145  // A polynomial that represents the superelevation angle change as a function
146  // of p.
147  CubicPolynomial superelevation_;
148 };
149 
150 } // namespace multilane
151 } // namespace maliput
152 } // namespace drake
This file contains abbreviated definitions for certain specializations of Eigen::Matrix that are comm...
Definition: automotive_demo.cc:88
Eigen::Matrix< Scalar, 2, 1 > Vector2
A column vector of size 2, templated on scalar type.
Definition: eigen_types.h:30
const CubicPolynomial & elevation() const
Definition: road_curve.h:30
virtual bool IsValid(const api::RBounds &lateral_bounds, const api::HBounds &height_bounds) const =0
Checks that there are no self-intersections (singularities) in the volume created by applying the con...
virtual Vector3< double > ToCurveFrame(const Vector3< double > &geo_coordinate, const api::RBounds &lateral_bounds, const api::HBounds &height_bounds) const =0
Converts a geo_coordinate in the world frame to the composed curve frame, i.e., the superposition of ...
Defines an interface for a path in a Segment object surface.
Definition: road_curve.h:24
double s_p(double p) const
Returns the path-length s along the curve (p, f(p)) from p = 0 to p.
Definition: cubic_polynomial.h:59
virtual Vector2< double > xy_dot_of_p(double p) const =0
Computes the first derivative of the reference curve.
Definition: arc_road_curve.cc:11
Bounds in the lateral dimension (r component) of a Lane-frame, consisting of a pair of minimum and ma...
Definition: lane_data.h:274
A cubic polynomial, f(p) = a + b*p + c*p^2 + d*p^3.
Definition: cubic_polynomial.h:13
Bounds in the elevation dimension (h component) of a Lane-frame, consisting of a pair of minimum and ...
Definition: lane_data.h:309
virtual double heading_dot_of_p(double p) const =0
Computes the first derivative heading of the reference curve.
double trajectory_length() const
Computes the composed curve path integral in the interval of p = [0; 1].
Definition: road_curve.h:37
const CubicPolynomial & superelevation() const
Definition: road_curve.h:32
virtual Vector2< double > xy_of_p(double p) const =0
Computes the reference curve.
RoadCurve(const CubicPolynomial &elevation, const CubicPolynomial &superelevation)
Constructs a road curve given elevation and superelevation curves.
Definition: road_curve.h:138
#define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname)
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:35
virtual double heading_of_p(double p) const =0
Computes the heading of the reference curve.
Provides careful macros to selectively enable or disable the special member functions for copy-constr...
virtual double p_scale() const =0
Computes the path length integral of the reference curve for the interval [0;1] of p...