def test_ENU_camera_w_photosphere(self): # Make sure we agree with conventions at # https://developers.google.com/streetview/spherical-metadata pitch = 0.1 roll = 0.1 wRt = Rot3.ENU_camera(pitch=pitch, roll=roll) expected_wRr = Rot3.Rx(pitch) * Rot3.Ry(roll) # from rotated to ENU # But our tilted frame uses the camera convention. # TODO: maybe it should not! Why do we do this? expected_wRt = Rot3(expected_wRr * ENU_R_CAMERA) np.testing.assert_array_almost_equal( wRt.matrix(), expected_wRt.matrix(), decimal=2 )
def test_ENU_camera(self): d = 0.1 # positive pitch wRt = Rot3.ENU_camera(pitch=d) expected = np.transpose(np.array([[1, 0, 0], [0, d, -1], [0, 1, d]])) np.testing.assert_array_almost_equal(wRt.matrix(), expected, decimal=2)