1 #ifndef POLY_TRAJECTORY_H
2 #define POLY_TRAJECTORY_H
4 #include <mav_trajectory_generation/motion_defines.h>
5 #include <mav_trajectory_generation/trajectory.h>
32 std::shared_ptr<Trajectory6DOFLimits> vehicle_limits,
33 const std::string& world_frame_id =
"world_ned",
bool needs_angle_unwrapping =
true);
92 mav_trajectory_generation::Trajectory trajectory_;
93 std::vector<VectorXd> waypoints_;
95 bool needs_angle_unwrapping_;
104 double calculate_progress(
double t)
const;
111 static void unwrap_angles(std::vector<VectorXd>& waypoints);
121 std::vector<VectorXd> create_waypoints(
const State& origin,
const std::vector<Pose>& targets)
const;
131 std::optional<mav_trajectory_generation::Trajectory> plan_trajectory(
const std::vector<VectorXd>& waypoints,
132 const State& start_state)
const;
Polynomial-optimised trajectory through a sequence of 6DOF waypoints.
Definition: PolyTrajectory.h:20
State get_model_world(double t) const override
Evaluates the planned polynomial trajectory at the given time.
Definition: PolyTrajectory.cpp:53
static constexpr double DEFAULT_MIN_SEGMENT_TIME
Minimum segment duration used when inserting constant-position segments (s)
Definition: PolyTrajectory.h:75
bool is_valid() const
Returns true if trajectory planning succeeded.
Definition: PolyTrajectory.cpp:27
double get_progress(double t) const override
Returns trajectory progress as a fractional segment index.
Definition: PolyTrajectory.cpp:38
PolyTrajectory(const State &origin, const std::vector< Pose > &targets, std::shared_ptr< Trajectory6DOFLimits > vehicle_limits, const std::string &world_frame_id="world_ned", bool needs_angle_unwrapping=true)
Constructs and plans the trajectory from an origin state to a list of target poses.
Definition: PolyTrajectory.cpp:11
bool is_finished(double t) const override
Returns true if the elapsed time has reached or exceeded the trajectory duration.
Definition: PolyTrajectory.cpp:31
int get_total_num_waypoints() const
Returns the number of inter-waypoint segments in the trajectory.
Definition: PolyTrajectory.cpp:49
static constexpr int DEFAULT_DERIVATIVE_TO_OPTIMIZE
Derivative order minimised by the polynomial optimiser (acceleration)
Definition: PolyTrajectory.h:78
double get_expected_total_time() const override
Returns the total planned trajectory duration.
Definition: PolyTrajectory.cpp:45
Abstract base class for all trajectory representations.
Definition: TrajectoryBase.h:18
Full kinematic state of the vehicle.
Definition: Types.h:63