ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

MoveIt Inverse Kinematics Issue

asked 2023-07-26 08:15:31 -0500

Teddie gravatar image

updated 2023-07-28 04:03:11 -0500

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:
joint_state1: [-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:

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

In this experiment, ik_joint_state1 fits joint_state1 I have but ik_joint_state2 it did not.

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

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

In this experiment, ik_joint_state2 fits joint_state2 I have but ik_joint_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 joint_state1, I noticed that joint_6 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 "ik_joint_state2" with ik_joint_state1.
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.

edit retag flag offensive close merge delete

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-07-27 07:11:22 -0500 )edit

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

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-07-27 07:28:04 -0500 )edit

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

Teddie gravatar image Teddie  ( 2023-07-28 04:03:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-28 07:44:53 -0500

Mike Scheutzow gravatar image

updated 2023-07-29 11:46:40 -0500

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.

edit flag offensive delete link more

Comments

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

Teddie gravatar image Teddie  ( 2023-07-29 08:03:20 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2023-07-29 09:49:45 -0500 )edit

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.)

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-07-29 10:50:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-07-26 08:15:31 -0500

Seen: 63 times

Last updated: Jul 29 '23