Drake
road_geometry.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <limits>
4 #include <memory>
5 #include <vector>
6 
14 
15 namespace drake {
16 namespace maliput {
17 namespace dragway {
18 
23 class RoadGeometry final : public api::RoadGeometry {
24  public:
26 
27 
51  int num_lanes,
52  double length,
53  double lane_width,
54  double shoulder_width,
55  double maximum_height,
56  double linear_tolerance,
57  double angular_tolerance);
58 
59  ~RoadGeometry() final = default;
60 
61  private:
62  const api::RoadGeometryId do_id() const final { return id_; }
63 
64  int do_num_junctions() const final { return 1; }
65 
66  const api::Junction* do_junction(int index) const final;
67 
68  int do_num_branch_points() const final;
69 
70  const api::BranchPoint* do_branch_point(int index) const final;
71 
72  api::RoadPosition DoToRoadPosition(
73  const api::GeoPosition& geo_position,
74  const api::RoadPosition* hint,
75  api::GeoPosition* nearest_position,
76  double* distance) const final;
77 
78  double do_linear_tolerance() const final { return linear_tolerance_; }
79 
80  double do_angular_tolerance() const final { return angular_tolerance_; }
81 
82  // Returns true iff `geo_pos` is "on" the dragway. It is on the dragway iff
83  // `geo_pos.x` and `geo_pos.y` fall within the dragway's driveable region.
84  bool IsGeoPositionOnDragway(const api::GeoPosition& geo_pos) const;
85 
86  // Returns the index of the lane on which the provided `geo_pos` resides. This
87  // method requires that the provided `geo_pos` be on the dragway as determined
88  // by IsGeoPositionOnDragway().
89  int GetLaneIndex(const api::GeoPosition& geo_pos) const;
90 
91  const api::RoadGeometryId id_;
92  const double linear_tolerance_{};
93  const double angular_tolerance_{};
94  const Junction junction_;
95 };
96 
97 } // namespace dragway
98 } // namespace maliput
99 } // 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
Definition: automotive_demo.cc:88
Abstract API for the geometry of a road network, including both the network topology and the geometry...
Definition: road_geometry.h:26
double linear_tolerance() const
Returns the tolerance guaranteed for linear measurements (positions).
Definition: road_geometry.h:110
double angular_tolerance() const
Returns the tolerance guaranteed for angular measurements (orientations).
Definition: road_geometry.h:115
TypeSpecificIdentifier< class RoadGeometry > RoadGeometryId
Persistent identifier for a RoadGeometry element.
Definition: road_geometry.h:19
Dragway&#39;s implementation of api::Junction.
Definition: junction.h:20
Dragway&#39;s implementation of api::RoadGeometry.
Definition: road_geometry.h:23
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
#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
A position in the road network, consisting of a pointer to a specific Lane and a Lane-frame position ...
Definition: lane_data.h:258
Provides careful macros to selectively enable or disable the special member functions for copy-constr...