Drake
road_geometry.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 rndf {
16 
25  public:
27 
28 
36  double angular_tolerance)
37  : id_(id),
38  linear_tolerance_(linear_tolerance),
39  angular_tolerance_(angular_tolerance) {}
40 
45 
50 
51  ~RoadGeometry() override = default;
52 
53  private:
54  const api::RoadGeometryId do_id() const override { return id_; }
55 
56  int do_num_junctions() const override { return junctions_.size(); }
57 
58  // This function will throw an exception if index is not bounded between 0
59  // and the current maximum available index of junctions_ vector.
60  const api::Junction* do_junction(int index) const override;
61 
62  int do_num_branch_points() const override { return branch_points_.size(); }
63 
64  // This function will throw an exception if index is not bounded between 0
65  // and the current maximum available index of branch_points_ vector.
66  const api::BranchPoint* do_branch_point(int index) const override;
67 
68  // This function will abort as it's not implemented and should not be called.
69  api::RoadPosition DoToRoadPosition(const api::GeoPosition& geo_pos,
70  const api::RoadPosition* hint,
71  api::GeoPosition* nearest_position,
72  double* distance) const override;
73 
74  double do_linear_tolerance() const override { return linear_tolerance_; }
75 
76  double do_angular_tolerance() const override { return angular_tolerance_; }
77 
79  double linear_tolerance_{};
80  double angular_tolerance_{};
81  std::vector<std::unique_ptr<Junction>> junctions_;
82  std::vector<std::unique_ptr<BranchPoint>> branch_points_;
83 };
84 
85 } // namespace rndf
86 } // namespace maliput
87 } // 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
An api::RoadGeometry implementation for RNDF specification.
Definition: road_geometry.h:24
Definition: automotive_demo.cc:88
Junction * NewJunction(api::JunctionId id)
Creates and adds a new Junction with the specified id.
Definition: road_geometry.cc:10
Abstract API for the geometry of a road network, including both the network topology and the geometry...
Definition: road_geometry.h:26
TypeSpecificIdentifier< class BranchPoint > BranchPointId
Definition: branch_point.h:18
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 Junction > JunctionId
Persistent identifier for a Junction element.
Definition: junction.h:17
TypeSpecificIdentifier< class RoadGeometry > RoadGeometryId
Persistent identifier for a RoadGeometry element.
Definition: road_geometry.h:19
An implementation of api::BranchPoint for RNDF.
Definition: branch_point.h:39
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 for RNDF.
Definition: junction.h:18
#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...
BranchPoint * NewBranchPoint(api::BranchPointId id)
Creates and adds a new BranchPoint with the specified id.
Definition: road_geometry.cc:15