Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00037 #ifndef CUBIC_PARAMETERIZED_TRAJECTORY_H_
00038 #define CUBIC_PARAMETERIZED_TRAJECTORY_H_
00039
00040 #include <spline_smoother/spline_smoother_utils.h>
00041 #include <spline_smoother/cubic_trajectory.h>
00042
00043 namespace spline_smoother
00044 {
00048 class CubicParameterizedTrajectory
00049 {
00050 public:
00051
00052 CubicParameterizedTrajectory();
00053
00054 bool parameterize(const trajectory_msgs::JointTrajectory& trajectory_in,
00055 const std::vector<arm_navigation_msgs::JointLimits> &limits,
00056 spline_smoother::SplineTrajectory& spline);
00057
00058 private:
00059
00060 double getDistance(const trajectory_msgs::JointTrajectoryPoint &start,
00061 const trajectory_msgs::JointTrajectoryPoint &end,
00062 const std::vector<arm_navigation_msgs::JointLimits> &limits);
00063
00064 double getVelocityLimit(const trajectory_msgs::JointTrajectoryPoint &start,
00065 const trajectory_msgs::JointTrajectoryPoint &end,
00066 const std::vector<arm_navigation_msgs::JointLimits> &limits);
00067
00068 double getAccelerationLimit(const trajectory_msgs::JointTrajectoryPoint &start,
00069 const trajectory_msgs::JointTrajectoryPoint &end,
00070 const std::vector<arm_navigation_msgs::JointLimits> &limits);
00071
00072 bool hasAccelerationLimits(const std::vector<arm_navigation_msgs::JointLimits> &limits);
00073
00074 void getLimit(const trajectory_msgs::JointTrajectoryPoint &start,
00075 const trajectory_msgs::JointTrajectoryPoint &end,
00076 const std::vector<arm_navigation_msgs::JointLimits> &limits,
00077 arm_navigation_msgs::JointLimits &limit_out);
00078
00079 double jointDiff(const double &start,
00080 const double &end,
00081 const arm_navigation_msgs::JointLimits &limit);
00082
00083 void solveCubicSpline(const double &q0,
00084 const double &q1,
00085 const double &v0,
00086 const double &v1,
00087 const double &dt,
00088 std::vector<double> &coefficients);
00089
00090 static const double EPS_TRAJECTORY = 1.0e-8;
00091
00092 bool apply_limits_;
00093 };
00094 }
00095
00096 #endif