8 const std::vector<double>& stop,
double dtheta)
12 for (std::size_t i = 0; i < start.size(); ++i)
14 unsigned this_joint_steps =
static_cast<unsigned>(std::ceil(std::abs(start[i] - stop[i]) / dtheta));
15 steps = std::max(steps, this_joint_steps);
22 const std::vector<double>& stop,
unsigned int steps)
25 std::vector<double> result;
26 result.reserve(start.size());
28 for (std::size_t i = 0; i < start.size(); ++i)
30 result.push_back((stop[i] - start[i]) / steps);
37 const std::vector<double>& step_size,
40 std::vector<double> result;
41 result.reserve(start.size());
42 for (std::size_t i = 0; i < start.size(); ++i)
43 result.push_back(start[i] + step_size[i] * step);
49 const Eigen::Affine3d& stop,
double ds)
52 Eigen::Vector3d delta = (stop.translation() - start.translation());
53 Eigen::Vector3d start_pos = start.translation();
56 unsigned steps =
static_cast<unsigned>(delta.norm() / ds) + 1;
59 Eigen::Vector3d
step = delta / steps;
62 Eigen::Quaterniond start_q(start.rotation());
63 Eigen::Quaterniond stop_q(stop.rotation());
64 double slerp_ratio = 1.0 / steps;
67 result.reserve(steps);
68 for (
unsigned i = 0; i <= steps; ++i)
70 Eigen::Vector3d trans = start_pos + step * i;
71 Eigen::Quaterniond
q = start_q.slerp(slerp_ratio * i, stop_q);
72 Eigen::Affine3d pose(Eigen::Translation3d(trans) * q);
73 result.push_back(pose);
80 const std::vector<double>& stop,
double dtheta)
87 for (std::size_t i = 0; i <= steps; ++i)
90 result.push_back(pos);
JointVector interpolateJoint(const std::vector< double > &start, const std::vector< double > &stop, double dtheta)
std::vector< std::vector< double > > JointVector
static std::vector< double > interpolateJointSteps(const std::vector< double > &start, const std::vector< double > &step_size, unsigned step)
static std::vector< double > calculateJointSteps(const std::vector< double > &start, const std::vector< double > &stop, unsigned int steps)
static unsigned int calculateRequiredSteps(const std::vector< double > &start, const std::vector< double > &stop, double dtheta)
PoseVector interpolateCartesian(const Eigen::Affine3d &start, const Eigen::Affine3d &stop, double ds)
std::vector< Eigen::Affine3d, Eigen::aligned_allocator< Eigen::Affine3d > > PoseVector