33 uint16_t step_time = uint16_t(floor(move_time / control_time) + 1.0);
34 move_time = double(step_time - 1) * control_time;
36 Eigen::Matrix3d A = Eigen::Matrix3d::Identity(3, 3);
37 Eigen::Vector3d x = Eigen::Vector3d::Zero();
38 Eigen::Vector3d b = Eigen::Vector3d::Zero();
40 A << pow(move_time, 3), pow(move_time, 4), pow(move_time, 5),
41 3 * pow(move_time, 2), 4 * pow(move_time, 3), 5 * pow(move_time, 4),
42 6 * pow(move_time, 1), 12 * pow(move_time, 2), 20 * pow(move_time, 3);
52 Eigen::ColPivHouseholderQR<Eigen::Matrix3d> dec(A);
73 std::vector<WayPoint> start,
74 std::vector<WayPoint> goal)
76 for (uint8_t index = 0; index < start.size(); index++)
78 trajectory_generator_.calcCoefficient(start.at(index),
83 coefficient_.col(index) = trajectory_generator_.getCoefficient();
89 joint_num_ = joint_num;
95 joint_way_point_.clear();
96 for (uint8_t index = 0; index < joint_num_; index++)
99 single_joint_way_point.
position = 0.0;
100 single_joint_way_point.
velocity = 0.0;
121 joint_way_point_.push_back(single_joint_way_point);
124 return joint_way_point_;
Eigen::VectorXd coefficient_
void setJointNum(uint8_t joint_num)
std::vector< WayPoint > getJointWayPoint(double tick)
void init(double move_time, double control_time, std::vector< WayPoint > start, std::vector< WayPoint > goal)
void calcCoefficient(WayPoint start, WayPoint goal, double move_time, double control_time)
Eigen::VectorXd getCoefficient()
virtual ~JointTrajectory()
Eigen::MatrixXd getCoefficient()