0
$\begingroup$

Rosanswers logo

Is there a better way to determine forward kinematics for a given joint pose without having to go through MoveIt's FK service? I'm finding I need to call the FK service faster than it's compute time (around 20 ms for me).

I don't think using tf2 is an option, as it will give me the current robot joint state. What I'm looking for is, essentially, a way to use the URDF/robot model to make a fk call with joint angles of my choosing, similar to how it can be done with the moveit service. I found this on the moveit tutorials, which on the surface looks like I'd need to create a "dummy" robot kinematic state and update it's state with my desired joint angles, and then call the getGlobalLinkTransform as indicated. I looked around the moveit repo, and couldn't find where this service even originates. When I load up moveit, a rosservice info /compute_fk says it's launched by move_group but I couldn't find anywhere in there that showed how this was called.

Any thoughts?


Originally posted by emielke on ROS Answers with karma: 261 on 2021-02-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Yes, just use a RobotModel or RobotState in C++ as described in the tutorial. Your copy will not be updated to the "current"/"real" robot state, and you can define its state freely. You can copy most of the code from the compute_fk service, as you assumed.

The compute_fk service is a move_group_capability (a plugin that is started up by the move_group node) that is defined here. The move_group's plugin-based structure is a bit confusing to read, but this explanation should help.

I hope that solved what you were getting at.


Originally posted by fvd with karma: 2180 on 2021-02-19

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by emielke on 2021-02-19:
Yes thank you both for the help, this is what I was looking for!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.