5 import pinocchio
as pin
10 from test_case
import PinocchioTestCase
as TestCase
17 self.assertApprox(m,
eye(3))
22 self.assertApprox(m,
eye(3))
27 self.assertApprox(v,
zero(3))
32 self.assertApprox(J,
eye(3))
37 self.assertTrue(M.isIdentity())
39 M2 = pin.exp6(np.array(v))
40 self.assertTrue(M2.isIdentity())
45 self.assertApprox(J,
eye(6))
47 J2 = pin.Jexp6(np.array(v))
48 self.assertApprox(J,J2)
51 m = pin.SE3.Identity()
53 self.assertApprox(v.vector,
zero(6))
58 self.assertApprox(v.vector,
zero(6))
61 m = pin.SE3.Identity()
63 self.assertApprox(J,
eye(6))
66 u = np.random.rand((3))
67 v = np.random.rand((3))
70 u_unskew = pin.unSkew(u_skew)
72 self.assertApprox(u,u_unskew)
75 u_v_square = pin.skewSquare(u,v)
77 self.assertApprox(u_v_square,u_skew.dot(v_skew))
80 self.assertApprox(
exp(42), math.exp(42))
81 self.assertApprox(
log(42), math.log(42))
82 self.assertApprox(
exp(
log(42)), 42)
83 self.assertApprox(
log(
exp(42)), 42)
86 self.assertLess(np.linalg.norm(m), np.pi)
87 self.assertApprox(
log(
exp(m)), m)
90 self.assertLess(np.linalg.norm(m), np.pi)
91 self.assertApprox(
log(
exp(m)), m)
94 self.assertApprox(
exp(
log(m)), m)
97 self.assertLess(np.linalg.norm(m), np.pi)
98 self.assertApprox(
log(
exp(m)), m)
100 m = np.random.rand(6)
101 self.assertLess(np.linalg.norm(m), np.pi)
102 self.assertApprox(
log(
exp(m)), m)
105 self.assertApprox(
exp(
log(m)).homogeneous, m)
107 with self.assertRaises(ValueError):
109 with self.assertRaises(ValueError):
111 with self.assertRaises(ValueError):
113 with self.assertRaises(ValueError):
115 with self.assertRaises(ValueError):
119 if __name__ ==
'__main__':
def test_log6_homogeneous(self)