Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add NormalError cost function #44

Merged
merged 3 commits into from
May 21, 2024
Merged

Add NormalError cost function #44

merged 3 commits into from
May 21, 2024

Conversation

sarlinpe
Copy link
Member

Mahalanobis distance between two parameters.

Example:

x1 = np.zeros(3)
x2 = np.ones(3)
x1_prior = np.arange(3)
covar = np.eye(3)

prob = pyceres.Problem()
loss = pyceres.TrivialLoss()
prob.add_residual_block(pyceres.factors.NormalPrior(x1_prior, covar), loss, [x1])
prob.add_residual_block(pyceres.factors.NormalError(covar), loss, [x1, x2])

options = pyceres.SolverOptions()
summary = pyceres.SolverSummary()
pyceres.solve(options, prob, summary)
np.testing.assert_allclose(x1, x1_prior, atol=1e-7)
np.testing.assert_allclose(x2, x1, atol=1e-7)

@sarlinpe sarlinpe requested a review from Phil26AT May 17, 2024 16:10
@B1ueber2y
Copy link
Member

Thanks. I confirm that this feature works in my test.

@sarlinpe sarlinpe merged commit 3f34fa4 into main May 21, 2024
6 checks passed
@sarlinpe sarlinpe deleted the sarlinpe/normal-error branch May 21, 2024 12:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants