Drake
arc_lane.h
Go to the documentation of this file.
1 #pragma once
2
3 #include <cmath>
4
8
9 namespace drake {
10 namespace maliput {
11 namespace monolane {
12
13 /// Specialization of Lane with a circular arc as its reference curve
14 /// in the xy-plane (the ground plane) of the world frame.
15 class ArcLane : public Lane {
16  public:
18
19  /// Constructs an ArcLane, specified by a circular arc defined in the
20  /// xy-plane (the ground plane) of the world frame.
21  ///
22  /// @param center center of the reference arc
23  /// @param radius radius of the reference arc (must be positive)
24  /// @param theta0 angle of the start point of the reference arc with respect
25  /// to @p center (0 == parallel to x-axis)
26  /// @param d_theta central angle of the arc, i.e., angular displacement
27  /// from start to end. d_theta > 0 is counter-clockwise.
28  ///
29  /// @param id,segment,lane_bounds,driveable_bounds,elevation_bounds
30  /// See documentation for the Lane base class.
31  /// @param elevation,superelevation
32  /// See documentation for the Lane base class.
33  ///
34  /// N.B. The override ArcLane::ToLanePosition() is currently restricted to
35  /// lanes in which superelevation and elevation change are both zero.
36  ArcLane(const api::LaneId& id, const api::Segment* segment,
37  const V2& center, double radius,
38  double theta0, double d_theta,
44
45  ~ArcLane() override = default;
46
47  private:
48  // Computes the LanePosition from a given GeoPosition. This function is exact
49  // (to numerical precision) under the assumption that the road is flat
50  // (superelevation is everywhere zero and the elevation has zero gradient),
51  // and a close approximation for lanes exhibiting small elevation changes.
52  //
53  // Note that, when the absolute theta displacement d_theta_ exceeds 2π, a
54  // unique solution for s = LanePosition.s no longer exists. In this case,
55  // the return value of s is that which results in the smallest
56  // abs(theta_of_p(s)).
57  api::LanePosition DoToLanePosition(const api::GeoPosition& geo_pos,
58  api::GeoPosition* nearest_point,
59  double* distance) const override;
60
61  V2 xy_of_p(const double p) const override;
62  V2 xy_dot_of_p(const double p) const override;
63  double heading_of_p(const double p) const override;
64  double heading_dot_of_p(const double p) const override;
65
66  double theta_of_p(double p) const;
67
68  double r_{};
69  double cx_{};
70  double cy_{};
71  double theta0_{};
72  double d_theta_{};
73 };
74
75 } // namespace monolane
76 } // namespace maliput
77 } // namespace drake
A cubic polynomial, f(p) = a + b*p + c*p^2 + d*p^3.
Definition: lane.h:54
const CubicPolynomial & superelevation() const
Definition: lane.h:208
Definition: bullet_model.cc:22
Vector2< double > V2
Definition: lane.h:21
const CubicPolynomial & elevation() const
Definition: lane.h:206
HBounds elevation_bounds(double s, double r) const
Returns the elevation (h) bounds of the lane as a function of (s, r).
Definition: lane.h:90
Provides Drake&#39;s assertion implementation.
const Segment * segment() const
Returns the Segment to which this Lane belongs.
Definition: lane.h:45
GeoPositionT< double > GeoPosition
Definition: lane_data.h:186
Bounds in the lateral dimension (r component) of a Lane-frame, consisting of a pair of minimum and ma...
Definition: lane_data.h:315
Base class for the monolane implementation of api::Lane.
Definition: lane.h:131
Bounds in the elevation dimension (h component) of a Lane-frame, consisting of a pair of minimum and ...
Definition: lane_data.h:360
A Segment represents a bundle of adjacent Lanes which share a continuously traversable road surface...
Definition: segment.h:27
RBounds driveable_bounds(double s) const
Returns the driveable lateral (r) bounds of the lane as a function of s.
Definition: lane.h:84
RBounds lane_bounds(double s) const
Returns the nominal lateral (r) bounds for the lane as a function of s.
Definition: lane.h:76
#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:33
ArcLane(const ArcLane &)=delete
Provides careful macros to selectively enable or disable the special member functions for copy-constr...
Specialization of Lane with a circular arc as its reference curve in the xy-plane (the ground plane) ...
Definition: arc_lane.h:15