HEBI C++ API  3.4.0
trajectory.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "hebi.h"
4 
5 #include <memory>
6 #include <vector>
7 
8 #include "Eigen/Eigen"
9 #include "util.hpp"
10 
11 using namespace Eigen;
12 
13 namespace hebi {
14 namespace trajectory {
15 
19 class Trajectory final {
20 private:
24  std::vector<HebiTrajectoryPtr> trajectories_;
25 
29  const size_t number_of_joints_;
30 
34  const size_t number_of_waypoints_;
35 
39  const double start_time_;
40 
44  const double end_time_;
45 
49  Trajectory(std::vector<HebiTrajectoryPtr> trajectories, size_t number_of_waypoints, double start_time,
50  double end_time);
51 
52 public:
81  static std::shared_ptr<Trajectory> createUnconstrainedQp(const VectorXd& time_vector, const MatrixXd& positions,
82  const MatrixXd* velocities = nullptr,
83  const MatrixXd* accelerations = nullptr);
84 
88  ~Trajectory() noexcept;
89 
94  size_t getJointCount() const { return number_of_joints_; }
95 
99  size_t getWaypointCount() const { return number_of_waypoints_; }
100 
104  double getStartTime() const { return start_time_; }
105 
109  double getEndTime() const { return end_time_; }
110 
115  double getDuration() const;
116 
130  bool getState(double time, VectorXd* position, VectorXd* velocity, VectorXd* acceleration) const;
131 
132 private:
137 };
138 
139 } // namespace trajectory
140 } // namespace hebi
Definition: arm.cpp:5
size_t getJointCount() const
The number of independent position trajectories over the same time domain that are managed by this ob...
Definition: trajectory.hpp:94
double getStartTime() const
Get the time (in seconds) at which the defined trajectory begins.
Definition: trajectory.hpp:104
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
size_t getWaypointCount() const
The number of fixed waypoints that each joint is moving through.
Definition: trajectory.hpp:99
double getEndTime() const
Get the time (in seconds) at which the defined trajectory ends.
Definition: trajectory.hpp:109
Represents a smooth trajectory through a set of waypoints.
Definition: trajectory.hpp:19