Skip to content

4 legged state estimators#2470

Merged
dellaert merged 7 commits intodevelopfrom
feature/leggedEstimators
Mar 17, 2026
Merged

4 legged state estimators#2470
dellaert merged 7 commits intodevelopfrom
feature/leggedEstimators

Conversation

@dellaert
Copy link
Copy Markdown
Member

@dellaert dellaert commented Mar 15, 2026

4 simple legged-robot state estimators, based on IMU-propagation and recorded body-frame foot positions.

  • The "invariant filter" is a simplified version of Ross Hartley's filter: we only update at footfalls and every 100ms after that, and we use a simpler noise model
  • The second filter replaces update with a factor-graph based update step
  • The third legged estimator is a fixed-lagged smoother over a longer time window, using the ImuFactor2
  • The fourth uses the CombinedImuFactor2 to estimate changing biases.

The included notebook showcases the first three.

stairs_side

Animation
IkInitializer
Blend with P0
Fix height
Height-prior API
Kill Shared front-end
Simplify height prior API
Simplify to ExtendedPose3d
Kill non-invariant filter
Removed the flat-ground detector
Debugging smoother
Flat piece
Revise language
Showcase variants on staircase
Legged estimator core
@dellaert dellaert requested a review from Copilot March 15, 2026 23:10
Copy link
Copy Markdown
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 introduces a set of legged-robot state estimator implementations (EKF/IEKF + fixed-lag smoothers) and provides both C++ and Python replay/visualization utilities with accompanying test coverage.

Changes:

  • Added C++ legged estimator runtime API (4 variants) plus new factor definitions and Jacobian tests.
  • Added Python helper module to load the staircase dataset, replay estimators, and generate Plotly animations/GIFs, along with smoke/wrapper tests.
  • Added a C++ replay example and bundled staircase CSV dataset files.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
python/gtsam/tests/test_LeggedEstimatorExample.py Adds Python smoke tests for dataset replay and visualization helpers.
python/gtsam/tests/test_LeggedEstimator.py Adds Python wrapper tests for runtime API (e.g., height prior toggling).
python/gtsam/tests/test_ExtendedPose3.py Adds a test for the new Python alias ExtendedPose3d.
python/gtsam/examples/LeggedEstimatorExample.py Implements Python dataset loading, replay utilities, and Plotly animation helpers.
gtsam/navigation/tests/testLeggedEstimatorFactors.cpp Adds Jacobian regression tests for new legged estimator factors.
gtsam/navigation/tests/testLeggedEstimator.cpp Adds unit tests covering estimator behavior across variants (init, priors, marginalization, etc.).
gtsam/navigation/navigation.i Exposes new legged estimator API to Python via SWIG.
gtsam/navigation/LeggedEstimatorFactors.h Introduces factor classes used by graph-based estimation variants.
gtsam/navigation/LeggedEstimator.h Adds the public C++ API for legged estimator variants and shared params.
gtsam/navigation/LeggedEstimator.cpp Implements prediction/update logic for EKF/IEKF and fixed-lag smoothers.
gtsam/geometry/tests/testExtendedPose3.cpp Updates tests to rely on the new dynamic-k alias type name.
gtsam/geometry/geometry.i Adds SWIG wrapping for ExtendedPose3d.
gtsam/geometry/ExtendedPose3.h Renames/introduces the dynamic-k alias to ExtendedPose3d.
examples/legged/LeggedEstimatorReplayUtils.h Adds CSV dataset parsing and replay output helpers for the C++ example.
examples/LeggedEstimatorReplayExample.cpp Adds a CLI replay runner that outputs trajectories/metrics for all variants.
examples/Data/legged_staircase/metadata.csv Adds staircase dataset metadata used by replay utilities.
examples/Data/legged_staircase/contacts.csv Adds staircase dataset contact events CSV used by replay utilities.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown

timeSFMBAL benchmark

  • Head: 801cef6f984c7542f05904e2d5948f39f3d5839e
  • Base: 7e2e3f29b2ea3625704cd4e1894ae706ca860f09
Runner Metric Base (s) Head (s) Delta (s) Change
linux-arm64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 9.185988 9.450714 +0.264725 +2.88%
linux-arm64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 12.452509 12.679555 +0.227046 +1.82%
linux-arm64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 5.299601 5.701141 +0.401540 +7.58%
linux-arm64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 9.265238 9.457033 +0.191795 +2.07%
linux-x64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 11.033954 11.048577 +0.014623 +0.13%
linux-x64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 17.719688 17.774051 +0.054363 +0.31%
linux-x64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 7.040127 7.020795 -0.019332 -0.27%
linux-x64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 15.012873 15.008655 -0.004219 -0.03%
macos-arm64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 21.144223 30.578961 +9.434738 +44.62%
macos-arm64-tbbOFF timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 12.130081 15.987709 +3.857628 +31.80%
macos-arm64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalCholesky 33.553744 21.103885 -12.449859 -37.10%
macos-arm64-tbbON timeSFMBAL/dubrovnik-135-90642-pre.txt/MultifrontalSolver 19.269917 13.730561 -5.539355 -28.75%

Worker runs

Role Runner SHA Conclusion
head linux-x64 801cef6f984c7542f05904e2d5948f39f3d5839e success
base linux-x64 7e2e3f29b2ea3625704cd4e1894ae706ca860f09 success
head linux-arm64 801cef6f984c7542f05904e2d5948f39f3d5839e success
base linux-arm64 7e2e3f29b2ea3625704cd4e1894ae706ca860f09 success
head macos-arm64 801cef6f984c7542f05904e2d5948f39f3d5839e success
base macos-arm64 7e2e3f29b2ea3625704cd4e1894ae706ca860f09 success

dellaert and others added 2 commits March 16, 2026 10:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dellaert dellaert merged commit b068bc0 into develop Mar 17, 2026
32 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.

3 participants