How do I test that a grasp is good?

classic Classic list List threaded Threaded
1 message Options
Uli
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How do I test that a grasp is good?

Uli
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 grasping.py 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: http://openrave-users-list.185357.n3.nabble.com/grasp-assessment-td2624567.html, but it didn't help me much either.

Thanks for looking into this.
Uli

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

validgrasps, validindicees = gmodel.computeValidGrasps(returnnum=1)
gmodel.moveToPreshape(validgrasps[0])
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).
basemanip.MoveToHandPosition(matrices=[Tgoal])
robot.WaitForController(0)
taskmanip = interfaces.TaskManipulation(robot)
taskmanip.CloseFingers()
robot.WaitForController(0)
# 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")
Loading...