A clean, modular Python implementation of Kalman Filters and estimation algorithms.
Project description
kalbee 🐝
kalbee is a clean, modular Python implementation of Kalman Filters and related estimation algorithms. Designed for simplicity and performance, it provides a standard interface for state estimation in various applications.
✨ Features
- Standard Kalman Filter (KF): Linear estimation for dynamic systems.
- Extended Kalman Filter (EKF): Support for non-linear systems using Jacobians.
- Alpha-Beta-Gamma Filter: Lightweight filtering for kinematic tracking.
- AutoFilter: Factory pattern for easy filter instantiation.
- Modular Design: Easy to extend with new filter types.
- NumPy Integration: Optimized for numerical computations.
- Robustness: Uses Joseph form for numerically stable covariance updates.
🚀 Installation
You can install kalbee directly from the source:
git clone https://github.com/MinLee0210/kalbee.git
cd kalbee
pip install .
Or using uv (recommended):
uv pip install -e .
🛠️ Quick Start
1. Standard Kalman Filter
import numpy as np
from kalbee.modules.filters import KalmanFilter
# Define matrices
state = np.zeros((2, 1)) # [position, velocity]
cov = np.eye(2)
F = np.array([[1, 1], [0, 1]]) # Constant velocity model (dt=1)
Q = np.eye(2) * 0.01
H = np.array([[1, 0]]) # We measure position
R = np.array([[0.1]])
# Initialize
kf = KalmanFilter(state, cov, F, Q, H, R)
# Predict & Update
kf.predict()
kf.update(np.array([[1.2]]))
print(f"Estimated State:\n{kf.x}")
2. AutoFilter Factory
Easily switch between filters using the AutoFilter factory:
from kalbee.modules.filters import AutoFilter
# Create an EKF
ekf = AutoFilter.from_filter(
state, cov, Q, R,
mode='ekf',
transition_function=my_f,
measurement_function=my_h
)
📚 Documentation
Detailed documentation and examples can be found in the docs/ directory.
🧪 Testing
Run these commands to test the library:
uv run pytest tests/
📄 License
This project is licensed under the Apache License 2.0.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Check TODO.md for ideas.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kalbee-0.1.1.tar.gz.
File metadata
- Download URL: kalbee-0.1.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3db273e88aa3c07d220b201c4d0b540effaffccc8f47c36fff323fd7512756a6
|
|
| MD5 |
cc9bb592e7ea840a99e35519958b435a
|
|
| BLAKE2b-256 |
51a47a9b6e86735ad71e3aec6b6d7001e24d22ce9cd1a6c859161c5e7a5333c7
|
File details
Details for the file kalbee-0.1.1-py3-none-any.whl.
File metadata
- Download URL: kalbee-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a8c97f0b17227c9e62a89abed4d4944396c063e4fb4f14a90f41fb497eec6f
|
|
| MD5 |
c6ae5e95d43e762f6b76a611dae5967f
|
|
| BLAKE2b-256 |
2c7e8aa79241edc4952786f2c7e647efb145d87e8ee1eca6209bf4e45952b053
|