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

Using IKFast with ROS

asked 2014-02-07 03:57:47 -0600

TopSecret gravatar image

I am trying to do exactly as this other question, which is moving the nao arms using cartesian coordinates. I did follow AHormung answer and setup IKFast with MoveIt for both my nao's arms. My problem is, how do I use the resulting plugin/cpp generated with IKFast with ROS?

In the previous question, he suggested to "feed the results into the nao_controller node, probably with some lightweight conversion of messages.", but I am not sure of what it clearly means.

edit retag flag offensive close merge delete

Comments

Which ROS distro are you using? Are you (planning on) using arm_navigation, MoveIt or something else?

Martin Günther gravatar image Martin Günther  ( 2014-02-10 21:25:11 -0600 )edit

I am using Hydro. I wasn't planning on using any of these at the time I posted the question, but now I also want to use OMPL. In this case, I'd like to use both with MoveIt and not arm_navigation.

TopSecret gravatar image TopSecret  ( 2014-02-11 08:28:38 -0600 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2014-02-11 22:21:24 -0600

updated 2014-02-13 22:49:53 -0600

Since you're using Hydro, arm_navigation is out of the question (it doesn't exist in Hydro any more). Instead, use MoveIt (it's the successor of arm_navigation). Since MoveIt is the future, I'd have recommended that anyway.

There is a good tutorial on how to generate a IKFast plugin for MoveIt here: http://docs.ros.org/hydro/api/moveit_... . Before you can do that tutorial however, you'll need to create a moveit config package for the nao. Just follow the "Integrating a new robot with MoveIt!" section of the MoveIt tutorials. There already seems to be a nao_moveit_config created by some very competent people, so probably you can also just use that one.

Once you have a working nao_moveit_config package, follow the first tutorial I linked to to see how to integrate the generated IKFast plugin.


Edit in response to TopSecret's comment:

Maybe I simply misunderstood what IKFast does. I tought I could use the plugin/cpp in a ROS node to get super fast inverse kinematic for my robot by calling a function or something like that. Is it possible to use it directly form C++/python code?

You are right, the generated IKFast solver is just that: a class that gives you super fast IK. The IKFast MoveIt plugin wraps that generated code so it can be used from MoveIt. Your moveit_ikfast package compiles that plugin into a shared library and exports it, and you can configure MoveIt to import and use it.

I think there are three ways you can get IK from your node:

  1. Start MoveIt and call the provided /compute_ik ROS service. (Make sure your move_group.launch includes the move_group/MoveGroupKinematicsService capability.) Advantages: super easy to implement, and you'll also get collision-aware IK (I think). Disadvantage: If you want thousands of IK calls per second, the ROS service call will slow you down a lot (which isn't the point of having IKFast, is it?). For the odd IK call now and then this is okay.
  2. The hackish version: Simply copy your IKFast solver into your own package and try calling the provided functions from your code there.
  3. Figure out how MoveIt includes the plugin, and mimic that. Seems the cleanest way to do it.

I don't have any hands-on experience with (2) and (3), so if you want to go down that road, your best bet is to ask your question on the moveit google group, there the real gurus can help you. Perhaps provide a link to this question.

edit flag offensive delete link more

Comments

As I mentionned in my question, I already did the IKFast/MoveIt setup, although I used nao_description urdf and MoveIt setup assisstant instead of the nao_moveit_config you pointed me. I also generated the IKFast plugin/cpp, but I don't know what to do with it. However I skipped parts of the MoveIt tutorials.

TopSecret gravatar image TopSecret  ( 2014-02-12 02:37:50 -0600 )edit

So you've already created your <moveit_ik_plugin_pkg> and entered it into your nao_moveit_config, as explained in the tutorial? And you can move the arm around using RViz + MoveIt? Then you're done. If not, please be more specific at what step of the tutorial you have problems.

Martin Günther gravatar image Martin Günther  ( 2014-02-12 04:23:21 -0600 )edit

Yes, I can move it in RViz. Maybe I simply misunderstood what IKFast does. I tought I could use the plugin/cpp in a ROS node to get super fast inverse kinematic for my robot by calling a function or something like that. Is it possible to use it directly form C++/python code?

TopSecret gravatar image TopSecret  ( 2014-02-12 04:49:52 -0600 )edit

@TopSecret: if the setup (both move_it configuration and IKFast) works well for you, would you mind sharing it, so we can make it available to everyone on https://github.com/ros-nao ?

severin gravatar image severin  ( 2014-02-14 00:50:10 -0600 )edit

Thank you Martin. I don't have much time to work on this right now to verify your proposed solutions, but it seems to be the answer I was looking for. @severin: If I succeed to implement what Martin suggested in the future, I will certainly share it with the community for others to use.

TopSecret gravatar image TopSecret  ( 2014-02-14 07:18:25 -0600 )edit

Hi!! I am trying to use the rosservice /compute_ik provided by move it. I am not sure what arguments to pass for the rosservice call. Can you please tell me how to do it?

Thanks!

puru gravatar image puru  ( 2016-11-30 18:35:37 -0600 )edit

I have the generated IKFast cpp solver, but I don't know how to use it as a function

JarvisRobot gravatar image JarvisRobot  ( 2017-07-11 08:35:55 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2014-02-07 03:57:47 -0600

Seen: 1,726 times

Last updated: Feb 13 '14