Skip to content
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

Fixing the EKF example and change linearization point initialization #848

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ProfFan
Copy link
Collaborator

@ProfFan ProfFan commented Aug 15, 2021

This PR tries to change the linearization point to a linear expolation of the current estimate using the previous linearization.

However I found this to be not as useful as it would be in the intended usage in GTSAM:

  1. All GTSAM examples and unit tests for the EKF uses a motion model that does not depend on the future state. i.e. they are all explicit models, thus this change is unnecessary.
  2. Adding this does not break anything, but it does add more runtime complexity (though not too much).

In making this change I also found out that the easyPoint2KalmanFilter example has a typo, which I also fixed.

If we decide that this is unnecessary, I can keep only the typo fix.

@ProfFan ProfFan requested a review from dellaert August 15, 2021 18:53
@@ -58,6 +59,8 @@ class ExtendedKalmanFilter {
protected:
T x_; // linearization point
JacobianFactor::shared_ptr priorFactor_; // Gaussian density on x_
GaussianFactorGraph::shared_ptr lastLinearization;
Copy link
Member

Choose a reason for hiding this comment

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

docs: what are these things?

linearizationPoint.insert(keys[1], x_); // TODO should this really be x_ ?
linearFactorGraph.push_back(motionFactor.linearize(linearizationPoint));

if (lastLinearization != nullptr) {
Copy link
Member

Choose a reason for hiding this comment

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

document! What's happening?

@@ -82,20 +83,38 @@ namespace gtsam {
const auto keys = motionFactor.keys();

// Create a Gaussian Factor Graph
GaussianFactorGraph linearFactorGraph;
GaussianFactorGraph::shared_ptr linearFactorGraph = boost::make_shared<GaussianFactorGraph>();
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change this to a pointer?

@dellaert
Copy link
Member

@ProfFan address comments so we can merge

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