2 import pinocchio
as pin
10 self.assertTrue(np.allclose(
zero(3), v.linear))
11 self.assertTrue(np.allclose(
zero(3), v.angular))
12 self.assertTrue(np.allclose(
zero(6), v.vector))
18 self.assertFalse(np.allclose(
zero(3), v.linear))
19 self.assertFalse(np.allclose(
zero(3), v.angular))
20 self.assertFalse(np.allclose(
zero(6), v.vector))
26 self.assertTrue(np.allclose(
zero(3), v.linear))
27 self.assertTrue(np.allclose(
zero(3), v.angular))
28 self.assertTrue(np.allclose(
zero(6), v.vector))
34 self.assertTrue(np.allclose(v.linear, lin))
37 self.assertTrue(v.linear[1] == 1.)
43 self.assertTrue(np.allclose(v.angular, ang))
46 self.assertTrue(v.angular[1] == 1.)
52 self.assertTrue(np.allclose(v.vector, vec))
55 v1 = pin.Motion.Random()
56 v2 = pin.Motion.Random()
57 self.assertTrue(np.allclose((v1+v2).vector,v1.vector + v2.vector))
58 self.assertTrue(np.allclose((v1 - v2).vector, v1.vector - v2.vector))
62 v = pin.Motion.Random()
63 self.assertTrue(np.allclose((m * v).vector, m.action.dot(v.vector)))
64 self.assertTrue(np.allclose(m.act(v).vector, m.action.dot(v.vector)))
65 self.assertTrue(np.allclose((m.actInv(v)).vector, np.linalg.inv(m.action).dot(v.vector)))
66 self.assertTrue(np.allclose((v ^ v).vector,
zero(6)))
70 m = pin.Motion.Random()
73 m_from_array = pin.Motion(m_array)
75 self.assertTrue(m_from_array == m)
78 for _
in range(100000):
79 v = pin.Motion.Zero() + pin.Motion.Zero()
80 self.assertTrue(np.allclose(v.vector,
zero(6)))
82 if __name__ ==
'__main__':
def test_se3_action(self)
def test_set_linear(self)
def test_several_init(self)
def test_set_angular(self)
def test_set_vector(self)
def test_internal_sums(self)
def test_zero_getters(self)
def test_conversion(self)