Robotics StackExchange | Archived questions

Is there a moveit package that will print me out the IK and FK equations from a URDF?

Hi

I would like to get the full IK and FK equations for a new robot design, which is not the same as any existing robot i.e. I cannot just use an existing solution.

I have been working the equations by hand, drawing kinematic diagrams and constructing the homogeneous transformation matrices etc, when someone mentioned that using a URDF and 'a moveit package' would allow me to solve the IK and FK without doing any of the analysis. I have seen the IK Fast and Trac-IK solvers, but have not been able to tell if they can give me the output I need or if they just communicate somehow with ROS in the background.

The output I need is a printout of the full equations, to be used / pasted (with any necessary code modifications made by myself) in a c file used without ROS. Is this possible?

Thanks!

Asked by Wireline on 2019-11-05 16:08:30 UTC

Comments

Answers

Trac-IK and KDL are both numerical solvers. They will not have the ability to produce source code for IK or FK. IKFast does exactly that. If you properly run IKFast on a given robot, it can auto-generate code for FK/IK. Check out the MoveIt! tutorial on how to do this for a good resource. Note, if you just want the standalone source code you can even skip the Create Plugin step.

Note, the code that is generated through this process is not very human-readable.

EDIT Here's an example IKFast-generated source file for Baxter's right arm: https://github.com/ros-planning/moveit_robots/blob/kinetic-devel/baxter/baxter_ikfast_right_arm_plugin/src/baxter_right_arm_ikfast_solver.cpp You'll see what I mean about it not being very human-readable. However, note that there are functions defined such as void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) and bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions)

Asked by jarvisschultz on 2019-11-05 17:19:33 UTC

Comments

Thanks for your reply, its appreciated. I did see that tutorial before and I could not see it referenced, but are the matrices / equations embedded in the code somehow? I am looking for the usual string of cosines, sines, link lengths etc that you see when you multiply through the homogenous equations. EDIT: Ah missed you edit! I will take a look

Asked by Wireline on 2019-11-05 17:26:08 UTC