ikfast free index setting

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ikfast free index setting

amandlek
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:

$ python /usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_0_9/ikfast.py --robot=sawyer_arm_only_rounded.dae --iktype=transform6d --baselink=0 --eelink=11 --freeindex=6 --savefile=sawyer_arm_only_ikfast_solver.cpp

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?






Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ikfast free index setting

JarvisRobot
Hi,amandlek

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.

Best,
Jarvis
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ikfast free index setting

JarvisRobot
update

I use the ikfastdemo.cpp  and then go ahead with the following command:

$ g++ ikfastdemo.cpp -lstdc++ -llapack -o compute -lrt



Then I get an executable programme  "compute". Using this kinematics solver:

./compute fk 0.5 0.5 0.5 0.4 0.5 0.4 0.5



I get the fk solotion:

Found fk solution for end frame:

  Translation:  x: 0.555013  y: 0.554330  z: -0.445436  

     Rotation     -0.748117   0.654960   0.106527  
       Matrix:    0.568134   0.549273   0.612799  
                  0.342846   0.518968   -0.783026  

 Euler angles:
       Yaw:   3.006377    (1st: rotation around vertical blue Z-axis in ROS Rviz)
       Pitch: 0.802276  
       Roll:  0.659598  

  Quaternion:  -0.067323   0.348438   0.877556   0.322420  
               -0.067323 + 0.348438i + 0.877556j + 0.322420k   (alternate convention)


Then I use " baxter_right_ik" generated from the following command to validate the above solution.

$ g++ -lstdc++ -o  baxter_right_ik baxter_right_arm_ikfast_solver.cpp -llapack

To validate the solution:

./baxter_right_ik -0.748117 0.654960 0.106527 0.555013 0.568134 0.549273 0.612799 0.554330 0.342846 0.518968 -0.783026 -0.445436 5
Failed to get ik solution


but no ik solution. Then I tried different free joint with 0 ,1 ,2, 3, ... ,7, the results are same: Failed to get ik solution

In conclusion, I can get the fk solution, but no ik solution.

Do you have any idea?

Best,
Jarvis
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ikfast free index setting

amandlek
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.
Loading...