Go to the documentation of this file.
1 #pragma once
3 #include <memory>
4 #include <vector>
13 namespace drake {
14 namespace maliput {
15 namespace dragway {
17 class RoadGeometry;
19 /// Dragway's implementation of api::Junction.
20 class Junction final : public api::Junction {
21  public:
24  /// Constructs a Junction with a single Segment.
25  ///
26  /// @p road_geometry must remain valid for the lifetime of this class,
27  /// and must refer to the RoadGeometry which will contain this newly
28  /// constructed Junction instance.
30  int num_lanes,
31  double length,
32  double lane_width,
33  double shoulder_width,
34  double maximum_height);
36  ~Junction() final = default;
38  private:
39  const api::JunctionId do_id() const final { return id_; }
41  const api::RoadGeometry* do_road_geometry() const final;
43  int do_num_segments() const final { return 1; }
45  const api::Segment* do_segment(int index) const final {
46  DRAKE_DEMAND(index < num_segments());
47  return &segment_;
48  }
50  const api::JunctionId id_;
51  const RoadGeometry* const road_geometry_{};
52  const Segment segment_;
53 };
55 } // namespace dragway
56 } // namespace maliput
57 } // namespace drake
Definition: automotive_demo.cc:90
const RoadGeometry * road_geometry() const
Returns the RoadGeometry to which this Junction belongs.
Definition: junction.h:37
Abstract API for the geometry of a road network, including both the network topology and the geometry...
Definition: road_geometry.h:26
int num_lanes
Definition: multilane_connection_test.cc:365
#define DRAKE_DEMAND(condition)
Evaluates condition and iff the value is false will trigger an assertion failure with a message showi...
Definition: drake_assert.h:45
TypeSpecificIdentifier< class Junction > JunctionId
Persistent identifier for a Junction element.
Definition: junction.h:17
Dragway&#39;s implementation of api::Junction.
Definition: junction.h:20
Dragway&#39;s implementation of api::RoadGeometry.
Definition: road_geometry.h:23
A Segment represents a bundle of adjacent Lanes which share a continuously traversable road surface...
Definition: segment.h:27
A Junction is a closed set of Segments which have physically coplanar road surfaces, in the sense that RoadPositions with the same h value (height above surface) in the domains of two Segments map to the same GeoPosition.
Definition: junction.h:27
int num_segments() const
Returns the number of Segments in the Junction.
Definition: junction.h:42
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
Dragway&#39;s implementation of api::Segment.
Definition: segment.h:55
Provides careful macros to selectively enable or disable the special member functions for copy-constr...