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 multilane {
16 
21  public:
23 
24 
25  RoadGeometry(const api::RoadGeometryId& id,
26  const double linear_tolerance,
27  const double angular_tolerance)
28  : id_(id),
29  linear_tolerance_(linear_tolerance),
30  angular_tolerance_(angular_tolerance) {}
31 
34 
37 
38  ~RoadGeometry() override = default;
39 
40  private:
41  const api::RoadGeometryId do_id() const override { return id_; }
42 
43  int do_num_junctions() const override { return junctions_.size(); }
44 
45  const api::Junction* do_junction(int index) const override;
46 
47  int do_num_branch_points() const override { return branch_points_.size(); }
48 
49  const api::BranchPoint* do_branch_point(int index) const override;
50 
51  // Returns a RoadPosition for a lane containing the provided `geo_position`.
52  // If there is no containing lane, the position is returned for the lane
53  // closest to the centerline curve. If `hint` is non-null, then the search is
54  // restricted to the `hint->lane` and lanes adjacent to `hint->lane`.
55  api::RoadPosition DoToRoadPosition(
56  const api::GeoPosition& geo_position,
57  const api::RoadPosition* hint,
58  api::GeoPosition* nearest_position,
59  double* distance) const override;
60 
61  double do_linear_tolerance() const override { return linear_tolerance_; }
62 
63  double do_angular_tolerance() const override { return angular_tolerance_; }
64 
66  double linear_tolerance_{};
67  double angular_tolerance_{};
68  std::vector<std::unique_ptr<Junction>> junctions_;
69  std::vector<std::unique_ptr<BranchPoint>> branch_points_;
70 };
71 
72 } // namespace multilane
73 } // namespace maliput
74 } // 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
TypeSpecificIdentifier< class BranchPoint > BranchPointId
Definition: branch_point.h:18
An implementation of api::BranchPoint.
Definition: branch_point.h:41
Definition: arc_road_curve.cc:11
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
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
BranchPoint * NewBranchPoint(api::BranchPointId id)
Creates and adds a new BranchPoint with the specified id.
Definition: road_geometry.cc:49
Junction * NewJunction(api::JunctionId id)
Creates and adds a new Junction with the specified id.
Definition: road_geometry.cc:44
A simple api::RoadGeometry implementation that only supports a single lane per segment.
Definition: road_geometry.h:20
An api::Junction implementation.
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...