5 import pinocchio
as pin
7 from test_case
import PinocchioTestCase
as TestCase
12 m = pin.SE3.Identity()
13 m.translation = np.array([1.0, 2.0, 3.0])
14 m.rotation = np.array(
15 [[1.0, 0.0, 0.0], [0.0, 0.0, -1.0], [0.0, 1.0, 0.0]]
18 pin.SE3ToXYZQUAT(m).T, [1.0, 2.0, 3.0, sqrt(2) / 2, 0, 0, sqrt(2) / 2]
21 pin.XYZQUATToSE3([1.0, 2.0, 3.0, sqrt(2) / 2, 0, 0, sqrt(2) / 2]), m
24 pin.XYZQUATToSE3(np.array([1.0, 2.0, 3.0, sqrt(2) / 2, 0, 0, sqrt(2) / 2])),
27 with self.assertRaises(ValueError):
28 pin.XYZQUATToSE3([1.0, 2.0, 3.0])
29 with self.assertRaises(ValueError):
30 pin.XYZQUATToSE3(np.array([1.0, 2.0, 3.0, sqrt(2) / 2]))
33 self.assertFalse(isapprox(1, 2))
34 self.assertTrue(isapprox(1, 2, 10))
35 self.assertFalse(isapprox([1e10, 1e-7], [1.00001e10, 1e-8]))
36 self.assertTrue(isapprox([1e10, 1e-8], [1.00001e10, 1e-9], 1e-5))
39 if __name__ ==
"__main__":