예제 #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])