Drake
line_lane.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace drake {
7 namespace maliput {
8 namespace monolane {
9 
12 class LineLane : public Lane {
13  public:
15 
16 
17  LineLane(const api::LaneId& id, const api::Segment* segment, const V2& xy0,
30  const V2& dxy, const api::RBounds& lane_bounds,
35  : Lane(id, segment,
36  lane_bounds, driveable_bounds, elevation_bounds,
37  dxy.norm(),
39  x0_(xy0.x()),
40  y0_(xy0.y()),
41  dx_(dxy.x()),
42  dy_(dxy.y()),
43  heading_(std::atan2(dy_, dx_)) {}
44 
45  ~LineLane() 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  api::LanePosition DoToLanePosition(const api::GeoPosition& geo_position,
53  api::GeoPosition* nearest_position,
54  double* distance) const override;
55 
56  V2 xy_of_p(const double p) const override;
57  V2 xy_dot_of_p(const double p) const override;
58  double heading_of_p(const double p) const override;
59  double heading_dot_of_p(const double p) const override;
60 
61  const double x0_{};
62  const double y0_{};
63  const double dx_{};
64  const double dy_{};
65  const double heading_{}; // Memoized; derived from dy_, dx_.
66 };
67 
68 } // namespace monolane
69 } // namespace maliput
70 } // namespace drake
A cubic polynomial, f(p) = a + b*p + c*p^2 + d*p^3.
Definition: lane.h:49
A position in 3-dimensional geographical Cartesian space, i.e., in the world frame, consisting of three components x, y, and z.
Definition: lane_data.h:128
const CubicPolynomial & superelevation() const
Definition: lane.h:203
Definition: automotive_demo.cc:88
Expression atan2(const Expression &e1, const Expression &e2)
Definition: symbolic_expression.cc:652
Vector2< double > V2
Definition: lane.h:20
Specialization of Lane with a line segment as its reference curve in the xy-plane (the ground plane) ...
Definition: line_lane.h:12
TypeSpecificIdentifier<T> represents an identifier specifically identifying an entity of type T...
Definition: type_specific_identifier.h:38
const CubicPolynomial & elevation() const
Definition: lane.h:201
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:86
const Segment * segment() const
Returns the Segment to which this Lane belongs.
Definition: lane.h:42
Bounds in the lateral dimension (r component) of a Lane-frame, consisting of a pair of minimum and ma...
Definition: lane_data.h:274
LineLane(const LineLane &)=delete
Base class for the monolane implementation of api::Lane.
Definition: lane.h:126
Bounds in the elevation dimension (h component) of a Lane-frame, consisting of a pair of minimum and ...
Definition: lane_data.h:309
A Segment represents a bundle of adjacent Lanes which share a continuously traversable road surface...
Definition: segment.h:27
A 3-dimensional position in a Lane-frame, consisting of three components:
Definition: lane_data.h:187
RBounds driveable_bounds(double s) const
Returns the driveable lateral (r) bounds of the lane as a function of s.
Definition: lane.h:80
RBounds lane_bounds(double s) const
Returns the nominal lateral (r) bounds for the lane as a function of s.
Definition: lane.h:73
#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
Provides careful macros to selectively enable or disable the special member functions for copy-constr...