4 import pinocchio
as pin
6 from test_case
import PinocchioTestCase
as TestCase
11 S = pin.Symmetric3.Zero()
12 self.assertTrue(np.allclose(
zero(6), S.data))
15 S = pin.Symmetric3.Identity()
16 id_vec = np.array([1.0, 0.0, 1.0, 0.0, 0.0, 1.0])
17 id_matrix = pin.Symmetric3(id_vec).matrix()
18 self.assertTrue(np.allclose(
eye(3), id_matrix))
19 self.assertTrue(np.allclose(np.array([1.0, 0.0, 1.0, 0.0, 0.0, 1.0]), S.data))
20 self.assertTrue(np.allclose(
eye(3), S.matrix()))
23 S = pin.Symmetric3.Identity()
25 self.assertFalse(np.allclose(
eye(3), S.matrix()))
27 tri_upper = np.triu(S_matrix, k=1)
28 tri_lower = np.tril(S_matrix, k=-1)
29 self.assertTrue(np.allclose(tri_upper, tri_lower.T))
32 S = pin.Symmetric3.Zero()
35 self.assertTrue(np.allclose(
zero(6), S.data))
38 S = pin.Symmetric3.Zero()
40 self.assertTrue(np.allclose(
eye(3), S.matrix()))
43 S = pin.Symmetric3.Zero()
44 S.setDiagonal(np.ones(3) * 2)
45 self.assertTrue(np.allclose(
eye(3) * 2, S.matrix()))
48 if __name__ ==
"__main__":