ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Python Forward Kinematics

asked 2018-01-23 18:46:45 -0600

rkeatin3 gravatar image

How can I perform forward kinematics in python?

Can I use MoveItCommander to perform forward kinematics? I don't see analogous classes/functions as exist in the C++ kinematics API.

Similar questions have suggested using pykdl_utils instead, but I see that that package last existed in hydro. I also imagine that the package python_orocos_kdl has the functionality, but I'm having trouble finding useful documentation.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-01-31 17:21:03 -0600

I was able to clone the indigo-devel branch directly into my catkin_ws and use it for FK w/o any problems - so far.

from urdf_parser_py.urdf import URDF
from pykdl_utils.kdl_kinematics import KDLKinematics

# pykdl_utils setup
robot_urdf = URDF.from_xml_string(urdf_str)
kdl_kin = KDLKinematics(robot_urdf, base_link, end_link)

test_jt_angles = [0, 0, 0]
pose = kdl_kin.forward(test_jt_angles)

Thanks for the tip you gave me on my question. May still end up going down that route if I run into problems.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-01-23 18:46:45 -0600

Seen: 1,751 times

Last updated: Jan 31 '18