Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Kernel

Kernels are mostly internal data structures for dealing with the exponential map and logarithm of Lie groups such as SO(3)SO(3) and SE(3)SE(3). The gtsam.so3 classes evaluate the scalar functions used by the SO(3)SO(3) exponential-map Jacobian and its inverse: Kernel represents a forward kernel, while InvJKernel couples the inverse Jacobian to its forward counterpart for stable evaluation.

Open In Colab
import gtsam
import numpy as np

Obtaining the kernels

Users normally obtain these objects from so3.DexpFunctor, which precomputes coefficients for a rotation vector and handles the near-zero series expansions.

omega = np.array([0.1, -0.2, 0.3])
dexp = gtsam.so3.DexpFunctor(omega)
jacobian_kernel = dexp.Jacobian()
inverse_kernel = dexp.InvJacobian()

so3.Kernel

left() and right() return the left and right Jacobian matrices. applyLeft(v) and applyRight(v) apply those matrices to a vector without requiring callers to form the product themselves. frechet() and applyFrechet() expose derivatives of the kernel action.

J_left = jacobian_kernel.left()
vector = np.array([1.0, 2.0, -1.0])
np.testing.assert_allclose(
    jacobian_kernel.applyLeft(vector), J_left @ vector, atol=1e-12
)
print("left Jacobian:")
print(J_left)

so3.InvJKernel

left() and right() return inverse Jacobians, and applyLeft()/applyRight() apply them. Its public J property retains the associated forward kernel.

J_left_inverse = inverse_kernel.left()
np.testing.assert_allclose(J_left_inverse @ J_left, np.eye(3), atol=1e-12)
np.testing.assert_allclose(
    inverse_kernel.applyLeft(vector), J_left_inverse @ vector, atol=1e-12
)

Source

Kernel.h

AI assistance caveat

AI was used to help draft this documentation, and inaccuracies could be present.