Importantly, I removed all the pedestal links/ joints from the urdf file before running ikfast. The srdf will require some modification too to work with the above plugin. If you would like my modified urdf/ srdf files let me know and I'll email them to you.
I then use the following commands in a python script (generating the ik database this way has some advantages - see ikfast documentation):
If you prefer the command line method, try removing all the pedestal bodies from the urdf file before converting to collada. I believe you don't need to explicitly specify any free indices if you remove the pedestal bodies, ikfast will figure it out for you. Obviously the link ID's will change too.
Another thing to check is that you are using sympy version 0.7.1. Ikfast doesn't seem to play nice with other versions.
I began to try your suggestion but I think we are working on different problems. I'm not trying to use the Sawyer arm in OpenRAVE. Instead, I'm trying to generate an IKFast plugin for use in MoveIt! following these instructions. (These are for the Baxter robot but they are fairly easy to modify for Sawyer.)
Also, I checked my version of sympy and it is 0.7.1.
I'm not sure how to import the model of my arm since it is in collada format (.dae file).
In the meantime, I reduced my original URDF even further so now it contains only the arm links and joints but I still get the error "__main__.CannotSolveError: 'need 6 joints'" when trying to generate the IKFast plugin.
BTW, I tried generating an IKFast plugin from another URDF I have (with only 6-DOF instead of 7) and it worked fine so at least I known my OpenRAVE and ikfast installations are working.
Thanks for the link. I gave that a try and now my model loads (see screen capture below) and generating the IK solver hangs (I've been waiting over 30 minutes on an 3.6 Ghz i7 with 64 Gb RAM). The screen messages look like this:
WARNING: QApplication was not created in the main() thread.
/usr/local/lib/python2.7/dist-packages/openravepy/_openravepy_/ikfast.py:1123: RuntimeWarning: invalid value encountered in divide
axisangle /= angle
No handlers could be found for logger "openravepy.ikfast"
Seems to hang forever at this point...
My python test file looks like this:
"""Shows how to get all 6D IK solutions.
from openravepy import *
import numpy, time
env = Environment() # create the environment
env.SetViewer('qtcoin') # start the viewer
env.Load('./sawyer_arm_env.xml') # load a scene
robot = env.GetRobots() # get the first robot
manip = robot.SetActiveManipulator('right_arm') # set the manipulator to right_arm
ikmodel = databases.inversekinematics.InverseKinematicsModel(robot,iktype=IkParameterization.Type.Transform6D)
if not ikmodel.load():
print "IK solver created!"
with env: # lock environment
Tgoal = numpy.array([[0,-1,0,-0.21],[-1,0,0,0.04],[0,0,-1,0.92],[0,0,0,1]])
sol = manip.FindIKSolution(Tgoal, IkFilterOptions.CheckEnvCollisions) # get collision-free solution
with robot: # save robot state
robot.SetDOFValues(sol,manip.GetArmIndices()) # set the current solution
Tee = manip.GetEndEffectorTransform()
env.UpdatePublishedBodies() # allow viewer to update new robot
raveLogInfo('Tee is: '+repr(Tee))
The urdf plugin helps you import the model into openrave as a robot kinbody and then use that robot interface for the ikfast database generator, as you have done in your python script. Either way is fine though.
Anwyay, try change <base>right_arm_base_link</base> to <base>base</base> and <effector>right_gripper</effector> to <effector>right_hand</effector> in your xml file (assuming you are using the urdf file from the RethinkRobotics git repo).
We still haven't solved this problem and we have tried everything except the plugin you reference below. It would be great if you could email me your urdf/srdf files for your Sawyer arm since that might be our only hope!