Ejemplo n.º 1
0
    def testStaticGraspExecution(self):
        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.approachToContact()
        GraspitCommander.autoGrasp()
        result = GraspitCommander.computeQuality()

        self.assertAlmostEqual(result.volume, 0.004336969, 4)
        self.assertAlmostEqual(result.epsilon, 0.046997464, 4)
Ejemplo n.º 2
0
    def testStaticGraspExecution(self):
        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.approachToContact()
        GraspitCommander.autoGrasp()
        result = GraspitCommander.computeQuality()

        self.assertAlmostEqual(result.volume, 0.004336969, 4)
        self.assertAlmostEqual(result.epsilon, 0.046997464, 4)
Ejemplo n.º 3
0
    def testFindInitialContact(self):
        # Test equivalence of FindInitialContact and ApproachContact
        #  on the plannerMug world.
        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.findInitialContact()
        robot = GraspitCommander.getRobots().ids[0]
        pose_test = GraspitCommander.getRobot(robot).robot.pose
        GraspitCommander.clearWorld()

        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.approachToContact()
        robot = GraspitCommander.getRobots().ids[0]
        pose_target = GraspitCommander.getRobot(robot).robot.pose

        self.assertTrue(pose_test == pose_target)
Ejemplo n.º 4
0
    def testDynamicGraspExecution(self):
        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.approachToContact()
        GraspitCommander.setDynamics(True)
        self.assertTrue(GraspitCommander.getDynamics())

        GraspitCommander.autoGrasp()
        self.assertFalse(GraspitCommander.dynamicAutoGraspComplete())
        while not GraspitCommander.dynamicAutoGraspComplete():
            time.sleep(0.01)

        self.assertTrue(GraspitCommander.dynamicAutoGraspComplete())
        GraspitCommander.setDynamics(False)
        result = GraspitCommander.computeQuality()

        self.assertAlmostEqual(result.volume, 0.005218228, 4)
        self.assertAlmostEqual(result.epsilon, 0.018258844, 4)
Ejemplo n.º 5
0
    def testDynamicGraspExecution(self):
        GraspitCommander.loadWorld("plannerMug")
        GraspitCommander.approachToContact()
        GraspitCommander.setDynamics(True)
        self.assertTrue(GraspitCommander.getDynamics())

        GraspitCommander.autoGrasp()
        self.assertFalse(GraspitCommander.dynamicAutoGraspComplete())
        while not GraspitCommander.dynamicAutoGraspComplete():
            time.sleep(0.01)

        self.assertTrue(GraspitCommander.dynamicAutoGraspComplete())
        GraspitCommander.setDynamics(False)
        result = GraspitCommander.computeQuality()

        self.assertAlmostEqual(result.volume, 0.005218228, 4)
        self.assertAlmostEqual(result.epsilon, 0.018258844, 4)
Ejemplo n.º 6
0
 def testLoadInvalidWorld(self):
     with self.assertRaises(LoadWorldException):
         GraspitCommander.loadWorld("")
Ejemplo n.º 7
0
 def testLoadWorld(self):
     GraspitCommander.loadWorld("plannerMug")
Ejemplo n.º 8
0
 def testSimAnnPlannerOnPlannerMugWorld(self):
     GraspitCommander.loadWorld("plannerMug")
     r = GraspitCommander.planGrasps(max_steps=60000)
     self.assertGreater(len(r.grasps), 0)
Ejemplo n.º 9
0
 def testSaveImage(self):
     GraspitCommander.loadWorld("plannerMug")
     GraspitCommander.saveImage("test_img")
Ejemplo n.º 10
0
 def testLoadInvalidWorld(self):
     with self.assertRaises(LoadWorldException):
         GraspitCommander.loadWorld("")
Ejemplo n.º 11
0
 def testLoadWorld(self):
     GraspitCommander.loadWorld("plannerMug")