65bool PR2ArmIK::init(
const urdf::ModelInterface& robot_model,
const std::string& root_name,
const std::string& tip_name)
67 std::vector<urdf::Pose> link_offset;
69 urdf::LinkConstSharedPtr link = robot_model.getLink(tip_name);
70 while (link && num_joints < 7)
72 urdf::JointConstSharedPtr joint;
73 if (link->parent_joint)
74 joint = robot_model.getJoint(link->parent_joint->name);
77 if (link->parent_joint)
79 RCLCPP_ERROR(
getLogger(),
"Could not find joint: %s", link->parent_joint->name.c_str());
83 RCLCPP_ERROR(
getLogger(),
"Link %s has no parent joint", link->name.c_str());
87 if (joint->type != urdf::Joint::UNKNOWN && joint->type != urdf::Joint::FIXED)
89 link_offset.push_back(link->parent_joint->parent_to_joint_origin_transform);
90 angle_multipliers_.push_back(joint->axis.x * fabs(joint->axis.x) + joint->axis.y * fabs(joint->axis.y) +
91 joint->axis.z * fabs(joint->axis.z));
92 RCLCPP_DEBUG(
getLogger(),
"Joint axis: %d, %f, %f, %f", 6 - num_joints, joint->axis.x, joint->axis.y,
94 if (joint->type != urdf::Joint::CONTINUOUS)
98 min_angles_.push_back(joint->safety->soft_lower_limit);
99 max_angles_.push_back(joint->safety->soft_upper_limit);
105 min_angles_.push_back(joint->limits->lower);
106 max_angles_.push_back(joint->limits->upper);
110 min_angles_.push_back(0.0);
111 max_angles_.push_back(0.0);
112 RCLCPP_WARN(
getLogger(),
"No joint limits or joint '%s'", joint->name.c_str());
115 continuous_joint_.push_back(
false);
119 min_angles_.push_back(-M_PI);
120 max_angles_.push_back(M_PI);
121 continuous_joint_.push_back(
true);
126 link = robot_model.getLink(link->getParent()->name);
133 std::reverse(angle_multipliers_.begin(), angle_multipliers_.end());
134 std::reverse(min_angles_.begin(), min_angles_.end());
135 std::reverse(max_angles_.begin(), max_angles_.end());
136 std::reverse(link_offset.begin(), link_offset.end());
140 std::reverse(continuous_joint_.begin(), continuous_joint_.end());
144 RCLCPP_ERROR(
getLogger(),
"PR2ArmIK:: Chain from %s to %s does not have 7 joints", root_name.c_str(),
149 torso_shoulder_offset_x_ = link_offset[0].position.x;
150 torso_shoulder_offset_y_ = link_offset[0].position.y;
151 torso_shoulder_offset_z_ = link_offset[0].position.z;
152 shoulder_upperarm_offset_ =
distance(link_offset[1]);
153 upperarm_elbow_offset_ =
distance(link_offset[3]);
154 elbow_wrist_offset_ =
distance(link_offset[5]);
155 shoulder_elbow_offset_ = shoulder_upperarm_offset_ + upperarm_elbow_offset_;
156 shoulder_wrist_offset_ = shoulder_upperarm_offset_ + upperarm_elbow_offset_ + elbow_wrist_offset_;
158 Eigen::Isometry3f home = Eigen::Isometry3f::Identity();
159 home(0, 3) = shoulder_upperarm_offset_ + upperarm_elbow_offset_ + elbow_wrist_offset_;
160 home_inv_ = home.inverse();
163 solution_.resize(NUM_JOINTS_ARM7DOF);
215 std::vector<std::vector<double> >& solution)
const
219 std::vector<double> solution_ik(NUM_JOINTS_ARM7DOF, 0.0);
220 Eigen::Isometry3f g = g_in;
221 Eigen::Isometry3f gf_local = home_inv_;
222 Eigen::Isometry3f grhs_local = home_inv_;
224 g(0, 3) = g_in(0, 3) - torso_shoulder_offset_x_;
225 g(1, 3) = g_in(1, 3) - torso_shoulder_offset_y_;
226 g(2, 3) = g_in(2, 3) - torso_shoulder_offset_z_;
228 double t1 = angles::normalize_angle(t1_in);
229 if (!checkJointLimits(t1, 0))
232 double cost1, cost2, cost3, cost4;
233 double sint1, sint2, sint3, sint4;
235 gf_local = g * home_inv_;
240 double t2(0), t3(0), t4(0), t5(0), t6(0), t7(0);
242 double at(0), bt(0), ct(0);
244 double theta2[2], theta3[2], theta4[2], theta5[2], theta6[4], theta7[2];
246 double sopx = shoulder_upperarm_offset_ * cost1;
247 double sopy = shoulder_upperarm_offset_ * sint1;
254 double dx = x - sopx;
255 double dy = y - sopy;
256 double dz = z - sopz;
258 double dd = dx * dx + dy * dy + dz * dz;
261 dd - shoulder_upperarm_offset_ * shoulder_upperarm_offset_ +
262 2 * shoulder_upperarm_offset_ * shoulder_elbow_offset_ - 2 * shoulder_elbow_offset_ * shoulder_elbow_offset_ +
263 2 * shoulder_elbow_offset_ * shoulder_wrist_offset_ - shoulder_wrist_offset_ * shoulder_wrist_offset_;
265 2 * (shoulder_upperarm_offset_ - shoulder_elbow_offset_) * (shoulder_elbow_offset_ - shoulder_wrist_offset_);
267 double acos_term = numerator / denominator;
269 if (acos_term > 1.0 || acos_term < -1.0)
272 double acos_angle = acos(acos_term);
274 theta4[0] = acos_angle;
275 theta4[1] = -acos_angle;
278 std::cout <<
"ComputeIK::theta3:" << numerator <<
',' << denominator <<
",\n" << theta4[0] <<
'\n';
281 for (
double theta : theta4)
288 std::cout <<
"t4 " << t4 <<
'\n';
293 if (!checkJointLimits(t4, 3))
296 at = x * cost1 + y * sint1 - shoulder_upperarm_offset_;
298 ct = -shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
299 (shoulder_wrist_offset_ - shoulder_elbow_offset_) * cos(t4);
304 for (
double theta : theta2)
307 if (!checkJointLimits(t2, 1))
311 std::cout <<
"t2 " << t2 <<
'\n';
316 at = sint1 * (shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint2 * sint4;
317 bt = (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost1 * sint4;
318 ct = y - (shoulder_upperarm_offset_ + cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
319 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cos(t4))) *
324 for (
double theta : theta3)
328 if (!checkJointLimits(angles::normalize_angle(t3), 2))
334 std::cout <<
"t3 " << t3 <<
'\n';
336 if (fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
337 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
339 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z) > IK_EPS)
342 if (fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
343 cost1 * (shoulder_upperarm_offset_ +
344 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
345 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
346 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
351 cost4 * (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) -
352 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
353 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) *
357 cost4 * (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) -
358 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
359 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) *
363 cost4 * (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) -
364 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
365 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) *
368 grhs_local(1, 0) = cost3 * (gf_local(1, 0) * cost1 - gf_local(0, 0) * sint1) + gf_local(2, 0) * cost2 * sint3 +
369 (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 * sint3;
371 grhs_local(1, 1) = cost3 * (gf_local(1, 1) * cost1 - gf_local(0, 1) * sint1) + gf_local(2, 1) * cost2 * sint3 +
372 (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 * sint3;
374 grhs_local(1, 2) = cost3 * (gf_local(1, 2) * cost1 - gf_local(0, 2) * sint1) + gf_local(2, 2) * cost2 * sint3 +
375 (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 * sint3;
379 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
380 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) +
381 (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) * sint4;
385 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
386 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) +
387 (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) * sint4;
391 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
392 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) +
393 (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) * sint4;
395 double val1 = sqrt(grhs_local(0, 1) * grhs_local(0, 1) + grhs_local(0, 2) * grhs_local(0, 2));
396 double val2 = grhs_local(0, 0);
398 theta6[0] = atan2(val1, val2);
399 theta6[1] = atan2(-val1, val2);
404 for (
int mm = 0; mm < 2; ++mm)
407 if (!checkJointLimits(angles::normalize_angle(t6), 5))
411 std::cout <<
"t6 " << t6 <<
'\n';
413 if (fabs(cos(t6) - grhs_local(0, 0)) > IK_EPS)
416 if (fabs(sin(t6)) < IK_EPS)
419 theta5[0] = acos(grhs_local(1, 1)) / 2.0;
420 theta7[0] = theta7[0];
421 theta7[1] = M_PI + theta7[0];
422 theta5[1] = theta7[1];
426 theta7[0] = atan2(grhs_local(0, 1), grhs_local(0, 2));
427 theta5[0] = atan2(grhs_local(1, 0), -grhs_local(2, 0));
428 theta7[1] = M_PI + theta7[0];
429 theta5[1] = M_PI + theta5[0];
432 std::cout <<
"theta1: " << t1 <<
'\n';
433 std::cout <<
"theta2: " << t2 <<
'\n';
434 std::cout <<
"theta3: " << t3 <<
'\n';
435 std::cout <<
"theta4: " << t4 <<
'\n';
436 std::cout <<
"theta5: " << t5 <<
'\n';
437 std::cout <<
"theta6: " << t6 <<
'\n';
438 std::cout <<
"theta7: " << t7 <<
'\n' <<
'\n' <<
'\n';
440 for (
int lll = 0; lll < 2; ++lll)
444 if (!checkJointLimits(t5, 4))
446 if (!checkJointLimits(t7, 6))
450 std::cout <<
"t5" << t5 <<
'\n';
451 std::cout <<
"t7" << t7 <<
'\n';
453 if (fabs(sin(t6) * sin(t7) - grhs_local(0, 1)) > IK_EPS ||
454 fabs(cos(t7) * sin(t6) - grhs_local(0, 2)) > IK_EPS)
457 solution_ik[0] = normalize_angle(t1) * angle_multipliers_[0];
458 solution_ik[1] = normalize_angle(t2) * angle_multipliers_[1];
459 solution_ik[2] = normalize_angle(t3) * angle_multipliers_[2];
460 solution_ik[3] = normalize_angle(t4) * angle_multipliers_[3];
461 solution_ik[4] = normalize_angle(t5) * angle_multipliers_[4];
462 solution_ik[5] = normalize_angle(t6) * angle_multipliers_[5];
463 solution_ik[6] = normalize_angle(t7) * angle_multipliers_[6];
464 solution.push_back(solution_ik);
467 std::cout <<
"SOLN " << solution_ik[0] <<
' ' << solution_ik[1] <<
' ' << solution_ik[2] <<
' '
468 << solution_ik[3] <<
' ' << solution_ik[4] <<
' ' << solution_ik[5] <<
' ' << solution_ik[6]
480 std::vector<std::vector<double> >& solution)
const
482 std::vector<double> solution_ik(NUM_JOINTS_ARM7DOF, 0.0);
493 Eigen::Isometry3f g = g_in;
494 Eigen::Isometry3f gf_local = home_inv_;
495 Eigen::Isometry3f grhs_local = home_inv_;
497 g(0, 3) = g_in(0, 3) - torso_shoulder_offset_x_;
498 g(1, 3) = g_in(1, 3) - torso_shoulder_offset_y_;
499 g(2, 3) = g_in(2, 3) - torso_shoulder_offset_z_;
501 if (!checkJointLimits(t3, 2))
508 double cost1, cost2, cost3, cost4;
509 double sint1, sint2, sint3, sint4;
511 gf_local = g * home_inv_;
516 double t1(0), t2(0), t4(0), t5(0), t6(0), t7(0);
518 double at(0), bt(0), ct(0);
520 double theta1[2], theta2[2], theta4[4], theta5[2], theta6[4], theta7[2];
522 double c0 = -sin(-t3) * elbow_wrist_offset_;
523 double c1 = -cos(-t3) * elbow_wrist_offset_;
525 double d0 = 4 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ *
526 (upperarm_elbow_offset_ * upperarm_elbow_offset_ + c1 * c1 - z * z);
527 double d1 = 8 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ * upperarm_elbow_offset_ * elbow_wrist_offset_;
529 4 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ * (elbow_wrist_offset_ * elbow_wrist_offset_ - c1 * c1);
531 double b0 = x * x + y * y + z * z - shoulder_upperarm_offset_ * shoulder_upperarm_offset_ -
532 upperarm_elbow_offset_ * upperarm_elbow_offset_ - c0 * c0 - c1 * c1;
533 double b1 = -2 * upperarm_elbow_offset_ * elbow_wrist_offset_;
535 if (!
solveQuadratic(b1 * b1 - d2, 2 * b0 * b1 - d1, b0 * b0 - d0, &theta4[0], &theta4[1]))
538 printf(
"No solution to quadratic eqn\n");
542 theta4[0] = acos(theta4[0]);
543 theta4[2] = acos(theta4[1]);
544 theta4[1] = -theta4[0];
545 theta4[3] = -theta4[2];
547 for (
double theta : theta4)
551 if (!checkJointLimits(t4, 3))
558 std::cout <<
"t4 " << t4 <<
'\n';
562 at = cos(t3) * sin(t4) * (shoulder_elbow_offset_ - shoulder_wrist_offset_);
563 bt = (shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
564 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cos(t4));
570 for (
double theta : theta2)
574 std::cout <<
"t2 " << t2 <<
'\n';
576 if (!checkJointLimits(t2, 1))
586 ct = (shoulder_elbow_offset_ - shoulder_wrist_offset_) * sin(t3) * sin(t4);
590 std::cout <<
"could not solve cosine equation for t1" <<
'\n';
595 for (
double theta : theta1)
599 std::cout <<
"t1 " << t1 <<
'\n';
601 if (!checkJointLimits(t1, 0))
607 if (fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
608 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
610 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z) > IK_EPS)
613 printf(
"z value not matched %f\n",
614 fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
615 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
617 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z));
621 if (fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
622 cost1 * (shoulder_upperarm_offset_ +
623 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
624 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
625 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
629 printf(
"x value not matched by %f\n",
630 fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
631 cost1 * (shoulder_upperarm_offset_ +
632 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
633 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
634 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
639 if (fabs(-(shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost1 * sint3 * sint4 +
640 sint1 * (shoulder_upperarm_offset_ +
641 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
642 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
643 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
647 printf(
"y value not matched\n");
652 cost4 * (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) -
653 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
654 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) *
658 cost4 * (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) -
659 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
660 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) *
664 cost4 * (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) -
665 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
666 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) *
669 grhs_local(1, 0) = cost3 * (gf_local(1, 0) * cost1 - gf_local(0, 0) * sint1) + gf_local(2, 0) * cost2 * sint3 +
670 (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 * sint3;
672 grhs_local(1, 1) = cost3 * (gf_local(1, 1) * cost1 - gf_local(0, 1) * sint1) + gf_local(2, 1) * cost2 * sint3 +
673 (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 * sint3;
675 grhs_local(1, 2) = cost3 * (gf_local(1, 2) * cost1 - gf_local(0, 2) * sint1) + gf_local(2, 2) * cost2 * sint3 +
676 (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 * sint3;
680 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
681 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) +
682 (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) * sint4;
686 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
687 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) +
688 (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) * sint4;
692 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
693 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) +
694 (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) * sint4;
696 double val1 = sqrt(grhs_local(0, 1) * grhs_local(0, 1) + grhs_local(0, 2) * grhs_local(0, 2));
697 double val2 = grhs_local(0, 0);
699 theta6[0] = atan2(val1, val2);
700 theta6[1] = atan2(-val1, val2);
702 for (
int mm = 0; mm < 2; ++mm)
706 std::cout <<
"t6 " << t6 <<
'\n';
708 if (!checkJointLimits(t6, 5))
713 if (fabs(cos(t6) - grhs_local(0, 0)) > IK_EPS)
716 if (fabs(sin(t6)) < IK_EPS)
719 theta5[0] = acos(grhs_local(1, 1)) / 2.0;
720 theta7[0] = theta5[0];
726 theta7[0] = atan2(grhs_local(0, 1) / sin(t6), grhs_local(0, 2) / sin(t6));
727 theta5[0] = atan2(grhs_local(1, 0) / sin(t6), -grhs_local(2, 0) / sin(t6));
731 for (
int lll = 0; lll < 1; ++lll)
736 if (!checkJointLimits(t5, 4))
740 if (!checkJointLimits(t7, 6))
746 std::cout <<
"t5 " << t5 <<
'\n';
747 std::cout <<
"t7 " << t7 <<
'\n';
753 std::cout <<
"theta1: " << t1 <<
'\n';
754 std::cout <<
"theta2: " << t2 <<
'\n';
755 std::cout <<
"theta3: " << t3 <<
'\n';
756 std::cout <<
"theta4: " << t4 <<
'\n';
757 std::cout <<
"theta5: " << t5 <<
'\n';
758 std::cout <<
"theta6: " << t6 <<
'\n';
759 std::cout <<
"theta7: " << t7 <<
'\n' <<
'\n' <<
'\n';
762 solution_ik[0] = normalize_angle(t1 * angle_multipliers_[0]);
763 solution_ik[1] = normalize_angle(t2 * angle_multipliers_[1]);
764 solution_ik[2] = t3 * angle_multipliers_[2];
765 solution_ik[3] = normalize_angle(t4 * angle_multipliers_[3]);
766 solution_ik[4] = normalize_angle(t5 * angle_multipliers_[4]);
767 solution_ik[5] = normalize_angle(t6 * angle_multipliers_[5]);
768 solution_ik[6] = normalize_angle(t7 * angle_multipliers_[6]);
769 solution.push_back(solution_ik);
771 std::cout <<
"SOLN " << solution_ik[0] <<
' ' << solution_ik[1] <<
' ' << solution_ik[2] <<
' '
772 << solution_ik[3] <<
' ' << solution_ik[4] <<
' ' << solution_ik[5] <<
' ' << solution_ik[6]