Skip to content

Conversation

@arihantb2
Copy link

Migrate from Ceres LocalParameterization to Manifold API

Summary

This PR migrates libRSF from Ceres Solver's deprecated LocalParameterization API to the modern Manifold API. This change ensures compatibility with newer versions of Ceres Solver and follows the library's recommended migration path.

Changes

Core API Migration

  • LocalParametrization.h: Migrated all local parameterization classes to use the Manifold API:

    • AngleLocalParameterization: Added Minus() method and updated to AutoDiffManifold
    • UnitCircleLocalParameterization: Added Minus() method with angle extraction logic
    • QuaternionLocalParameterization: Added Minus() method using quaternion error computation
    • All classes now use ceres::Manifold* instead of ceres::LocalParameterization*
    • Changed operator() to Plus() method (required by Manifold API)
  • FactorGraph.cpp: Updated parameter block setup and manipulation:

    • Replaced ProductParameterization with ProductManifold
    • Replaced IdentityParameterization with EuclideanManifold
    • Replaced SubsetParameterization with SubsetManifold
    • Updated SetParameterization() to SetManifold()
    • Updated ParameterBlockLocalSize() to ParameterBlockTangentSize()
  • FactorGraph.h: Updated comment to reflect manifold_ownership instead of deprecated local_parameterization_ownership

Build System Updates

  • CMakeLists.txt: Added glog to the link libraries (required dependency)
  • libRSF.h: Added #include <glog/logging.h> header

GeographicLib Fix

  • FindGeographicLib.cmake: Fixed library name from Geographic to GeographicLib to match the correct library name
  • Updated comments to reflect the correct library name

Technical Details

The Manifold API requires both Plus() and Minus() methods:

  • Plus(x, delta, x_plus_delta): Maps from tangent space to manifold
  • Minus(y, x, y_minus_x): Maps from manifold to tangent space (new requirement)

This migration maintains backward compatibility in terms of functionality while updating to the modern Ceres API.

Testing

  • Verify all existing tests pass
  • Test with Pose2 and Pose3 parameter blocks
  • Verify quaternion and angle parameterizations work correctly
  • Confirm GeographicLib detection works with corrected library name

Compatibility

  • Minimum Ceres Version: Requires Ceres Solver version that supports Manifold API (typically 2.1.0+)
  • Breaking Changes: None for end users, internal API migration only

Related Issues

Addresses compatibility with newer Ceres Solver versions where LocalParameterization is deprecated.

@tipf
Copy link
Member

tipf commented Jan 12, 2026

Hi Arihant, thanks for your PR, give me a few days to check it.
I will also have to update the aged CI pipeline a bit...

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.

2 participants