Drake
directed_waypoint.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <utility>
4 #include <vector>
5 
6 #include "ignition/math/Vector3.hh"
7 #include "ignition/rndf/UniqueId.hh"
8 
10 
11 namespace drake {
12 namespace maliput {
13 namespace rndf {
14 
18  public:
20 
21 
22  DirectedWaypoint() = default;
27 
39  DirectedWaypoint(const ignition::rndf::UniqueId& id,
40  const ignition::math::Vector3d& position,
41  const ignition::math::Vector3d& tangent, bool is_entry,
42  bool is_exit)
43  : id_(id),
44  position_(position),
45  tangent_(tangent),
46  is_entry_(is_entry),
47  is_exit_(is_exit) {}
48 
49  const ignition::rndf::UniqueId& id() const { return id_; }
50 
51  void set_id(const ignition::rndf::UniqueId& id) { id_ = id; }
52 
53  const ignition::math::Vector3d& position() const { return position_; }
54 
55  void set_position(const ignition::math::Vector3d& position) {
56  position_ = position;
57  }
58 
59  const ignition::math::Vector3d& tangent() const { return tangent_; }
60 
61  void set_tangent(const ignition::math::Vector3d& tangent) {
62  tangent_ = tangent;
63  }
64 
65  bool is_entry() const { return is_entry_; }
66 
67  void set_is_entry(bool is_entry) { is_entry_ = is_entry; }
68 
69  bool is_exit() const { return is_exit_; }
70 
71  void set_is_exit(bool is_exit) { is_exit_ = is_exit; }
72 
83  static std::pair<ignition::math::Vector3d, ignition::math::Vector3d>
84  CalculateBoundingBox(const std::vector<DirectedWaypoint>& directed_waypoints);
85 
86  private:
87  // TODO(@agalbachicar) Uniqueness of the id_, when it is valid, should be
88  // verified and guaranteed.
89  // The ID.
90  ignition::rndf::UniqueId id_;
91  // A 3D vector which is the coordinate of the waypoint in the api::GeoPosition
92  // frame.
93  ignition::math::Vector3d position_;
94  // A 3D vector which is the tangent of the waypoint at position_.
95  ignition::math::Vector3d tangent_;
96  // Tells whether or not the original RNDF waypoint acts as an entry for the
97  // RNDF lane.
98  bool is_entry_{false};
99  // Tells whether or not the original RNDF waypoint acts as an exit for the
100  // RNDF lane.
101  bool is_exit_{false};
102 };
103 
104 } // namespace rndf
105 } // namespace maliput
106 } // namespace drake
DirectedWaypoint()=default
Default constructor.
DirectedWaypoint(const ignition::rndf::UniqueId &id, const ignition::math::Vector3d &position, const ignition::math::Vector3d &tangent, bool is_entry, bool is_exit)
Constructor.
Definition: directed_waypoint.h:39
void set_is_entry(bool is_entry)
Definition: directed_waypoint.h:67
Definition: automotive_demo.cc:88
static std::pair< ignition::math::Vector3d, ignition::math::Vector3d > CalculateBoundingBox(const std::vector< DirectedWaypoint > &directed_waypoints)
Gets the bounding box of a vector of directed_waypoints.
Definition: directed_waypoint.cc:11
void set_is_exit(bool is_exit)
Definition: directed_waypoint.h:71
bool is_exit() const
Definition: directed_waypoint.h:69
A container that holds the information needed by a Builder to construct a Lane from a sequence of ign...
Definition: directed_waypoint.h:17
void set_position(const ignition::math::Vector3d &position)
Definition: directed_waypoint.h:55
bool is_entry() const
Definition: directed_waypoint.h:65
#define DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(Classname)
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN defaults the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment.
Definition: drake_copyable.h:59
const ignition::math::Vector3d & position() const
Definition: directed_waypoint.h:53
void set_tangent(const ignition::math::Vector3d &tangent)
Definition: directed_waypoint.h:61
const ignition::math::Vector3d & tangent() const
Definition: directed_waypoint.h:59
const ignition::rndf::UniqueId & id() const
Definition: directed_waypoint.h:49
Provides careful macros to selectively enable or disable the special member functions for copy-constr...
void set_id(const ignition::rndf::UniqueId &id)
Definition: directed_waypoint.h:51