Ask Your Question
0

FK without using moveit service

asked 2021-02-18 16:25:13 -0500

emielke gravatar image

updated 2021-02-19 02:10:50 -0500

fvd gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-02-19 02:06:53 -0500

fvd gravatar image

updated 2021-02-19 02:37:04 -0500

gvdhoorn gravatar image

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.

edit flag offensive delete link more

Comments

Yes thank you both for the help, this is what I was looking for!

emielke gravatar image emielke  ( 2021-02-19 09:38:30 -0500 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-02-18 16:25:13 -0500

Seen: 283 times

Last updated: Feb 19 '21