Skip to content

EquivariantFilter and GroupAction#2197

Merged
dellaert merged 79 commits intoborglab:developfrom
jenniferoum:feature/equivariant-filter
Dec 21, 2025
Merged

EquivariantFilter and GroupAction#2197
dellaert merged 79 commits intoborglab:developfrom
jenniferoum:feature/equivariant-filter

Conversation

@jenniferoum
Copy link
Contributor

@jenniferoum jenniferoum commented Jul 10, 2025

Overview

This PR templates the Equivariant Filter on Group and Manifold structures, reorganizing the ABC (Attitude-Bias-Calibration) system into a more modular and generic architecture. The changes separate geometry-specific definitions from filter-specific functions and provide a reusable framework for equivariant filtering.

Key Changes:

  • Introduces generic EquivariantFilter class templated on manifold state and symmetry group
  • Moves ABC geometry definitions to gtsam_unstable/geometry/ABC.h
  • Adds GroupAction base class for defining group actions on manifolds
  • Refactors ManifoldEKF to expose reusable Kalman gain and Joseph update methods
  • Renamed ABC_EQF_Demo to AbcEquivariantFilterExample.cpp

Testing

  • unit tests in testEquivariantFilter and testABC
  • Example runs and gives same results as Fornasier:
[100%] Built target AbcEquivariantFilterExample
ABC-EqF: Attitude-Bias-Calibration Equivariant Filter Demo
==============================================================
Loading data from /Users/dellaert/git/github/examples/Data/EqFdata.csv............... Done!
Loaded 12001 data points
Processing 12001 data points with EqF...
Progress: ........... Done!

=== Filter Performance Summary ===
Processing time: 2.33972 seconds
Processed measurements: 24002 (valid: 4923)

-- Average Errors --
Attitude: 1.13084°
Bias: 0.00754989
Calibration: 0.957467°

-- Final Errors --
Attitude: 3.66202°
Bias: 0.00206526
Calibration: 0.364382°

-- Final State vs Ground Truth --
Attitude (RPY) - Estimate:  -13.8045 -0.642714   86.7444° | Truth: -17.4067 -1.04149  86.2702°
Bias - Estimate: 0.00468984 0.00994432 0.00194401 | Truth: 0.00399696 0.00799933 0.00189684
Calibration (RPY) - Estimate: 24.8167 5.05822  29.674° | Truth: 25  5 30°

EqF demonstration completed successfully.
[100%] Built target AbcEquivariantFilterExample.run

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice progress! Some initial comments.

…equire for template, change EqF to take in initial state, use traits for group
@jenniferoum jenniferoum force-pushed the feature/equivariant-filter branch from 73215df to 4ee2efe Compare July 30, 2025 17:20
@AlessandroFornasier
Copy link

Nice to see this one in gtsam 👍🏻

@dellaert
Copy link
Member

Thans @AlessandroFornasier !We're going to substantially rewrite and base on LieGroupEKF (or derived), we'll let you know :-)

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good meeting. Trying to give some more feedback here. The goal is whether we can get rid of Geometry altogether.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR templates the Equivariant Filter on Group and Manifold structures, reorganizing the ABC (Attitude-Bias-Calibration) system into a more modular and generic architecture. The changes separate geometry-specific definitions from filter-specific functions and provide a reusable framework for equivariant filtering.

Key Changes:

  • Introduces generic EquivariantFilter class templated on manifold state and symmetry group
  • Moves ABC geometry definitions to gtsam_unstable/geometry/ABC.h
  • Adds GroupAction base class for defining group actions on manifolds
  • Refactors ManifoldEKF to expose reusable Kalman gain and Joseph update methods

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
gtsam_unstable/geometry/ABC.h Defines ABC-specific geometry: State, Group, Symmetry, Lift, Input/Output actions
gtsam/navigation/EquivariantFilter.h Generic equivariant filter implementation templated on manifold and symmetry
gtsam/base/GroupAction.h CRTP base class and helpers for group actions (Orbit, Diffeomorphism, InducedVectorField)
gtsam/navigation/ManifoldEKF.h Refactored to expose KalmanGain() and JosephUpdate() as reusable methods
gtsam/base/ProductLieGroup.h Changed Jacobian typedefs from protected to public for external access
gtsam/geometry/Unit3.h/cpp Added cross product methods with Jacobian support for Unit3 x Unit3/Point3
gtsam_unstable/geometry/tests/testABC.cpp Comprehensive test suite for ABC components
gtsam/navigation/tests/testEquivariantFilter.cpp Tests generic filter with simple SO(3) attitude example
examples/AbcEquivariantFilterExample.cpp Updated example using new API structure
examples/ABC_EQF.h, examples/ABC.h Removed (functionality moved to library)

@dellaert dellaert changed the title Template EqF on Group and Manifold EquivariantFilter and GroupAction Dec 10, 2025
@dellaert
Copy link
Member

@AlessandroFornasier want to take a new look? I think we successfully replicated your paper in an elegant framework now.

@dellaert dellaert requested a review from scottiyio December 10, 2025 22:28
Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Scott

Copy link
Contributor

@scottiyio scottiyio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to check on the notation of z - zhat

Copy link

@AlessandroFornasier AlessandroFornasier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM. Nice job! I am very happy to see this within GTSAM!

* @return MatrixM The calculated error dynamics matrix A.
*/
template <typename Lift, typename InputOrbit>
MatrixM computeErrorDynamicsMatrix(const InputOrbit& psi_u) const {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioning only for future work.

An EqF can still be designed even if a compatible action psi is not found. Current version seems to not support this case. Could be a nice addition in future.

In such case you would have something like the following:

//...
typename Symmetry::Orbit act_on_x(this->X_);
typename Symmetry::Orbit coords_act(act_on_x(traits<G>::Identity()));

coords_act(g_.inverse(), D_phi);

Lift lift_u_origin(u);
lift_u_origin(act_on_ref_(g_), &D_lift);

return D_phi * D_lift

* P = (I - K * H) * P * (I - K * H)^T + K * R * K^T
*/
template <typename VectorZ, typename MatrixZM, typename MatrixZ>
void updateInternal(const VectorZ& innovation, const MatrixZM& H,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioning only for future work.

A reset step (also called curvature correction) could be implemented in the update and enabled under a flag eventually. See page 38-39 https://arxiv.org/pdf/2407.14297

const Vector3 nu = wedge_d * transformed_y;

if (H) {
*H = measurementMatrixC<N>(d_, index_);
Copy link

@AlessandroFornasier AlessandroFornasier Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question out of curiosity. Any plan to extend this to support measurementMatrixCStar ? Reference to equations 3.24-3.25 page 34 https://arxiv.org/pdf/2407.14297

@AlessandroFornasier
Copy link

One more thing, maybe EKF-variants.md should be extended?

@dellaert
Copy link
Member

Thanks a bunch, @scottiyio and @AlessandroFornasier ! I will keep some of these as future work (non equivariant input, and equivariant output), but will address the rest. In a meeting with Stephan I also simplified the abc::Group.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Copy link
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone! A team effort, and great reviews! I will merge now!

@dellaert dellaert merged commit ef33d45 into borglab:develop Dec 21, 2025
34 checks passed
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.

6 participants