-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Description
Hi, thanks for your impressive works, sorry for my disturbing.
I used the following code to test the IK calculator.
However, when I plot the chain, I found that the chain's base is not located at the world's origin (0,0,0).
And I realized that IK is calculated based on the chain base's frame. But I want to calculate IK based on world frame.
So, is it possible to do one of the following or both?
- Locate my chain at the world's origin.
- Calculate IK based on the world's frame. i.e. [0.6042, 0.1777, 0.3502] means the coordinate w.r.t. world frame, instead of the chain base frame.
Thanks in advance!
my_chain = ikpy.chain.Chain.from_urdf_file(urdf_path)
target_position = [0.6042, 0.1777, 0.3502]
print("The angles of each joints are : ", my_chain.inverse_kinematics(target_position))
real_frame = my_chain.forward_kinematics(my_chain.inverse_kinematics(target_position))
print("Computed position vector : %s, original position vector : %s" % (real_frame[:3, 3], target_position))
fig, ax = plot_utils.init_3d_figure()
my_chain.plot(my_chain.inverse_kinematics(target_position), ax, target=target_position)
plt.xlim(-1 ,1)
plt.ylim(-1, 1)
plt.savefig("IK.png")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
