4
$\begingroup$

I am using movegroup_interface with ros2-iron to control a 6-axis arm.

The link structure is as follows.


  • world
  • link1
  • link2
  • link3
  • link4
  • link5
    • camera-link
  • link6
    • hand-link

A camera is attached to the 5th link of this arm and I want to control the position of this camera. In the attached image, I want to control the position of the camera coordinate system attached to the 5th axis, not the hand coordinate system attached to the 6th axis.

Naturally, I am able to control the hand position of the 6th link as I want, but I am having trouble understanding how to control the position of middle links(1st-5th).

I have specified the link for the 5th axis in the end effector like setEndEffectorLink("camera_link"), but the IK solver fails and it does not work. (Caused by the 6th axis being free?)

Could you please give me some advice?

hand-eye robot arm

$\endgroup$
6
  • $\begingroup$ Have you tried creating a move_group with only the joints you care about, then asking IK to solve for the cartesian goal? (this approach is a guess, I've not tried it myself.) $\endgroup$
    – Mike973
    Commented Dec 23, 2023 at 18:20
  • $\begingroup$ Please edit your post to tell us: 1) Is "camera_link" a direct child of a rotating arm joint? If not, I would try using the actual name of the arm link in setEndEffectorLink(), 2) Which IK solver are you using now?, 3) Have you looked at generating a custom Fast IK solver? $\endgroup$
    – Mike973
    Commented Dec 23, 2023 at 21:53
  • $\begingroup$ I updated post about arm structure. I tried move_group consisting of 1 to 5 links, but IK solver failed too. $\endgroup$
    – user55147
    Commented Dec 24, 2023 at 0:17
  • $\begingroup$ 1) Yes. 2) I'm using kdk_kinematics_plugin. 3) Not yet. $\endgroup$
    – user55147
    Commented Dec 24, 2023 at 0:30
  • $\begingroup$ Please edit your post to show us the yaml you used to define the smaller move_group, and format it using the Code Sample button. Another possibility: How much time are you giving the IK solver to find a solution? (The default timeout value is often too short.) $\endgroup$
    – Mike973
    Commented Dec 24, 2023 at 14:06

1 Answer 1

1
$\begingroup$

Create a movegroup for the link up to the intermediate axis, and note that since it is not a 6-axis movegroup, it has less degrees of freedom and does not exactly match the target value.

So, instead of setJointValueTarget, use setApproximateJointValueTarget.

$\endgroup$
2
  • $\begingroup$ The 2nd paragraph does not make sense to me: the MoveGroup.setJointValueTarget() method has nothing to do with IK failing when given a cartesian pose input. $\endgroup$
    – Mike973
    Commented Dec 27, 2023 at 13:10
  • $\begingroup$ ... but the idea that you might need to allow a less precise IK solution is reasonable. $\endgroup$
    – Mike973
    Commented Dec 27, 2023 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.