Skip to content

Expose Sophus::interpolate to Python bindings for SO2/3 and SE2/3#560

Open
SidArora29 wants to merge 2 commits into
strasdat:mainfrom
SidArora29:feature/expose-interpolate-python
Open

Expose Sophus::interpolate to Python bindings for SO2/3 and SE2/3#560
SidArora29 wants to merge 2 commits into
strasdat:mainfrom
SidArora29:feature/expose-interpolate-python

Conversation

@SidArora29

Copy link
Copy Markdown

Description

This PR exposes the Sophus::interpolate function to the Python bindings for the following Lie Groups:

  • SO2 and SO3
  • SE2 and SE3

Interpolation on the manifold is a key utility for state estimation and perception workflows in Python, such as:

  1. Synchronizing high-frequency IMU data with lower-frequency sensor frames (camera/LiDAR).
  2. Motion compensation in LiDAR SLAM pipelines.
  3. Keyframe trajectory smoothing.

Implementation Details

The template function Sophus::interpolate is bound at the module level in sophus_pybind/bindings.cpp for the double-precision variants, maintaining consistency with existing bound types.

Testing

Verified the implementation locally by confirming that the logarithmic map of the interpolated midpoint matches the expected geodesic midpoint on the manifold:

import sophus_pybind as sp
import numpy as np

p0 = sp.SE3()
p1 = sp.SE3.exp([1.0, 0.5, -0.2], [0.1, -0.3, 0.5])
p_mid = sp.interpolate(p0, p1, 0.5)

assert np.allclose(p_mid.log(), 0.5 * p1.log())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant