Drake
junction.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
12 
13 namespace drake {
14 namespace maliput {
15 namespace multilane {
16 
18 class Junction : public api::Junction {
19  public:
21 
22 
28  : id_(id), road_geometry_(road_geometry) {}
29 
35  std::unique_ptr<RoadCurve> road_curve);
36 
37  ~Junction() override = default;
38 
39  private:
40  const api::JunctionId do_id() const override { return id_; }
41 
42  const api::RoadGeometry* do_road_geometry() const override;
43 
44  int do_num_segments() const override { return segments_.size(); }
45 
46  const api::Segment* do_segment(int index) const override {
47  return segments_[index].get();
48  }
49 
50  api::JunctionId id_;
51  api::RoadGeometry* road_geometry_{};
52  std::vector<std::unique_ptr<Segment>> segments_;
53 };
54 
55 } // namespace multilane
56 } // namespace maliput
57 } // namespace drake
Definition: automotive_demo.cc:88
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
Segment * NewSegment(api::SegmentId id, std::unique_ptr< RoadCurve > road_curve)
Creates and adds a new Segment with the specified id and road_curve.
Definition: junction.cc:14
Definition: arc_road_curve.cc:11
An api::Segment implementation.
Definition: segment.h:23
TypeSpecificIdentifier< class Junction > JunctionId
Persistent identifier for a Junction element.
Definition: junction.h:17
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
An api::Junction implementation.
Definition: junction.h:18
TypeSpecificIdentifier< class Segment > SegmentId
Persistent identifier for a Segment element.
Definition: segment.h:17
#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...