commaai / rednose

Kalman filter library
MIT License
370 stars 77 forks source link

Casadi better than sympy #7

Open haraschax opened 3 years ago

haraschax commented 3 years ago

Is casadi a better option for the symbolic solving then sympy?

https://web.casadi.org/

wolterhv commented 3 years ago

This would be interesting to find out, since CasADi seems to have both Python and C++ APIs. Both are capable of generating C code, which would suggest that in speed their maybe quite similar. This article suggests sympy has more "general purpose symbolic abilities", so I guess one way of moving forward with this is determining whether CasADi actually supports all the features of sympy which rednose and openpilot use or could benefit from.

haraschax commented 3 years ago

Interesting. Sympy is quite slow for some of the more complicated jacobians. I assumed this would be better with cassadi, but maybe not.

Sympy also doesn't handle elements, vectors and matrices well together, there is a lot of weird code to deal with that