Create a custom IK plugin from an IK service

214 views
Skip to first unread message

joshuama...@u.northwestern.edu

unread,
Jan 25, 2017, 3:05:41 PM1/25/17
to MoveIt! Users
Hello,

I have a 4 DOF robot arm in which I need to be able to specify a 3-D position and constrain 2 of the angles to be below a certain threshold. I have already written a ROS Service to do this for me in which I provide an (x, y, z) position and it returns the 4 joint angles. So far this ROS Service has worked for me by being able to use setJointValueTarget().

However, I would like to use computeCartesianPath() with my robot such that the end effector follows a path, but I cannot since you provide waypoints. These waypoints are then passed to the IK solver and then a plan is generated. In order for me to do this, I see two possible ways:
  1. Create a custom IK plugin that would either be written from my IK service, or have the plugin call the service (if possible)
  2. Find the /compute_cartesian_path ROS service and change it to accept a series of joint positions instead of waypoints
The first solution seems like it would be easier to me, and I would also be able to take advantage of setPositionTarget(). 

Has anyone tried to do this before, or can provide some help?


Thanks,
Josh

Martin Günther

unread,
Jan 26, 2017, 8:53:51 AM1/26/17
to moveit...@googlegroups.com
Hi Josh,

I would avoid calling a service from within the plugin. If you are
computing cartesian paths, there are usually tens of thousands of calls
to the IK plugin. Since each service call means one XMLRPC connection,
the overhead can easily add up to several seconds per planned path.

Cheers,
Martin

On 25.01.2017 21:05, joshuama...@u.northwestern.edu wrote:
> Hello,
>
> I have a 4 DOF robot arm in which I need to be able to specify a 3-D
> position and constrain 2 of the angles to be below a certain threshold.
> I have already written a ROS Service to do this for me in which I
> provide an (x, y, z) position and it returns the 4 joint angles. So far
> this ROS Service has worked for me by being able to use
> setJointValueTarget().
>
> However, I would like to use computeCartesianPath() with my robot such
> that the end effector follows a path, but I cannot since you provide
> waypoints. These waypoints are then passed to the IK solver and then a
> plan is generated. In order for me to do this, I see two possible ways:
>
> 1. Create a custom IK plugin that would either be written from my IK
> service, or have the plugin call the service (if possible)
> 2. Find the /compute_cartesian_path ROS service and change it to accept

joshuama...@u.northwestern.edu

unread,
Jan 26, 2017, 2:19:22 PM1/26/17
to MoveIt! Users
Hello Martin,

Thanks for getting back to me. Are there really that many calls to the IK plugin for computing a Cartesian path? I imagined it would do it for the waypoints you specify, taking into account the ee_step parameter, then compute the Cartesian path in joint space.

If you don't recommend calling the service from within the plugin, is it possible to modify the code in my service to be written for an IK plugin?


Thanks,
Josh

Martin Günther

unread,
Jan 26, 2017, 3:17:30 PM1/26/17
to moveit...@googlegroups.com
Hi Josh,

On 26.01.2017 20:19, joshuama...@u.northwestern.edu wrote:
> Hello Martin,
>
> Thanks for getting back to me. Are there really that many calls to the
> IK plugin for computing a Cartesian path? I imagined it would do it for
> the waypoints you specify, taking into account the ee_step parameter,
> then compute the Cartesian path in joint space.

At least if you specify Cartesian constraints (like "keep the tool
center point upright") it does, since it cannot plan in joint space
then. I'm not sure about the Cartesian path though.

> If you don't recommend calling the service from within the plugin, is it
> possible to modify the code in my service to be written for an IK plugin?

If it's really so much simpler for you to try wrapping your service
instead of wrapping your code, then you can of course try that first and
see if it's too slow.

But I think it shouldn't be too much work to simply take your existing
service implementation and put it into the plugin directly, right? The
hard part will be to write your own kinematics plugin. Once you've got
that, and it works by wrapping your service, I don't see why it should
be hard to take out the service calls and replace them by direct
function calls to your service implementation.

You have to implement the kinematics::KinematicsBase interface. Some
resources:

http://docs.ros.org/kinetic/api/moveit_core/html/classkinematics_1_1KinematicsBase.html

http://moveit.ros.org/documentation/plugins/#kinematicsbase

https://blog.nymble.in/tartupwriting-an-inverse-kinematics-solver-for-ros-36153deb922f#.3knjhhfas

Cheers,
Martin

joshuama...@u.northwestern.edu

unread,
Jan 27, 2017, 10:11:07 AM1/27/17
to MoveIt! Users
Thanks, I'll give it a try.
Reply all
Reply to author
Forward
0 new messages