How do I test that a grasp is good?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How do I test that a grasp is good?

This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi all,

I am using the example for a grasp, see below. I manipulated the Tgoal a little to make a bad grasp.
I want to evaluate how good the grasp is after closing the fingers. See second last line marked with # TEST HERE:
I looked at and there are some functions to test a grasp that determine if a grasp is "fragile" (in fct testGrasp) or "good" (in fct consumer). However, these functions are used within the class GraspingModel (Gmodel).
I don't know how I can use them in my code below. I also looked at a similar post:, but it didn't help me much either.

Thanks for looking into this.

"""Loads the grasping model and moves the robot to the first grasp found
from openravepy import *
import numpy, time
robot = env.GetRobots()[0]
target = env.GetKinBody('mug1')
gmodel = databases.grasping.GraspingModel(robot,target)
if not gmodel.load():

validgrasps, validindicees = gmodel.computeValidGrasps(returnnum=1)
Tgoal = gmodel.getGlobalGraspTransform(validgrasps[0],collisionfree=True)
basemanip = interfaces.BaseManipulation(robot)
Tgoal[0][3] = Tgoal[0][3]-0.12 # manipulate transform a little along x-axis, so that the robot misses the object (or results in a bad grasp).
taskmanip = interfaces.TaskManipulation(robot)
# TEST HERE: I want to test if the grasp is "good", which means with high certainty can pick up the object without dropping or slipping
testVar = raw_input("Please press a key to exit")