Drake
lane.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
7 
8 namespace drake {
9 namespace maliput {
10 namespace dragway {
11 
12 // Forward declarations.
13 class BranchPoint;
14 class Segment;
15 
73 class Lane final : public api::Lane {
74  public:
76 
77 
78  Lane(const Segment* segment, const api::LaneId& id, int index, double length,
102  double y_offset, const api::RBounds& lane_bounds,
105 
106  ~Lane() final = default;
107 
112 
113  void set_lane_to_left(api::Lane* lane_to_left);
114  void set_lane_to_right(api::Lane* lane_to_right);
115 
117 
119  double y_offset() const { return y_offset_; }
120 
121  private:
122  const api::LaneId do_id() const final { return id_; }
123 
124  const api::Segment* do_segment() const final;
125 
126  int do_index() const final { return index_; }
127 
128  const api::Lane* do_to_left() const final { return lane_to_left_; }
129 
130  const api::Lane* do_to_right() const final { return lane_to_right_; }
131 
132  const api::BranchPoint* DoGetBranchPoint(
133  const api::LaneEnd::Which which_end) const final;
134 
135  const api::LaneEndSet* DoGetConfluentBranches(
136  const api::LaneEnd::Which which_end) const final;
137 
138  const api::LaneEndSet* DoGetOngoingBranches(
139  const api::LaneEnd::Which which_end) const final;
140 
141  std::unique_ptr<api::LaneEnd> DoGetDefaultBranch(
142  const api::LaneEnd::Which which_end) const final;
143 
144  double do_length() const final { return length_; }
145 
146  api::RBounds do_lane_bounds(double) const final;
147 
148  api::RBounds do_driveable_bounds(double) const final;
149 
150  api::HBounds do_elevation_bounds(double, double) const final;
151 
152  api::LanePosition DoEvalMotionDerivatives(
154  const api::IsoLaneVelocity& velocity) const final;
155 
156  api::GeoPosition DoToGeoPosition(const api::LanePosition& lane_pos) const
157  final;
158 
159  api::Rotation DoGetOrientation(const api::LanePosition& lane_pos) const
160  final;
161 
162  api::LanePosition DoToLanePosition(const api::GeoPosition& geo_pos,
163  api::GeoPosition* nearest_point,
164  double* distance) const final;
165 
166  const Segment* segment_{}; // The segment to which this lane belongs.
167  const api::LaneId id_;
168  const int index_{}; // The index of this lane within a Segment.
169  const double length_{};
170  const double y_offset_{};
171  const api::RBounds lane_bounds_;
172  const api::RBounds driveable_bounds_;
173  const api::HBounds elevation_bounds_;
174 
175  // The following variable is actually `const` after construction.
176  std::unique_ptr<api::BranchPoint> branch_point_;
177 
178  const api::Lane* lane_to_left_{};
179  const api::Lane* lane_to_right_{};
180 };
181 
182 
183 } // namespace dragway
184 } // namespace maliput
185 } // namespace drake
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
A BranchPoint is a node in the network of a RoadGeometry at which Lanes connect to one another...
Definition: branch_point.h:66
double position
Definition: system_identification_test.cc:205
Definition: automotive_demo.cc:88
Dragway&#39;s implementation of api::Lane.
Definition: lane.h:73
void set_lane_to_right(api::Lane *lane_to_right)
Definition: lane.cc:49
A set of LaneEnds.
Definition: branch_point.h:22
A Lane represents a lane of travel in a road network.
Definition: lane.h:32
Isometric velocity vector in a Lane-frame.
Definition: lane_data.h:242
int index() const
Returns the index of this Lane within the Segment which owns it.
Definition: lane.h:45
TypeSpecificIdentifier<T> represents an identifier specifically identifying an entity of type T...
Definition: type_specific_identifier.h:38
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
A 3-dimensional rotation.
Definition: lane_data.h:53
double y_offset() const
Returns the y-offset of this lane&#39;s frame relative to the world frame.
Definition: lane.h:119
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
Which
Labels for the endpoints of a Lane.
Definition: lane_data.h:25
A 3-dimensional position in a Lane-frame, consisting of three components:
Definition: lane_data.h:187
double length() const
Returns the arc-length of the Lane along its reference curve.
Definition: lane.h:67
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
Vector6< double > velocity
Definition: pose_smoother.cc:29
Dragway&#39;s implementation of api::Segment.
Definition: segment.h:55
void set_lane_to_left(api::Lane *lane_to_left)
Definition: lane.cc:45