Robotics StackExchange | Archived questions

MoveIt Inverse Kinematics Issue

Hi everyone,

I am using MoveIt to develop applications for six-axis robot, ROS version is Melodic, IK solver is IKFast plugin.

I have two joint states they are:
jointstate1: [-0.04252107813954353, -0.24837873876094818, 0.7497109174728394, 0.0010598073713481426, 1.0707587003707886, -0.04357996582984924]
joint
state2: [-0.031201616628110537, 0.19195213717054138, 0.7344664769973024, -0.0003093520778767291, 0.64462084527768, 3.1084943068455577]

I planned a linear motion in Cartesian space, so I used FK and plan a linear motion.

However, I met an issue when I transformed the motion back to joint space. I noticed that only start joint state or end joint state in the motion fits the joint state I have.

I did two experiments,
First, I set "ik seed state" to joint_state1, then I got the result:

ikjointstate1: [-0.042522, -0.248376, 0.74971, 0.00106106, 1.07075, -0.0435781]
ikjointstate2: [-0.031204, 0.191954, 0.734466, -0.000310565, 0.644616, -3.17469]

In this experiment, ikjointstate1 fits jointstate1 I have but ikjoint_state2 it did not.

Second, I set "ik seed state" to joint_state2, then I got the result:

ikjointstate1: [-0.0425236, -0.248376, 0.749711, 0.00106229, 1.07075, 6.23961]
ikjointstate2: [-0.031204, 0.191954, 0.734466, -0.000310565, 0.644616, 3.1085]

In this experiment, ikjointstate2 fits jointstate2 I have but ikjoint_state1 it did not.

That's what I was talking about "only start joint state or end joint state in the motion fits the joint state I have".

I want them both fit to the joint states I have.

When I set "ik seed state" to jointstate1, **I noticed that joint6 rotated 360 degree to Negative direction, but actually I want it rotated to Positive direction to reach "3.10849".**

Also, I tried to set "ik seed state" to previous joint state in the motion. For example: use IK to calculate "ikjointstate2" with ikjointstate1.
But the result is the same as experiment one above.

By the way, I use compute_ik this ROS service to solve IK.

Does anyone can help me solve this issue?

Thanks for viewing my post.

Asked by Teddie on 2023-07-26 08:15:31 UTC

Comments

Is this two links arranged as a pendulum system?

You need to give us more detail, because it is unclear what you think the IK solver should generate. Please edit your post to provide sets of the numeric joint values along the motion path (e.g. the start, middle, end.) Tell us what you expect and what you actually get from IK.

You edit using the "edit" button near the end of the description.

Asked by Mike Scheutzow on 2023-07-27 07:11:22 UTC

Also, please confirm that each joint has 1 degree of freedom and they rotate.

Asked by Mike Scheutzow on 2023-07-27 07:28:04 UTC

Hi Mike, I appreciate the advisement you gave, also I edited the post, If I miss some information, please remind me again, thank you!

Asked by Teddie on 2023-07-28 04:03:25 UTC

Answers

For an arm with 6 rotating joints, a particular cartesian pose can have multiple valid IK solutions. Conceptually, solvers randomly choose one answer from the set and return it to you, so the one you get back is probably not the one you're looking for. If this arm had 7 joints, there may be thousands of solutions.

You can configure which IK solver you use. Some of them allow you to specify "constraints", but this assumes you have some pre-determined knowledge about the valid solutions. If you chose constraints poorly, the solver will find no answer at ail.

Update: edited answer to address @gvdhoorn's comment.

Asked by Mike Scheutzow on 2023-07-28 07:44:53 UTC

Comments

I'll try to add some constraints to it. Thank you!

Asked by Teddie on 2023-07-29 08:03:20 UTC

Nitpick:

For an arm with 6 rotating joints, a particular cartesian pose can have a very large number of IK solutions

depending on joint limits, there would typically be a maximum of 8 solutions for any IK query.

Only when joint limits allow rotations of more than 2 pi would it be possible for there to be more than those 8 solutions.

Asked by gvdhoorn on 2023-07-29 09:49:45 UTC

there would typically be a maximum of 8 solutions for any IK query

Yes, OK. I was thinking of the Rethink Sawyer robot when I typed that and it has 7 joints (not 6.)

Asked by Mike Scheutzow on 2023-07-29 10:50:08 UTC