Re:How a Kalman filter works, in pictures
by dr-ando on Tuesday December 07, 2021 @03:44PM
(#29477982)
The computational requirements are very modest. The magic is in the math. I'm not sure if it counts as "batteries included" but I wrote a Kalman filter implementation in "no-std" (no standard library) rust called adskalman [1]. This means it can run on very modest bare metal targets with no operating system. Of course, it can also run on targets where the standard library is available and the examples [2] make use of this to do nice things like print the results which can be piped to a file and plotted. The core runs fine on embedded targets, and we use this with arm microcontrollers, but it should work on just about anything. Feedback is welcome.
[1] https://crates.io/crates/adskalman [2] https://github.com/strawlab/adskalman-rs/blob/main/examples/...
Re:How a Kalman filter works, in pictures
by east2west on Tuesday December 07, 2021 @02:55PM
(#29477401)
I believe ROS (Robotic operating system) has good implementations of state estimation algorithms. If you are worried about memory footprint, then Durbin and Koopman ("Time Series Analysis by State Space Methods") has a scalar version of squared-root Kalman filter (it ingests one number at a time rather a whole vector at a time). You may have to implement it yourself though.
Re:How a Kalman filter works, in pictures
by dbcurtis on Tuesday December 07, 2021 @02:37PM
(#29477203)
Totally feasible in microcontroller for small ones and modest update rates, yes. I have worked with robots that had them implemented in slow 8-bit microcontrollers. (I did not do the KF, though).
Re:How a Kalman filter works, in pictures
by jacksonkmarley on Tuesday December 07, 2021 @02:40PM
(#29477237)
> Unfortunately for me, the intuitive part of Kalman filters is easy, but I don't have nearly the kind of grasp of Linear algebra I would need to implement one (I think).
This is me, anyone got a good linear algebra resource to recommend? Ideally one that addresses 'I took linear algebra ages ago in uni but it didn't really stick'.
Re:How a Kalman filter works, in pictures
by east2west on Tuesday December 07, 2021 @03:04PM
(#29477511)
I really like "Linear Algebra and Its Applications" by Gilbert Strang. It is not a textbook, the style is conversational, and he really tries to help you learn. It is one of rare math books that includes reason, context, application, and history without sacrificing rigor. The book also focuses on numerical algorithms aspects more than some popular textbooks, which may be helpful to understanding Kalman filter.
Re:How a Kalman filter works, in pictures
by jacksonkmarley on Tuesday December 07, 2021 @03:49PM
(#29478033)
Thanks for the suggestion!
Re:How a Kalman filter works, in pictures
by sjburt on Tuesday December 07, 2021 @02:58PM
(#29477445)
I think you still need a good grasp of linear algebra and difference equations to identify state variables and correctly set up the “model” or “plant” matrix, this is specific to the system so it can’t be provided by the framework. If you can do this, the rest of the Kalman filter is straightforward and can easily be done in numpy etc.
Re:How a Kalman filter works, in pictures
by salamanderman on Tuesday December 07, 2021 @10:59PM
(#29481114)
If you're willing to just believe that there's a derivation that it works, actually implementing a kalman filter is pretty straightforward. The proof is a pain, but you don't have to be able to derive it to use it.
Re:How a Kalman filter works, in pictures
by CamperBob2 on Wednesday December 08, 2021 @03:13AM
(#29482320)
You might be interested in TinyEKF: https://github.com/simondlevy/TinyEKF
Are there drop in, batteries included, ready to go kalman filter implementations/frameworks for common microcontrollers like arduino and raspberry pi 2040? Or is it infeasible to implement them in limited setups?