My colleagues and I have been trying for quite some time to get IK Fast to build for the Sawyer Arms. We managed to generate the cpp file by writing an "arm only" version of the urdf file and generating a dae file and then rounding it, and then running the following command:
We then generated an executable (sawyer_arm_only_ik) by compiling the generated cpp file and also used the ikfastdemo.cpp file from the clam_ik package to generate a more friendly version of the executable (demo_sawyer_arm_only_ik) that can do both forward kinematics and inverse kinematics.
We tried using forward kinematics with all joint angles at 0 using the following command:
$ ./demo_sawyer_arm_only_ik fk 0 0 0 0 0 0 0
We then took the resulting translation and quaternion and fed it back into the ik using this command:
$./demo_sawyer_arm_only_ik ik 1.060888 0.158851 0.315679 -0.453170 0.542325 -0.455611 0.541239 0
where the last 0 is the value of the free parameter. The executable keeps returning "Failed to get ik solution" no matter what we set the free parameter to.
When we generated the cpp file, we set the free index to 6 after trying all possible values (this is the only one that worked). We don't know what the free index exactly means - and what value for the free parameter to specify when running the ik executable. We suspect it's something to do with the fact that the Sawyer arm is 7 DOF and only 6 DOF is necessary for control.
Does anyone have a good understand of the free parameter and how we can get ikfast to work with the Sawyer robot arm?
As far as I know, for a 6 DOF arm, the whole 3D space is reachable, but sometimes the arm may face the problem of singularity, or need to avoid obstacles, or overcome the joint limits, in these cases, 7 DOF arm performs better. So when we calculate the IK solution, it makes the calculation simpler to set one parameter( i.e. joint) as free. This joint could be set as 0 or any other legal values.
BTW, I am using Baxter with two 7 DOF arms. Now I am struggling to use the IK API in baxter_arm_ikfast_solver.cpp. I don't know how to use the generated solver in Baxter with my own code. For example, given a world coordination, it returns a solver of 7 joint values. Anyone can provide any help would be highly appreciated.
We're having the same problem. I think the last argument to the ik executable should be the value for the free joint, not the index. The free joint index was probably specified when you generated the cpp code. However, we're still unable to set this value correctly.