dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
388 stars 128 forks source link

Implement analytic Jacobian for CartesianToElevationBearingRangeRate. #773

Closed mattbrown11 closed 1 year ago

mattbrown11 commented 1 year ago

Implemented an analytic expression for the Jacobian of CartesianToElevationBearingRangeRate. This is a more-accurate calculation than the baseline numerical Jacobian calculation. Also, on my system, this sped up the calculation from 500 usec to 100 usec.

mattbrown11 commented 1 year ago

The comparison between the current numerically calculated Jacobian and the new analytic Jacobian, assert np.allclose(jac, jac0, atol=5e-6, rtol=1e-5) passed on my system, but the CI failed, likely due to different numerical errors. So, I reduced to assert np.allclose(jac, jac0, atol=5e-4, rtol=1e-5). The current Jacobian isn't a "truth" value, but we'd expect it to be close to the new value.