19 #ifndef JSONLOADER_PLAN_H_
20 #define JSONLOADER_PLAN_H_
26 #include <Eigen/Dense>
42 virtual bool IsSegment()
const noexcept = 0;
43 virtual bool IsStation()
const noexcept = 0;
54 virtual bool IsSegment() const noexcept {
return false; };
55 virtual bool IsStation() const noexcept {
return true; };
57 bool valid() const noexcept;
62 Eigen::Vector3f const&
position() const noexcept;
63 Eigen::Vector3f const&
orientation() const noexcept;
71 bool stop_on_arrival_;
74 Eigen::Vector3f position_;
75 Eigen::Vector3f orientation_;
83 explicit Time(
const uint32_t sec = 0,
const uint32_t nsec = 0);
84 explicit Time(
const double time);
86 void Add(
Time const& other);
88 void Set(
const double time);
89 void Set(
const uint32_t sec,
const uint32_t nsec);
91 uint32_t sec()
const noexcept;
92 uint32_t nsec()
const noexcept;
108 explicit Waypoint(
const std::size_t size = 0);
109 Waypoint(
const std::size_t size,
const double time);
112 Time& time() noexcept;
113 Time const& ctime()
const noexcept;
115 Eigen::VectorXf& waypoint() noexcept;
116 Eigen::VectorXf
const& cwaypoint()
const noexcept;
120 Eigen::VectorXf waypoint_;
130 virtual bool IsSegment() const noexcept {
return true; };
131 virtual bool IsStation() const noexcept {
return false; };
133 bool valid() const noexcept;
135 bool stop_at_end() const noexcept;
136 bool face_forward() const noexcept;
137 float speed() const noexcept;
139 std::
string const& waypoint_type() const noexcept;
140 WaypointSeq const& waypoints() const noexcept;
149 std::
string waypoint_type_;
150 WaypointSeq waypoints_;
158 bool valid()
const noexcept;
160 std::string
const&
name()
const noexcept;
161 float mass()
const noexcept;
162 std::array<float, 9>
const& matrix()
const noexcept;
169 std::array<float, 9> matrix_;
177 bool valid()
const noexcept;
179 std::string
const& flight_mode()
const noexcept;
180 std::string
const& profile_name()
const noexcept;
182 float collision_distance()
const noexcept;
183 float angular_accel()
const noexcept;
184 float angular_velocity()
const noexcept;
185 float linear_accel()
const noexcept;
186 float linear_velocity()
const noexcept;
191 std::string flight_mode_;
192 std::string profile_;
194 float collision_distance_;
195 float angular_accel_;
208 Plan & operator=(
Plan &&other) =
default;
210 std::size_t NumMilestones()
const noexcept;
211 Milestone const& GetMilestone(std::size_t index)
const;
213 bool valid()
const noexcept;
215 std::string
const&
name()
const noexcept;
216 float default_speed()
const noexcept;
217 float default_tolerance()
const noexcept;
220 std::vector<Station>
const& stations()
const noexcept;
221 std::vector<Segment>
const& segments()
const noexcept;
223 std::string
const& waypoint_type()
const noexcept;
230 float default_speed_;
231 float default_tolerance_;
233 std::string waypoint_type_;
238 std::vector<Station> stations_;
239 std::vector<Segment> segments_;
244 #endif // JSONLOADER_PLAN_H_