23 from openravepy
import *
49 gmodel = databases.grasping.GraspingModel(robot=self.
robot,target=self.
target)
50 print 'check if model can be loaded'
52 print 'need to autogenerate model'
65 while not robot.GetController().IsDone():
81 self.
taskmanip = interfaces.TaskManipulation(self.
robot,graspername=gmodel.grasper.plannername)
85 target = gmodel.target
87 while istartgrasp < len(gmodel.grasps):
88 goals,graspindex,searchtime,trajdata = self.
taskmanip.GraspPlanning(graspindices=gmodel.graspindices,grasps=gmodel.grasps[istartgrasp:],
89 target=target,approachoffset=approachoffset,destposes=dests,
90 seedgrasps = 3,seeddests=8,seedik=1,maxiter=1000,
91 randomgrasps=
True,randomdests=
True,outputtraj=
True,execute=
False)
96 print 'grasp %d initial planning time: %f'%(graspindex,searchtime)
104 robot.ReleaseAllGrabbed()
116 def runGrasp(envId, robotName, targetName):
117 env = RaveGetEnvironment(envId)
118 robot = env.GetRobot(robotName)
119 target = env.GetKinBody(targetName)
123 print 'grasping object %s'%self.
target.GetName()
125 self.
robot.ReleaseAllGrabbed()
127 print 'success: ',success
129 except planning_error, e:
130 print 'failed to grasp object %s'%self.
target.GetName()