-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SE2(3) representation and Lie group pre-integration of Brossard et al. #1916
base: develop
Are you sure you want to change the base?
SE2(3) representation and Lie group pre-integration of Brossard et al. #1916
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! As I said in the NavState PR, I think:
- I’d opt for landing that PR, maybe with the extendedPose3 tests added, so we just have the one class that does both manifold and Lie: NavState
- Coriolis and earth rotation correction might have to be added in a separate PR, with tests, to make this PR cleaner/smaller
- Focus (IMHO) should be on the “invariant” advantages, I.e., LieGroup integration.
@@ -18,6 +18,7 @@ | |||
|
|||
#pragma once | |||
|
|||
#include <gtsam/geometry/ExtendedPose3.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t see why
@@ -103,6 +103,16 @@ bool NavState::equals(const NavState& other, double tol) const { | |||
&& equal_with_abs_tol(v_, other.v_, tol); | |||
} | |||
|
|||
//------------------------------------------------------------------------------ | |||
#ifdef GTSAM_EXTENDED_POSE_RETRACT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is done for the ImuFactor only, hence I’d prefer a solution that chooses NavState::exmap in the IMUFactor itself, once the other PR lands, if LieGroup integration is selected.
D_dt_R, -I_3x3, Z_3x3, // | ||
D_dv_R, Z_3x3, -I_3x3; | ||
} | ||
const ExtendedPose3 T0(R_, t_, v_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why there are so many changes here?
H2 ? &D_biasCorrected_bias : nullptr); | ||
H2 ? &D_biasCorrected_bias : nullptr); | ||
|
||
// Correct for Earth rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this tested?
NavState state_j = state_i.retract(xi, | ||
H1 ? &D_predict_state : nullptr, | ||
H1 || H2 ? &D_predict_delta : nullptr); | ||
NavState state_j = state_ii.retract(xi, D_predict_state, D_predict_delta); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We. An select here to use expmap based on integration scheme, once NavState has Lie
/** | ||
* @file testLieGroupPreintegration.cpp | ||
* @brief Unit test for the LieGroupPreintegration | ||
* @author Luca Carlone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brossard, Gachter?
@@ -53,7 +53,7 @@ TEST(NavState, Constructor) { | |||
numericalDerivative32(create, kAttitude, kPosition, kVelocity), aH2)); | |||
EXPECT( | |||
assert_equal( | |||
numericalDerivative32(create, kAttitude, kPosition, kVelocity), aH2)); | |||
numericalDerivative33(create, kAttitude, kPosition, kVelocity), aH3)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
@@ -200,10 +200,10 @@ TEST(NavState, Coriolis2) { | |||
} | |||
|
|||
TEST(NavState, Coriolis3) { | |||
/** Consider a massless planet with an attached nav frame at | |||
* n_omega = [0 0 1]', and a body at position n_t = [1 0 0]', travelling with | |||
/** Consider a massless planet with an attached nav frame at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test did not change?
|
||
namespace gtsam { | ||
|
||
#ifdef GTSAM_TANGENT_PREINTEGRATION | ||
typedef TangentPreintegration PreintegrationType; | ||
#else | ||
#ifdef GTSAM_LIEGROUP_PREINTEGRATION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to consider deprecating using compile-time flags in favor of a run-time mechanism.
@stefangachter would it help is #1613 was finished? Your pointers and comments on that PR are immensely helpful. |
Ok, since I have not yet heard yet from @stefangachter , I’ll take a crack at just the most basic group operations, making sure @varunagrawal changes and Brossard’s changes agree. I’ll do the PR straight to develop and then we can merge develop into both the PRs. |
I'm sorry for not getting back to you sooner. I was out of the office and busy with other stuff. I wanted to gain an overview of the different implementations before making a "commitment." (And I am setting up gtsam for development purposes under Windows, which takes its time as well.) |
No worries! I have been reading a lot of papers, and I’m not yet fully sure about which way to go, as I noticed the NavState manifold uses R,p,v and SE2(3) seems to always use R,v,p order. It’s a conundrum how to maintain backwards compatibility with NavState yet also agree with papers. Possibilities:
TBH, if backwards compatibility was not an issue I’d probably opt to split all classes, e.g., Pose3/Transform3, etc., but that’s a can of worms. |
From a state estimation point of view, I would like to be able to choose the composition of the state "freely" and not depend on a particular "structure". Currently, two variables are needed to estimate R, p, and v: 'x' representing pose (R,p) and 'v' representing velocity (v). It would be desirable to have a navigation state as a single variable 'x' but that can be composed of <SE(3), R3> or SE2(3), for example. This is my high-level view. -- I recently looked at https://github.com/aau-cns/Lie-plusplus, which allows compositions of groups.( There are other similar templated libraries for "groups". But I do not have an "overview" of them.) Thus, the navigation state |
All good points, I appreciate the input. I am actually more and more nudging to 3, though, as the most advanced methods now are based on the Equivariant filter, https://ieeexplore.ieee.org/document/9840886. There the distinction between manifold and group is paramount. It is crucial especially, when the manifold, e.g., Unit3, does not admit group operations - but SO(3) "acts" on the sphere. |
Maybe my $0.02 since my state estimation metric paper uses the
|
Thank you for the great reference! I got one question though - the invariant filtering math in this paper is the same as in Grizzle's paper (R. Hartley, M. Ghaffari, R. M. Eustice, and J. W. Grizzle, “Contact-aided invariant extended Kalman filtering for robot state estimation,” Int. J. Robot. Res., vol. 39, no. 4, pp. 402–430, 2020.), correct? The novelty of this paper is more on the slip detection method? Please correct me if I am wrong. |
@dellaert, the code I provide here is a copy of Brossard's. I did not review the code. I adapted it slightly so that I could integrate and test it with the latest |
I’ll take a look at both PRs in detail - don’t worry for now. |
This pull request is to provide a "cleaned-up" version of Brossard's fork: https://github.com/mbrossar/gtsam
The PR adds two cmake options:
GTSAM_LIEGROUP_PREINTEGRATION
andGTSAM_EXTENDED_POSE_RETRACT
GTSAM_LIEGROUP_PREINTEGRATION
enables the Lie group pre-integration as described in https://ieeexplore.ieee.org/document/9519152 (Note that this implementation differs only in the bias update from on-manifold pre-integration, i.e., integration and uncertainty propagation are the same.)GTSAM_EXTENDED_POSE_RETRACT
enables the extended-pose (SE2(3)) retraction in the Lie group pre-integration. This is disabled by default in the source of Brossard. Note that enabling pose retraction might "break" your optimization. It might need a consistent implementation of the extended pose for all the factors.The handling of Earth rotation is enabled by default. See the conversation here #1613 as well.
(Note, the original branch is based on release 4.2. This branch is cherry-picked and not yet "tested".)