43 #include <boost/thread/condition.hpp> 70 TPoint(
const std::vector<double>& q,
double time);
72 std::vector<double>
q_;
87 dimension_ = dimension;
88 q_.resize(dimension_);
89 qdot_.resize(dimension_);
102 inline double get_coefficient(
int degree,
int dim_index);
112 std::vector<std::vector<double> >
coeff_;
149 int setTrajectory(
const std::vector<double> &p,
const std::vector<double> &time,
int numPoints);
157 int setTrajectory(
const std::vector<double> &p,
int numPoints);
159 int setTrajectory(
const std::vector<double> &p,
const std::vector<double> &pdot,
const std::vector<double> &time,
int numPoints);
161 int setMaxAcc(std::vector<double> max_acc);
218 int write(std::string filename,
double dT);
229 void getTrajectory(std::vector<trajectory::Trajectory::TPoint> &traj,
double dT);
243 void init(
int num_points,
int dimension);
360 double blendTime(
double aa,
double bb,
double cc);
362 double jointDiff(
double from,
double to,
int index);
void clear()
clear the trajectory
double calculateMinimumTimeLSPB(const TPoint &start, const TPoint &end)
calculate minimum time for a trajectory segment using LSPB.
int parameterizeBlendedLinear()
calculate the coefficients for interpolation between trajectory points using blended linear interpola...
std::vector< bool > joint_wraps_
std::vector< double > max_rate_
double calculateMinTimeLSPB(double q0, double q1, double vmax, double amax, int index)
int minimizeSegmentTimes()
Minimize segment times in the trajectory Timings for the trajectory segments are automatically calcul...
int parameterize()
calculate the coefficients for interpolation between trajectory points If autocalc_timing_ is true...
void sampleCubic(TPoint &tp, double time, const TCoeff &tc, double segment_start_time)
Sample the trajectory based on a cubic interpolation.
double getTotalTime()
Get the total time for the trajectory.
void sampleBlendedLinear(TPoint &tp, double time, const TCoeff &tc, double segment_start_time)
Sample the trajectory based on a cubic interpolation.
double calculateMinimumTimeLinear(const TPoint &start, const TPoint &end)
calculate minimum time for a trajectory segment using a linear interpolation
int parameterizeCubic()
calculate the coefficients for interpolation between trajectory points using cubic interpolation...
int minimizeSegmentTimesWithCubicInterpolation()
calculate a minimum time trajectory using cubic interpolation Timings for the trajectory are automati...
int getDuration(std::vector< double > &duration)
int parameterizeLinear()
calculate the coefficients for interpolation between trajectory points using linear interpolation If ...
double calculateMinimumTimeCubic(const TPoint &start, const TPoint &end)
int write(std::string filename, double dT)
void sampleLinear(TPoint &tp, double time, const TCoeff &tc, double segment_start_time)
Sample the trajectory based on a linear interpolation.
void addPoint(const TPoint)
Add a point to the trajectory.
double blendTime(double aa, double bb, double cc)
std::vector< std::vector< double > > coeff_
void init(int num_points, int dimension)
std::vector< TCoeff > tc_
int minimizeSegmentTimesWithLinearInterpolation()
calculate a minimum time trajectory using linear interpolation Timings for the trajectory are automat...
virtual ~Trajectory()
Destructor.
double calculateMinTimeCubic(double q0, double q1, double v0, double v1, double vmax, int index)
void setDimension(int dimension)
Set the dimension of a trajectory point. This resizes the internal vectors to the right sizes...
int getNumberPoints()
Get the number of points in the trajectory.
void setJointWraps(int index)
double jointDiff(double from, double to, int index)
std::vector< double > max_limit_
std::vector< double > min_limit_
int getTimeStamps(std::vector< double > ×tamps)
std::vector< double > max_acc_
const TPoint & lastPoint()
int sample(TPoint &tp, double time)
Sample the trajectory at a certain point in time.
int findTrajectorySegment(double time)
finds the trajectory segment corresponding to a particular time
std::string interp_method_
void getTrajectory(std::vector< trajectory::Trajectory::TPoint > &traj, double dT)
std::vector< double > qdot_
std::vector< TPoint > tp_
int setMaxAcc(std::vector< double > max_acc)
void setInterpolationMethod(std::string interp_method)
Set the interpolation method.
int minimizeSegmentTimesWithBlendedLinearInterpolation()
calculate a minimum time trajectory using blended linear interpolation Timings for the trajectory are...
int setMaxRates(std::vector< double > max_rate)
set the max rates (velocities)
int setTrajectory(const std::vector< TPoint > &tp)
Set the trajectory using a vector of trajectory points.