Skip to main content

Madgwick filter for IMU data and quaternions.

Project description

Python Sensor Fusion

Fuse IMU data into a Quaternion pose.

Install

To install the library run: pip install py-imu

Development

  1. Install Poetry
  2. make init to create the virtual environment and install dependencies
  3. make format to format the code and check for errors
  4. make test to run the test suite
  5. make clean to delete the temporary files and directories
  6. poetry publish --build to build and publish to https://pypi.org/project/py-imu

Usage

from py_imu.madgwick import Madgwick
from py_imu.motion import Motion
from py_imu.quaternion import Vector3D

def main():
    """Test the modules in py-imu."""
    madgwick = Madgwick(frequency=100.0, gain=0.033)
    estimator = Motion(
        declination=9.27, latitude=32.253460, altitude=730, magfield=47392.3
    )

    # provide time increment dt based on time expired between each sensor reading
    for data in data_stream:
        gyr = Vector3D(data[0:3])
        acc = Vector3D(data[3:6])
        madgwick.update(gyr=gyr, acc=acc, dt=0.01)
        estimator.update(q=madgwick.q, acc=acc, timestamp=0.01, moving=True)

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_imu-0.0.2.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_imu-0.0.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file py_imu-0.0.2.tar.gz.

File metadata

  • Download URL: py_imu-0.0.2.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.6 Darwin/25.0.0

File hashes

Hashes for py_imu-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c122e8fc5db1eccb515c7455ae2f0ff03e6a634c2b0cd03ad2392e649ebd675e
MD5 d1c656ec4dba3b03058bad92cf42d200
BLAKE2b-256 0b24fd00cf44dcbe59cb70304620786d06d953b4a13ed8d96acda5d8d0f4a83c

See more details on using hashes here.

File details

Details for the file py_imu-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: py_imu-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.6 Darwin/25.0.0

File hashes

Hashes for py_imu-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1eebdeb26b60fe5a0b778a4e7391d7c0ab6015323944a30a6d78f274b7f70a5b
MD5 1030c0004e5d1efdfd545c595539831e
BLAKE2b-256 27fc917f270c1f26da77545f47f7957fe869c55f7e9fa807940560982235758b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page