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

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
1

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

https://answers.ros.org/question/2812...

I was able to clone the https://github.com/gt-ros-pkg/hrl-kdl 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

Question Tools

3 followers

Stats

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

Seen: 2,208 times

Last updated: Jan 31 '18