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);
211 std::vector<std::vector<double> >& solution)
const
215 std::vector<double> solution_ik(NUM_JOINTS_ARM7DOF, 0.0);
216 Eigen::Isometry3f g = g_in;
217 Eigen::Isometry3f gf_local = home_inv_;
218 Eigen::Isometry3f grhs_local = home_inv_;
220 g(0, 3) = g_in(0, 3) - torso_shoulder_offset_x_;
221 g(1, 3) = g_in(1, 3) - torso_shoulder_offset_y_;
222 g(2, 3) = g_in(2, 3) - torso_shoulder_offset_z_;
224 double t1 = angles::normalize_angle(t1_in);
225 if (!checkJointLimits(t1, 0))
228 double cost1, cost2, cost3, cost4;
229 double sint1, sint2, sint3, sint4;
231 gf_local = g * home_inv_;
236 double t2(0), t3(0), t4(0), t5(0), t6(0), t7(0);
238 double at(0), bt(0), ct(0);
240 double theta2[2], theta3[2], theta4[2], theta5[2], theta6[4], theta7[2];
242 double sopx = shoulder_upperarm_offset_ * cost1;
243 double sopy = shoulder_upperarm_offset_ * sint1;
250 double dx = x - sopx;
251 double dy = y - sopy;
252 double dz = z - sopz;
254 double dd = dx * dx + dy * dy + dz * dz;
257 dd - shoulder_upperarm_offset_ * shoulder_upperarm_offset_ +
258 2 * shoulder_upperarm_offset_ * shoulder_elbow_offset_ - 2 * shoulder_elbow_offset_ * shoulder_elbow_offset_ +
259 2 * shoulder_elbow_offset_ * shoulder_wrist_offset_ - shoulder_wrist_offset_ * shoulder_wrist_offset_;
261 2 * (shoulder_upperarm_offset_ - shoulder_elbow_offset_) * (shoulder_elbow_offset_ - shoulder_wrist_offset_);
263 double acos_term = numerator / denominator;
265 if (acos_term > 1.0 || acos_term < -1.0)
268 double acos_angle = acos(acos_term);
270 theta4[0] = acos_angle;
271 theta4[1] = -acos_angle;
274 std::cout <<
"ComputeIK::theta3:" << numerator <<
',' << denominator <<
",\n" << theta4[0] <<
'\n';
277 for (
double theta : theta4)
284 std::cout <<
"t4 " << t4 <<
'\n';
289 if (!checkJointLimits(t4, 3))
292 at = x * cost1 + y * sint1 - shoulder_upperarm_offset_;
294 ct = -shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
295 (shoulder_wrist_offset_ - shoulder_elbow_offset_) * cos(t4);
300 for (
double theta : theta2)
303 if (!checkJointLimits(t2, 1))
307 std::cout <<
"t2 " << t2 <<
'\n';
312 at = sint1 * (shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint2 * sint4;
313 bt = (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost1 * sint4;
314 ct = y - (shoulder_upperarm_offset_ + cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
315 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cos(t4))) *
320 for (
double theta : theta3)
324 if (!checkJointLimits(angles::normalize_angle(t3), 2))
330 std::cout <<
"t3 " << t3 <<
'\n';
332 if (fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
333 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
335 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z) > IK_EPS)
338 if (fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
339 cost1 * (shoulder_upperarm_offset_ +
340 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
341 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
342 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
347 cost4 * (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) -
348 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
349 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) *
353 cost4 * (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) -
354 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
355 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) *
359 cost4 * (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) -
360 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
361 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) *
364 grhs_local(1, 0) = cost3 * (gf_local(1, 0) * cost1 - gf_local(0, 0) * sint1) + gf_local(2, 0) * cost2 * sint3 +
365 (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 * sint3;
367 grhs_local(1, 1) = cost3 * (gf_local(1, 1) * cost1 - gf_local(0, 1) * sint1) + gf_local(2, 1) * cost2 * sint3 +
368 (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 * sint3;
370 grhs_local(1, 2) = cost3 * (gf_local(1, 2) * cost1 - gf_local(0, 2) * sint1) + gf_local(2, 2) * cost2 * sint3 +
371 (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 * sint3;
375 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
376 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) +
377 (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) * sint4;
381 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
382 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) +
383 (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) * sint4;
387 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
388 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) +
389 (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) * sint4;
391 double val1 = sqrt(grhs_local(0, 1) * grhs_local(0, 1) + grhs_local(0, 2) * grhs_local(0, 2));
392 double val2 = grhs_local(0, 0);
394 theta6[0] = atan2(val1, val2);
395 theta6[1] = atan2(-val1, val2);
400 for (
int mm = 0; mm < 2; ++mm)
403 if (!checkJointLimits(angles::normalize_angle(t6), 5))
407 std::cout <<
"t6 " << t6 <<
'\n';
409 if (fabs(cos(t6) - grhs_local(0, 0)) > IK_EPS)
412 if (fabs(sin(t6)) < IK_EPS)
415 theta5[0] = acos(grhs_local(1, 1)) / 2.0;
416 theta7[0] = theta7[0];
417 theta7[1] = M_PI + theta7[0];
418 theta5[1] = theta7[1];
422 theta7[0] = atan2(grhs_local(0, 1), grhs_local(0, 2));
423 theta5[0] = atan2(grhs_local(1, 0), -grhs_local(2, 0));
424 theta7[1] = M_PI + theta7[0];
425 theta5[1] = M_PI + theta5[0];
428 std::cout <<
"theta1: " << t1 <<
'\n';
429 std::cout <<
"theta2: " << t2 <<
'\n';
430 std::cout <<
"theta3: " << t3 <<
'\n';
431 std::cout <<
"theta4: " << t4 <<
'\n';
432 std::cout <<
"theta5: " << t5 <<
'\n';
433 std::cout <<
"theta6: " << t6 <<
'\n';
434 std::cout <<
"theta7: " << t7 <<
'\n' <<
'\n' <<
'\n';
436 for (
int lll = 0; lll < 2; ++lll)
440 if (!checkJointLimits(t5, 4))
442 if (!checkJointLimits(t7, 6))
446 std::cout <<
"t5" << t5 <<
'\n';
447 std::cout <<
"t7" << t7 <<
'\n';
449 if (fabs(sin(t6) * sin(t7) - grhs_local(0, 1)) > IK_EPS ||
450 fabs(cos(t7) * sin(t6) - grhs_local(0, 2)) > IK_EPS)
453 solution_ik[0] = normalize_angle(t1) * angle_multipliers_[0];
454 solution_ik[1] = normalize_angle(t2) * angle_multipliers_[1];
455 solution_ik[2] = normalize_angle(t3) * angle_multipliers_[2];
456 solution_ik[3] = normalize_angle(t4) * angle_multipliers_[3];
457 solution_ik[4] = normalize_angle(t5) * angle_multipliers_[4];
458 solution_ik[5] = normalize_angle(t6) * angle_multipliers_[5];
459 solution_ik[6] = normalize_angle(t7) * angle_multipliers_[6];
460 solution.push_back(solution_ik);
463 std::cout <<
"SOLN " << solution_ik[0] <<
' ' << solution_ik[1] <<
' ' << solution_ik[2] <<
' '
464 << solution_ik[3] <<
' ' << solution_ik[4] <<
' ' << solution_ik[5] <<
' ' << solution_ik[6]
476 std::vector<std::vector<double> >& solution)
const
478 std::vector<double> solution_ik(NUM_JOINTS_ARM7DOF, 0.0);
489 Eigen::Isometry3f g = g_in;
490 Eigen::Isometry3f gf_local = home_inv_;
491 Eigen::Isometry3f grhs_local = home_inv_;
493 g(0, 3) = g_in(0, 3) - torso_shoulder_offset_x_;
494 g(1, 3) = g_in(1, 3) - torso_shoulder_offset_y_;
495 g(2, 3) = g_in(2, 3) - torso_shoulder_offset_z_;
497 if (!checkJointLimits(t3, 2))
504 double cost1, cost2, cost3, cost4;
505 double sint1, sint2, sint3, sint4;
507 gf_local = g * home_inv_;
512 double t1(0), t2(0), t4(0), t5(0), t6(0), t7(0);
514 double at(0), bt(0), ct(0);
516 double theta1[2], theta2[2], theta4[4], theta5[2], theta6[4], theta7[2];
518 double c0 = -sin(-t3) * elbow_wrist_offset_;
519 double c1 = -cos(-t3) * elbow_wrist_offset_;
521 double d0 = 4 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ *
522 (upperarm_elbow_offset_ * upperarm_elbow_offset_ + c1 * c1 - z * z);
523 double d1 = 8 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ * upperarm_elbow_offset_ * elbow_wrist_offset_;
525 4 * shoulder_upperarm_offset_ * shoulder_upperarm_offset_ * (elbow_wrist_offset_ * elbow_wrist_offset_ - c1 * c1);
527 double b0 = x * x + y * y + z * z - shoulder_upperarm_offset_ * shoulder_upperarm_offset_ -
528 upperarm_elbow_offset_ * upperarm_elbow_offset_ - c0 * c0 - c1 * c1;
529 double b1 = -2 * upperarm_elbow_offset_ * elbow_wrist_offset_;
531 if (!
solveQuadratic(b1 * b1 - d2, 2 * b0 * b1 - d1, b0 * b0 - d0, &theta4[0], &theta4[1]))
534 printf(
"No solution to quadratic eqn\n");
538 theta4[0] = acos(theta4[0]);
539 theta4[2] = acos(theta4[1]);
540 theta4[1] = -theta4[0];
541 theta4[3] = -theta4[2];
543 for (
double theta : theta4)
547 if (!checkJointLimits(t4, 3))
554 std::cout <<
"t4 " << t4 <<
'\n';
558 at = cos(t3) * sin(t4) * (shoulder_elbow_offset_ - shoulder_wrist_offset_);
559 bt = (shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
560 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cos(t4));
566 for (
double theta : theta2)
570 std::cout <<
"t2 " << t2 <<
'\n';
572 if (!checkJointLimits(t2, 1))
582 ct = (shoulder_elbow_offset_ - shoulder_wrist_offset_) * sin(t3) * sin(t4);
586 std::cout <<
"could not solve cosine equation for t1" <<
'\n';
591 for (
double theta : theta1)
595 std::cout <<
"t1 " << t1 <<
'\n';
597 if (!checkJointLimits(t1, 0))
603 if (fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
604 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
606 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z) > IK_EPS)
609 printf(
"z value not matched %f\n",
610 fabs((shoulder_upperarm_offset_ - shoulder_elbow_offset_ +
611 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost4) *
613 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost2 * cost3 * sint4 - z));
617 if (fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
618 cost1 * (shoulder_upperarm_offset_ +
619 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
620 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
621 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
625 printf(
"x value not matched by %f\n",
626 fabs((shoulder_elbow_offset_ - shoulder_wrist_offset_) * sint1 * sint3 * sint4 +
627 cost1 * (shoulder_upperarm_offset_ +
628 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
629 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
630 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
635 if (fabs(-(shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost1 * sint3 * sint4 +
636 sint1 * (shoulder_upperarm_offset_ +
637 cost2 * (-shoulder_upperarm_offset_ + shoulder_elbow_offset_ +
638 (-shoulder_elbow_offset_ + shoulder_wrist_offset_) * cost4) +
639 (shoulder_elbow_offset_ - shoulder_wrist_offset_) * cost3 * sint2 * sint4) -
643 printf(
"y value not matched\n");
648 cost4 * (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) -
649 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
650 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) *
654 cost4 * (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) -
655 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
656 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) *
660 cost4 * (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) -
661 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
662 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) *
665 grhs_local(1, 0) = cost3 * (gf_local(1, 0) * cost1 - gf_local(0, 0) * sint1) + gf_local(2, 0) * cost2 * sint3 +
666 (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 * sint3;
668 grhs_local(1, 1) = cost3 * (gf_local(1, 1) * cost1 - gf_local(0, 1) * sint1) + gf_local(2, 1) * cost2 * sint3 +
669 (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 * sint3;
671 grhs_local(1, 2) = cost3 * (gf_local(1, 2) * cost1 - gf_local(0, 2) * sint1) + gf_local(2, 2) * cost2 * sint3 +
672 (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 * sint3;
676 (gf_local(2, 0) * cost2 * cost3 + cost3 * (gf_local(0, 0) * cost1 + gf_local(1, 0) * sint1) * sint2 +
677 (-(gf_local(1, 0) * cost1) + gf_local(0, 0) * sint1) * sint3) +
678 (gf_local(0, 0) * cost1 * cost2 + gf_local(1, 0) * cost2 * sint1 - gf_local(2, 0) * sint2) * sint4;
682 (gf_local(2, 1) * cost2 * cost3 + cost3 * (gf_local(0, 1) * cost1 + gf_local(1, 1) * sint1) * sint2 +
683 (-(gf_local(1, 1) * cost1) + gf_local(0, 1) * sint1) * sint3) +
684 (gf_local(0, 1) * cost1 * cost2 + gf_local(1, 1) * cost2 * sint1 - gf_local(2, 1) * sint2) * sint4;
688 (gf_local(2, 2) * cost2 * cost3 + cost3 * (gf_local(0, 2) * cost1 + gf_local(1, 2) * sint1) * sint2 +
689 (-(gf_local(1, 2) * cost1) + gf_local(0, 2) * sint1) * sint3) +
690 (gf_local(0, 2) * cost1 * cost2 + gf_local(1, 2) * cost2 * sint1 - gf_local(2, 2) * sint2) * sint4;
692 double val1 = sqrt(grhs_local(0, 1) * grhs_local(0, 1) + grhs_local(0, 2) * grhs_local(0, 2));
693 double val2 = grhs_local(0, 0);
695 theta6[0] = atan2(val1, val2);
696 theta6[1] = atan2(-val1, val2);
698 for (
int mm = 0; mm < 2; ++mm)
702 std::cout <<
"t6 " << t6 <<
'\n';
704 if (!checkJointLimits(t6, 5))
709 if (fabs(cos(t6) - grhs_local(0, 0)) > IK_EPS)
712 if (fabs(sin(t6)) < IK_EPS)
715 theta5[0] = acos(grhs_local(1, 1)) / 2.0;
716 theta7[0] = theta5[0];
722 theta7[0] = atan2(grhs_local(0, 1) / sin(t6), grhs_local(0, 2) / sin(t6));
723 theta5[0] = atan2(grhs_local(1, 0) / sin(t6), -grhs_local(2, 0) / sin(t6));
727 for (
int lll = 0; lll < 1; ++lll)
732 if (!checkJointLimits(t5, 4))
736 if (!checkJointLimits(t7, 6))
742 std::cout <<
"t5 " << t5 <<
'\n';
743 std::cout <<
"t7 " << t7 <<
'\n';
749 std::cout <<
"theta1: " << t1 <<
'\n';
750 std::cout <<
"theta2: " << t2 <<
'\n';
751 std::cout <<
"theta3: " << t3 <<
'\n';
752 std::cout <<
"theta4: " << t4 <<
'\n';
753 std::cout <<
"theta5: " << t5 <<
'\n';
754 std::cout <<
"theta6: " << t6 <<
'\n';
755 std::cout <<
"theta7: " << t7 <<
'\n' <<
'\n' <<
'\n';
758 solution_ik[0] = normalize_angle(t1 * angle_multipliers_[0]);
759 solution_ik[1] = normalize_angle(t2 * angle_multipliers_[1]);
760 solution_ik[2] = t3 * angle_multipliers_[2];
761 solution_ik[3] = normalize_angle(t4 * angle_multipliers_[3]);
762 solution_ik[4] = normalize_angle(t5 * angle_multipliers_[4]);
763 solution_ik[5] = normalize_angle(t6 * angle_multipliers_[5]);
764 solution_ik[6] = normalize_angle(t7 * angle_multipliers_[6]);
765 solution.push_back(solution_ik);
767 std::cout <<
"SOLN " << solution_ik[0] <<
' ' << solution_ik[1] <<
' ' << solution_ik[2] <<
' '
768 << solution_ik[3] <<
' ' << solution_ik[4] <<
' ' << solution_ik[5] <<
' ' << solution_ik[6]