예제 #1
0
    def test_left_jacobian_of_exponential(self):
        tau = np.random.uniform(-np.pi, np.pi)
        R, Jr = SO2.Exp(tau, Jr=True)
        _, Jl = SO2.Exp(tau, Jl=True)

        Ad_R = Jl * (1.0 / Jr)

        self.assertEqual(1.0, Jl)
        self.assertEqual(Ad_R, R.Adj)
예제 #2
0
    def testAdjoint(self):
        for i in range(100):
            theta = np.random.uniform(-np.pi, np.pi)
            R = SO2.fromAngle(theta)
            delta = np.random.uniform(-np.pi, np.pi)

            Adj_R = R.Adj

            Rf = R * SO2.Exp(delta)
            Rf_true = SO2.Exp(Adj_R * delta) * R

            np.testing.assert_allclose(Rf_true.R, Rf.R)
예제 #3
0
    def test_right_jacobian_of_boxplusr(self):
        for i in range(100):
            R = SO2.random()
            theta = np.random.uniform(-np.pi, np.pi)

            R2, Jr = R.boxplusr(theta, Jr=1)
            _, Jr_true = SO2.Exp(theta, Jr=1)

            np.testing.assert_allclose(Jr_true, Jr)
예제 #4
0
    def test_left_jacobian_of_logarithm(self):
        R = SO2.random()
        logR, Jl_inv = SO2.Log(R, Jl=True)
        _, Jl = SO2.Exp(logR, Jl=True)

        self.assertEqual(1/Jl, Jl_inv)
예제 #5
0
    def test_right_jacobian_of_logarithm(self):
        R = SO2.random()
        logR, Jr_inv = SO2.Log(R, Jr=True)
        _, Jr = SO2.Exp(logR, Jr=True)

        self.assertEqual(1/Jr, Jr_inv)
예제 #6
0
    def test_right_jacobian_of_exponential(self):
        tau = np.random.uniform(-np.pi, np.pi)
        R, Jr = SO2.Exp(tau, Jr=True)

        self.assertEqual(1.0, Jr)