def test_deflate(self): robot_params = RobotParams() robot_params.configure(loadConfigDict()) p = loadParamVec() robot_params.inflate(p) result = robot_params.deflate() self.assertAlmostEqual(numpy.linalg.norm(p - result), 0.0, 6)
def test_deflate(self): robot_params = RobotParams() robot_params.configure(loadConfigDict()) p = loadParamVec() robot_params.inflate(p) result = robot_params.deflate() self.assertAlmostEqual(numpy.linalg.norm(p - result), 0.0, 6)
def test_inflate(self): robot_params = RobotParams() robot_params.configure(loadConfigDict()) robot_params.inflate(loadParamVec()) self.assertEqual(robot_params.dh_chains["chain1"]._config[0,0], -10) self.assertEqual(robot_params.dh_chains["chain2"]._config[1,1], 10) # self.assertEqual(robot_params.tilting_lasers["laserA"]._before_joint.transform[1,3], 20) # self.assertEqual(robot_params.tilting_lasers["laserA"]._after_joint.transform[2,3], 30) self.assertEqual(robot_params.transforms["transformA"].transform[0,3], 40) self.assertEqual(robot_params.rectified_cams["camA"]._config['baseline_shift'], 4) self.assertEqual(robot_params.checkerboards["boardA"]._spacing_x, 30)
def test_inflate(self): robot_params = RobotParams() robot_params.configure(loadConfigDict()) robot_params.inflate(loadParamVec()) self.assertEqual(robot_params.dh_chains["chain1"]._config[0, 0], -10) self.assertEqual(robot_params.dh_chains["chain2"]._config[1, 1], 10) # self.assertEqual(robot_params.tilting_lasers["laserA"]._before_joint.transform[1,3], 20) # self.assertEqual(robot_params.tilting_lasers["laserA"]._after_joint.transform[2,3], 30) self.assertEqual(robot_params.transforms["transformA"].transform[0, 3], 40) self.assertEqual( robot_params.rectified_cams["camA"]._config['baseline_shift'], 4) self.assertEqual(robot_params.checkerboards["boardA"]._spacing_x, 30)