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

Custom factor without Jacobian #1547

Closed
shounak873 opened this issue Jun 18, 2023 · 2 comments
Closed

Custom factor without Jacobian #1547

shounak873 opened this issue Jun 18, 2023 · 2 comments

Comments

@shounak873
Copy link

Hi, I want to create a custom factor but I am not sure how to get the analytic Jacobian. Can I just create the factor with the error formula z - f(x) and let gtsam calculate the Jacobian numerically?

@yetongumich
Copy link
Contributor

yetongumich commented Jun 20, 2023

You create a custom function that computes z-f(x). Then, in the evaluateError function of your customized factor, you can call the numericalDerivative function to compute the Jacobian numerically.
Examples in testNumericalDerivative.cpp will help you get familiar with the function.

@goodgoodliving
Copy link

goodgoodliving commented Oct 27, 2023

You create a custom function that computes z-f(x). Then, in the evaluateError function of your customized factor, you can call the numericalDerivative function to compute the Jacobian numerically. Examples in testNumericalDerivative.cpp will help you get familiar with the function.

@yetongumich
Hello, may I ask if it's possible to automatically solve for the Jacobian using GTSAM if I'm implementing a custom factor in Python, where I only know the error function and am not familiar with how to perform the Jacobian calculation? Are there relevant interfaces for this in GTSAM?

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

No branches or pull requests

3 participants