23 from openravepy
import *
49 gmodel = databases.grasping.GraspingModel(robot=self.
robotrobot,target=self.
targettarget)
50 print 'check if model can be loaded'
52 print 'need to autogenerate model'
64 robot = self.
robotrobot
65 while not robot.GetController().IsDone():
75 robot = self.
robotrobot
81 self.
taskmaniptaskmanip = interfaces.TaskManipulation(self.
robotrobot,graspername=gmodel.grasper.plannername)
85 target = gmodel.target
87 while istartgrasp < len(gmodel.grasps):
88 goals,graspindex,searchtime,trajdata = self.
taskmaniptaskmanip.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.
targettarget.GetName()
125 self.
robotrobot.ReleaseAllGrabbed()
127 print 'success: ',success
129 except planning_error, e:
130 print 'failed to grasp object %s'%self.
targettarget.GetName()
Class to plan a grasp for a given robot and target.
def __init__(self, robot, target)
Constructor.
trajdata
stored trajectory for planned path
def graspObject(self)
Grasps an object.
taskmanip
taskmanipulation problem/module
envreal
environment to be used
def waitrobot(self, robot=None)
Wait for robot to complete action.
gmodel
grasping model for given robot and target