#FormaK

2024-02-22

#FormaK also accepts bug reports or suggestions for improving the library as well outside of the roadmap/enhancement process. I’d love to get feedback from you on use cases you’re considering, features that’d be useful to you, missing tests, bugs you’ve found, you name it

If you’re interested in contributing, more information can be found at github.com/buckbaskin/formak/b

2024-02-21

The #FormaK project now has a publicly available roadmap via GitHub Issues.

Issues tagged enhancement are under consideration and welcome feedback on if they’d provide value for your use case or tests that’d be required to support your use case
github.com/buckbaskin/formak/l

2023-11-01

@formak I wrote up a post about developing the latest feature for #FormaK and the ups and downs along the way

In the middle there was a nice visual of the sensor bias, but only by way of a long detour into unnecessary work that was removed before the PR merged

buckbaskin.com/blog/strapdown-

A 2D plot of rocket velocity in the X and Y plane when stopped at the launch pad. The reference remains at the origin 0, 0 while over time the model shows the data drift in a line from 0, 0 to about 0.10, 0.25 (units are m/sec, not shown)
2023-10-31

The latest feature for #FormaK: a reference implementation of a #strapdown #IMU!

Goals for the reference model:

1. Provide an example for what a more complicated model looks like in FormaK
2. Provide a composable implementation of a strapdown IMU that can be built into other models

The learnings from this model will also inspire some new work coming soon!

As always, the reference model can be compiled into #Python and #Cpp

Github: github.com/buckbaskin/formak/p

2023-09-28

The latest feature for #FormaK: innovation filtering!

The previous implementation provided the math for the EKF process update and sensor update; however, that leaves the models open to spurious readings. This can make the filter hard to use (correctly).

Innovation filtering removes updates that are out of distribution to reject the spurious reading and maintain a robust state estimate

As always, the #KalmanFilter comes in #Python and #Cpp

Github: github.com/buckbaskin/formak/p

2023-09-19

The latest feature for #FormaK: a managed #KalmanFilter runtime!

I'd been stuck trying to simplify the complexity of managing a process and multiple sensor models since I introduced calibration (which added more complexity... not helping...). In the end I landed on a single tick function call with a dose of #SFINAE that handles sensors of any type and takes care of the rest under the hood.

As always, it comes in #Python and #Cpp

Github: github.com/buckbaskin/formak/p

2023-08-08

New feature launch for #FormaK: a managed #KalmanFilter runtime!

I'd been stuck trying to simplify the complexity of managing a process and multiple sensor models since I introduced calibration (which added more complexity... not helping...). In the end I landed on a single tick function call with a dose of #SFINAE that handles sensors of any type and takes care of the rest under the hood.

As always, it comes in #Python and #Cpp

Blog: buckbaskin.com/blog/formak-run
Github: github.com/buckbaskin/formak/p

C++ Code with a call to a function named tick. The first argument is a time output_dt, then an argument control, followed by a vector of sensor readings. Each sensor reading is encapsulated into a function call wrap which is templated with the type of the reading called Simple.

Text Code Snippet:
mf.tick(options.output_dt, control,
        {
            mf.wrap<Simple>(options.reading_dt_base + 0.05,
                            SimpleOptions{}),
            mf.wrap<Simple>(options.reading_dt_base + 0.06,
                            SimpleOptions{}),
            mf.wrap<Simple>(options.reading_dt_base + 0.07,
                            SimpleOptions{}),
        });

Full code available at https://github.com/buckbaskin/formak/pull/17/files
2023-07-04

New feature launch for #FormaK: Calibration!

This feature started with a straightforward idea: use FormaK to model a #rocket launch based on #NASA data. Unfortunately, FormaK was missing support for orienting the IMU in the rocket's frame. To fix this, I added calibration support for sensor and process models with the same syntax that supports states and control inputs.

New features coming soon!

NASA data: data.nasa.gov/Aerospace/Deorbi
Blog: buckbaskin.com/blog/calibratio
Github: github.com/buckbaskin/formak/p

2023-05-07

There’s also the persnickety thing about the build time that I’d missed in the first version. The existing Sympy tooling slowed way down for a larger model, but it wasn’t clear where the slow down was coming from and I assumed it was in the compile stage. In the end after much debugging it turned out that calling simplify on a large expression didn’t scale well and took 100s of seconds.

Is there a #Python tool to profile function calls as the program is running?
#FormaK #OpenSource

2023-05-06

One important thing I learned while implementing the calibration feature: the templating approach that I picked for code generation doesn’t necessarily scale well. The template that used to look like a nice C++ function written with comments is now a mess of formatting pragmas and conditional blocks. More to come on this soon
#FormaK #OpenSource #cpp #CodeGeneration

2023-05-06

A new feature has landed for #FormaK! The original models only supported time varying state estimates and control inputs, now it’s easy to include fixed calibration parameters into the models at runtime. This unlocks new models, like the rocket model I referenced in my last feature release

Check out the “What’s New” page for more
github.com/buckbaskin/formak/b

#python #cpp #CodeGeneration #kalman #filter

2023-04-11

A new feature has landed for #FormaK! Compiling Python to C++ is as easy as switching `python.compile` to `cpp.compile` github.com/buckbaskin/formak/p #python #cpp

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst