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