Drake
road_path.h
Go to the documentation of this file.
1 #pragma once
2 
8 
9 namespace drake {
10 namespace automotive {
11 
28 template <typename T>
29 class RoadPath {
30  public:
32 
33 
34  RoadPath(const LaneDirection& initial_lane_direction, const T& step_size,
42  int num_breaks);
43  ~RoadPath();
44 
45  const PiecewisePolynomial<T>& get_path() const;
46 
49  // TODO(jadecastro): Implement this.
50  const T GetClosestPathPosition(const Vector3<T>& geo_position,
51  const T& s_guess) const;
52 
53  private:
54  // Traverse the road, starting from an initial LaneDirection, and build a
55  // cubic spline PiecewisePolynomial until 1) a given a number of segments has
56  // been traversed, or 2) the end of the road has been reached.
57  //
58  // If a BranchPoint is encountered in which there is more than one ongoing
59  // lane, the zero-index lane is always selected.
60  // TODO(jadecastro): Use Lane::GetDefaultBranch() to decide the ongoing Lane.
61  const PiecewisePolynomial<T> MakePiecewisePolynomial(
62  const LaneDirection& initial_lane_direction, const T& step_size,
63  int num_breaks) const;
64 
65  PiecewisePolynomial<T> path_; // The path representing the mid-curve of the
66  // road.
67  PiecewisePolynomial<T> path_prime_; // First derivative of path_.
68  PiecewisePolynomial<T> path_double_prime_; // Second derivative of path_.
69 };
70 
71 } // namespace automotive
72 } // namespace drake
This file contains abbreviated definitions for certain specializations of Eigen::Matrix that are comm...
const T GetClosestPathPosition(const Vector3< T > &geo_position, const T &s_guess) const
Computes the closest s-position on the path to an arbitrary point in the world frame of the provided ...
Definition: road_path.cc:39
Definition: automotive_demo.cc:88
RoadPath converts a sequence of Maliput Lanes into a PiecewisePolynomial for the purpose of generatin...
Definition: road_path.h:29
RoadPath(const RoadPath &)=default
Eigen::Matrix< Scalar, 3, 1 > Vector3
A column vector of size 3, templated on scalar type.
Definition: eigen_types.h:34
#define DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(Classname)
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN defaults the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:59
LaneDirection holds the lane that a MaliputRailcar is traversing and the direction in which it is mov...
Definition: lane_direction.h:13
~RoadPath()
Definition: road_path.cc:31
const PiecewisePolynomial< T > & get_path() const
Definition: road_path.cc:34
Provides careful macros to selectively enable or disable the special member functions for copy-constr...