Metadata-Version: 2.4
Name: sensorfusion-tools
Version: 2026.0.3
Summary: Python helper library for the TSRT14 Sensor Fusion Course at LiU
Keywords: sensor fusion,state estimation,Kalman filtering,particle filtering,signal processing
Author: Gustaf Hendeby
Author-email: Gustaf Hendeby <hendeby@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: numpy>=2.4.4
Requires-Dist: scipy>=1.17.1
Requires-Dist: tqdm>=4.67.3
Requires-Python: >=3.14
Project-URL: Homepage, https://sftools.hendeby.se/
Project-URL: Documentation, https://sftools.hendeby.se/documentation/
Description-Content-Type: text/markdown

# sensorfusion-tools

Python tools for sensor fusion and state estimation. The library provides
dynamics and observation models, least-squares estimators, Kalman and particle
filters, moment transforms, and plotting helpers.

Requires Python 3.14 or later.

## Install

In a new project:

```bash
uv init --python 3.14 sensorfusion-example
cd sensorfusion-example
uv add sensorfusion-tools
```

In an existing `uv` project, run `uv add sensorfusion-tools`.

The package is installed as `sensorfusion-tools` and imported as `sftools`.

## Quick start

This example simulates a noisy observation and estimates the state using
weighted least squares:

```python
import numpy as np

from sftools import create_observation, estimator

rng = np.random.default_rng(0)
model = create_observation(
    "linear",
    H=np.eye(2),
    R=np.diag([0.1, 0.2]),
)
truth = np.array([[1.0], [2.0]])
measurement = model.random(x=truth, rng=rng)
estimate = estimator.wls(model, measurement, np.zeros((2, 1)))

print("Mean:", estimate.mean())
print("Covariance:", estimate.cov())
```

The seeded example prints:

```text
Mean: [[0.95822477]
 [2.05622826]]
Covariance: [[0.1 0. ]
 [0.  0.2]]
```

## Documentation

- [Getting started](https://sftools.hendeby.se/getting-started/)
- [Library documentation](https://sftools.hendeby.se/documentation/)
- [Example manual](https://sftools.hendeby.se/assets/manual.pdf)

## License

MIT. See [LICENSE](LICENSE) for the full text.

## Contributing

See [DEVELOPMENT.md](DEVELOPMENT.md) for development setup, testing, and
instructions for working on the website.
