
multicalc is my Rust crate for scientific computing on real-time embedded systems. Estimation, control, kinematics, dynamics, Lie groups, calculus, autodiff and linear algebra in safe no_std Rust.
What you're seeing: A Skydio X2 loaded from its MuJoCo model, localizes itself with particle filter, then flies a minimum-snap waypoints on a noisy IMU plus GPS. Also features a 15-state error-state EKF, an LQR position loop and a geometric attitude controller. The whole stack in a median ~2 µs of each 1 ms tick.
What's new:
- MuJoCo integration: Load MuJoCo robot models directly into native
multicalctypes. Perform kinematics, control and dyanamics in rust on the MuJoCo managerie. - Estimation: unscented KF, error-state KF with IMU bias estimation, Madgwick and Mahony attitude filters.
- Control: infinite-horizon
Lqr,GeometricAttitudeController,solve_discrete_riccati/solve_discrete_lyapunov. - Signal processing: biquads (low/high/band/notch), cascades, rotor-harmonic notches, moving average, running median, Savitzky-Golay, deadband/hysteresis/slew limiting.
- Polynomials: closed-form real roots to quartic, piecewise and multivariate polynomials with symbolic partials,
MinimumSnapPlanner.
Still enforced:
- 1 kHz loops. No heap, fixed-size types, bounded work per call.
- Six embedded targets:
x86_64andaarch64Linux hosts plus four bare-metal ABIs (thumbv7emsoft-float and hard-FPU,thumbv6m,riscv32imc), running under QEMU with no_std, no-alloc and no-panic rules enforced on each. - Measured against external references: Per-module fixtures from
numpy,scipy,filterpy,mpmathandmujocoagreeing to ~1 ulp. Tables are in the repo.
We are over a dozen contributors strong now, with roughly one external contribution coming in every single day! Lets gooooo! Coming up next is articulated whole body dynamics (RNEA/CRBA/ABA), robot arm kinematics and dynamics natively in rust validated against Pinocchio.
Come build it. 50 open good first issues right now, each small and self-contained, out of 87 open total. If you like numerical methods, autodiff, embedded Rust, or robotics, I'd love the help.
- crates.io: crates.io: Rust Package Registry
- GitHub: GitHub - kmolan/multicalc-rust: Scientific computing that fits on a microcontroller. Estimation, control, kinematics, Lie groups, calculus, autodiff and linear algebra in stable no_std Rust with no heap, no panics and no unsafe. Run the same code on your laptop and your Cortex-M0. · GitHub
- Good first issues: Issues · kmolan/multicalc-rust · GitHub