12 namespace trajectory {
22 std::vector<HebiTrajectoryPtr> trajectories_;
27 const size_t number_of_joints_;
32 const size_t number_of_waypoints_;
37 const double start_time_;
42 const double end_time_;
47 Trajectory(std::vector<HebiTrajectoryPtr> trajectories,
size_t number_of_waypoints,
double start_time,
69 static Eigen::VectorXd estimateSegmentTimes(
const Eigen::MatrixXd& positions,
70 const Eigen::VectorXd& max_velocities,
71 const Eigen::VectorXd& max_accelerations,
72 const HebiTimeEstimationParams& params,
73 double min_segment_time = 0.01);
104 static std::shared_ptr<Trajectory>
createUnconstrainedQp(
const Eigen::VectorXd& time_vector,
const Eigen::MatrixXd& positions,
105 const Eigen::MatrixXd* velocities =
nullptr,
106 const Eigen::MatrixXd* accelerations =
nullptr);
156 bool getState(
double time, Eigen::VectorXd* position, Eigen::VectorXd* velocity, Eigen::VectorXd* acceleration)
const;
171 bool getMinMaxPosition(Eigen::VectorXd& min_position, Eigen::VectorXd& max_position);
253 const Eigen::VectorXd& max_velocities,
254 const Eigen::VectorXd& max_accelerations,
255 double fabian_constant = 6.5,
256 double min_segment_time = 0.01) {
257 HebiTimeEstimationParams params;
258 params.method = HebiTimeEstimationMethod::HebiTimeEstimationNFabian;
259 params.params.n_fabian_params.magic_fabian_constant = fabian_constant;
260 return estimateSegmentTimes(positions, max_velocities, max_accelerations, params, min_segment_time);
285 const Eigen::VectorXd& max_velocities,
286 const Eigen::VectorXd& max_accelerations,
287 double min_segment_time = 0.01) {
288 HebiTimeEstimationParams params;
289 params.method = HebiTimeEstimationMethod::HebiTimeEstimationVelocityRamp;
290 return estimateSegmentTimes(positions, max_velocities, max_accelerations, params, min_segment_time);
static Eigen::VectorXd segmentTimesToWaypointTimes(const Eigen::VectorXd &segment_times)
Converts a vector of segment times to a vector of time values at each waypoint. The first element of ...
Definition: trajectory.cpp:131
double getDuration() const
The time (in seconds) between the start and end of this trajectory.
Definition: trajectory.cpp:87
static Eigen::VectorXd estimateSegmentTimesNFabian(const Eigen::MatrixXd &positions, const Eigen::VectorXd &max_velocities, const Eigen::VectorXd &max_accelerations, double fabian_constant=6.5, double min_segment_time=0.01)
Estimates the time required to move between waypoints using the N-Fabian method. It uses the both dis...
Definition: trajectory.hpp:252
bool getMinMaxPosition(Eigen::VectorXd &min_position, Eigen::VectorXd &max_position)
Returns the minimum and maximum positions reached by each joint over the entire trajectory....
Definition: trajectory.cpp:104
size_t getJointCount() const
The number of independent position trajectories over the same time domain that are managed by this ob...
Definition: trajectory.hpp:117
double getStartTime() const
Get the time (in seconds) at which the defined trajectory begins.
Definition: trajectory.hpp:127
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
bool getState(double time, Eigen::VectorXd *position, Eigen::VectorXd *velocity, Eigen::VectorXd *acceleration) const
Returns the position, velocity, and acceleration for a given point in time along the trajectory.
Definition: trajectory.cpp:92
static Eigen::VectorXd waypointTimesToSegmentTimes(const Eigen::VectorXd &waypoint_times)
Converts a vector of time values at each waypoint to a vector of segment times.
Definition: trajectory.cpp:147
size_t getWaypointCount() const
The number of fixed waypoints that each joint is moving through.
Definition: trajectory.hpp:122
bool getMaxAcceleration(Eigen::VectorXd &max_acceleration)
Returns the maximum absolute acceleration reached by each joint over the entire trajectory....
Definition: trajectory.cpp:122
bool getMaxVelocity(Eigen::VectorXd &max_velocity)
Returns the maximum absolute velocity reached by each joint over the entire trajectory....
Definition: trajectory.cpp:113
double getEndTime() const
Get the time (in seconds) at which the defined trajectory ends.
Definition: trajectory.hpp:132
static std::shared_ptr< Trajectory > createUnconstrainedQp(const Eigen::VectorXd &time_vector, const Eigen::MatrixXd &positions, const Eigen::MatrixXd *velocities=nullptr, const Eigen::MatrixXd *accelerations=nullptr)
Creates a smooth trajectory through a set of waypoints (position velocity and accelerations defined a...
Definition: trajectory.cpp:17
Represents a smooth trajectory through a set of waypoints.
Definition: trajectory.hpp:17
~Trajectory() noexcept
Destructor cleans up resources for trajectory.
Definition: trajectory.cpp:82
static Eigen::VectorXd estimateSegmentTimesTrapezoidal(const Eigen::MatrixXd &positions, const Eigen::VectorXd &max_velocities, const Eigen::VectorXd &max_accelerations, double min_segment_time=0.01)
Estimates the time required to move between waypoints based on the trapezoidal velocity profiles and ...
Definition: trajectory.hpp:284