Drake
monolane_onramp_merge.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cmath>
4 #include <memory>
5 
8 
9 namespace drake {
10 namespace automotive {
11 
12 /// RoadCharacteristics computes and stores characteristics of a road network;
13 /// i.e. bounds on the lane width and driveable width. Default settings are
14 /// taken if no others are specified.
16  /// Constructor for using default road geometries.
17  RoadCharacteristics() = default;
18 
19  /// Constructor for custom road geometries.
20  RoadCharacteristics(const double lw, const double dw)
21  : lane_width(lw), driveable_width(dw) {}
22 
23  const double lane_width{4.};
24  const double driveable_width{8.};
25 
28  driveable_width / 2.};
30 };
31 
32 /// MonolaneOnrampMerge contains an example lane-merge scenario expressed as a
33 /// maliput monolane road geometry. The intent of this class is to enable easy
34 /// creation and modification of road geometries for simulating/analyzing
35 /// such scenarios.
36 ///
37 /// Implements the following onramp example, where each road section is composed
38 /// of sequences of linear and arc primitives:
39 ///
40 /// <pre>
41 /// pre-merge post-merge
42 /// road road
43 /// |------>-------+------>-------|
44 /// /
45 /// /
46 /// onramp /
47 /// ^
48 /// |
49 /// |
50 /// _
51 /// </pre>
53  public:
55 
56  /// Constructor for the example. The user supplies @p rc, a
57  /// RoadCharacteristics structure that aggregates the road boundary data.
58  explicit MonolaneOnrampMerge(const RoadCharacteristics& rc) : rc_(rc) {}
59 
60  /// Constructor for the example, using default RoadCharacteristics settings.
62 
63  /// Implements the onramp example.
64  std::unique_ptr<const maliput::api::RoadGeometry> BuildOnramp();
65 
66  private:
67  /// Tolerances for monolane's Builder.
68  const double linear_tolerance_ = 0.01;
69  const double angular_tolerance_ = 0.01 * M_PI;
70 
71  const RoadCharacteristics rc_;
72 };
73 
74 } // namespace automotive
75 } // namespace drake
Definition: automotive_demo.cc:88
const maliput::api::HBounds elevation_bounds
Definition: monolane_onramp_merge.h:29
MonolaneOnrampMerge contains an example lane-merge scenario expressed as a maliput monolane road geom...
Definition: monolane_onramp_merge.h:52
RoadCharacteristics(const double lw, const double dw)
Constructor for custom road geometries.
Definition: monolane_onramp_merge.h:20
RoadCharacteristics computes and stores characteristics of a road network; i.e.
Definition: monolane_onramp_merge.h:15
const maliput::api::RBounds driveable_bounds
Definition: monolane_onramp_merge.h:27
const double lane_width
Definition: monolane_onramp_merge.h:23
Bounds in the lateral dimension (r component) of a Lane-frame, consisting of a pair of minimum and ma...
Definition: lane_data.h:298
Bounds in the elevation dimension (h component) of a Lane-frame, consisting of a pair of minimum and ...
Definition: lane_data.h:343
RoadCharacteristics()=default
Constructor for using default road geometries.
const maliput::api::RBounds lane_bounds
Definition: monolane_onramp_merge.h:26
MonolaneOnrampMerge()
Constructor for the example, using default RoadCharacteristics settings.
Definition: monolane_onramp_merge.h:61
#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
const double driveable_width
Definition: monolane_onramp_merge.h:24