Drake
segment.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <tuple>
5 #include <vector>
6 
7 #include "ignition/math/Vector3.hh"
8 
15 
16 namespace drake {
17 namespace maliput {
18 namespace rndf {
19 
20 class SplineLane;
21 
23 class Segment : public api::Segment {
24  public:
26 
27 
32  : id_(id), junction_(junction) {}
33 
46  const api::LaneId& id,
47  const std::vector<std::tuple<ignition::math::Vector3d,
48  ignition::math::Vector3d>>& control_points,
49  double width);
50 
51  ~Segment() override = default;
52 
53  private:
54  const api::SegmentId do_id() const override { return id_; }
55 
56  const api::Junction* do_junction() const override { return junction_; }
57 
58  int do_num_lanes() const override { return lanes_.size(); }
59 
60  // Throws an exception if the index is not in between 0 and the size of
61  // lanes_ minus one.
62  const api::Lane* do_lane(int index) const override;
63 
64  api::SegmentId id_;
65  api::Junction* junction_{};
66  std::vector<std::unique_ptr<Lane>> lanes_;
67 };
68 
69 } // namespace rndf
70 } // namespace maliput
71 } // namespace drake
Specialization of drake::maliput::rndf::Lane with a spline curve as its reference path...
Definition: spline_lane.h:25
Definition: automotive_demo.cc:88
An api::Segment implementation for RNDF.
Definition: segment.h:23
std::vector< double > vector
Definition: translator_test.cc:20
A Lane represents a lane of travel in a road network.
Definition: lane.h:32
TypeSpecificIdentifier<T> represents an identifier specifically identifying an entity of type T...
Definition: type_specific_identifier.h:38
const Junction * junction() const
Returns the Junction to which this Segment belongs.
Definition: segment.h:37
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
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
SplineLane * NewSplineLane(const api::LaneId &id, const std::vector< std::tuple< ignition::math::Vector3d, ignition::math::Vector3d >> &control_points, double width)
Gives the segment a newly constructed SplineLane.
Definition: segment.cc:11
~Segment() override=default
Provides careful macros to selectively enable or disable the special member functions for copy-constr...