Open jchoclin-kudan opened 3 years ago
I experienced the same thing with my own customized edge. After some digging, I found that the numerical differentiation implementation in g2o (for BaseFixedSizedEdge at least) currently use a fixed step size of 1e-9. This is probably not a good idea. Even though that numerical jacobian inherently has accuracy issue, there are better ways to decide the step size.
In short, I don't think failing the current numerical test would indicate the analytical jacobian is wrong. Therefore, debugging one's own analytical jacobian implementation remains a tricky task. Hopefully, we can have auto diff soon.
Hi everybody, I am trying to define a new edge for G2o based on the sba/Stereo_xyz_onlypose but I am using the inverse of the distance from a rgbd image. The problem that I have is when I test it based on the evaluate_jacobian.h tests. I keep having differences between my analytically derivated Jacobian and the numerically generated Jacobian generated by the test:
As you can see below, the numerically estimated Jacobian does not match on several elements from my Jacobian. I tested this and experimentally my Jacobian is working fine. That gives me confidence on my Jacobian derivation and I reviewed it thoughtfully, so I do not think there is something wrong with it. But still the test keeps failing. If you have any ideas on what is going on, it would be really appreciated.
My edge definition:
The unit test that I am using (it is the same test from this repo but we use the catch framework):
The results that I’m getting: