Пример #1
0
 def test_null4(self):
     (theta, comp) = dcs.quat_angle_diff(self.null_quat, self.quat1)
     self.assertEqual(theta, None)
     for i in range(3):
         self.assertEqual(comp[i], None)
Пример #2
0
 def test_zero_diff3(self):
     (theta,
      comp) = dcs.quat_angle_diff(np.column_stack((self.quat1, self.quat1)),
                                  self.quat1)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #3
0
 def test_zero_diff4(self):
     temp = np.column_stack(
         (self.quat1, self.dq1, self.dq2, self.dqq1, self.dqq2))
     (theta, comp) = dcs.quat_angle_diff(temp, temp)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #4
0
 def test_array3(self):
     (theta, comp) = dcs.quat_angle_diff(np.column_stack((self.quat1, self.quat1, self.dqq1, self.dqq2)), \
         np.column_stack((self.dqq1, self.dqq2, self.quat1, self.quat1)))
     np.testing.assert_array_almost_equal(theta, self.theta[[0, 1, 0, 1]])
     np.testing.assert_array_almost_equal(
         comp, self.comp[:, [0, 1, 0, 1]] * np.array([1, 1, -1, -1]))
Пример #5
0
 def test_zero_diff1(self):
     (theta, comp) = dcs.quat_angle_diff(self.quat1, self.quat1)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #6
0
 def test_nominal2(self):
     (theta, comp) = dcs.quat_angle_diff(self.quat1, self.dqq2)
     np.testing.assert_array_almost_equal(theta, self.theta[1])
     np.testing.assert_array_almost_equal(comp, self.comp[:, 1])
Пример #7
0
 def test_array2(self):
     (theta,
      comp) = dcs.quat_angle_diff(self.quat1,
                                  np.column_stack((self.dqq1, self.dqq2)))
     np.testing.assert_array_almost_equal(theta, self.theta)
     np.testing.assert_array_almost_equal(comp, self.comp)
Пример #8
0
 def test_zero_diff4(self):
     temp = np.column_stack((self.quat1, self.dq1, self.dq2, self.dqq1, self.dqq2))
     (theta, comp) = dcs.quat_angle_diff(temp, temp)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #9
0
 def test_null4(self):
     (theta, comp) = dcs.quat_angle_diff(self.null_quat, self.quat1)
     self.assertEqual(theta, None)
     for i in range(3):
         self.assertEqual(comp[i], None)
Пример #10
0
 def test_zero_diff3(self):
     (theta, comp) = dcs.quat_angle_diff(np.column_stack((self.quat1, self.quat1)), self.quat1)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #11
0
 def test_zero_diff1(self):
     (theta, comp) = dcs.quat_angle_diff(self.quat1, self.quat1)
     np.testing.assert_array_almost_equal(theta, 0)
     np.testing.assert_array_almost_equal(comp, 0)
Пример #12
0
 def test_array3(self):
     (theta, comp) = dcs.quat_angle_diff(np.column_stack((self.quat1, self.quat1, self.dqq1, self.dqq2)), \
         np.column_stack((self.dqq1, self.dqq2, self.quat1, self.quat1)))
     np.testing.assert_array_almost_equal(theta, self.theta[[0, 1, 0, 1]])
     np.testing.assert_array_almost_equal(comp, self.comp[:,[0, 1, 0, 1]] * np.array([1, 1, -1, -1]))
Пример #13
0
 def test_array2(self):
     (theta, comp) = dcs.quat_angle_diff(self.quat1, np.column_stack((self.dqq1, self.dqq2)))
     np.testing.assert_array_almost_equal(theta, self.theta)
     np.testing.assert_array_almost_equal(comp, self.comp)
Пример #14
0
 def test_nominal2(self):
     (theta, comp) = dcs.quat_angle_diff(self.quat1, self.dqq2)
     np.testing.assert_array_almost_equal(theta, self.theta[1])
     np.testing.assert_array_almost_equal(comp, self.comp[:, 1])