def Test1(self): #just visualize a grasp V = Vis() Data = ParseGraspData() Data.parseGraspData() grasp = Data.val_grasp_data[100] Obj = ObjectVis(V) Obj.loadObjectList() Hand = HandVis(V) Hand.loadHand() Obj.loadObject(int(grasp['obj'].strip('obj'))) Hand.globalQuatTranslationMove(grasp['HandRotation'], grasp['HandPosition']) Obj.globalQuatTranslationMove(grasp['ObjRotation'], grasp['ObjPosition']) V.close()
def Test2(self): #visualize a specific grasp V = Vis() Data = ParseGraspData() Data.parseGraspData() Data.parseAllTransforms() grasps = Data.findGrasp(objnum=4, subnum=4, graspnum=11, list2check=Data.all_transforms) for grasp in grasps: Obj = ObjectVis(V) Obj.loadObjectList() Hand = HandVis(V) Hand.loadHand() pdb.set_trace() Obj.loadObject(grasp['obj']) Hand.globalTransformation(grasp['HandTransformation']) Obj.globalTransformation(grasp['ObjTransformation']) V.close()