imucal - A Python library to calibrate 6 DOF IMUs

imucal - A Python library to calibrate 6 DOF IMUs - Published in JOSS (2022)

https://github.com/mad-lab-fau/imucal

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: researchgate.net, sciencedirect.com, joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software
Last synced: 4 months ago · JSON representation ·

Repository

A Python library to calibrate 6 DOF IMUs

Basic Info
  • Host: GitHub
  • Owner: mad-lab-fau
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 1.74 MB
Statistics
  • Stars: 45
  • Watchers: 4
  • Forks: 8
  • Open Issues: 1
  • Releases: 15
Created about 5 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog License Citation

README.md

imucal - A Python library to calibrate 6 DOF IMUs

Test and Lint codecov Documentation Status Code style: black PyPI PyPI - Downloads status

This package provides methods to calculate and apply calibrations for 6 DOF IMUs based on multiple different methods.

So far supported are:

For more information check the quickstart guide below and the documentation.

Installation

pip install imucal

To use the included calibration GUI you also need matplotlib (version >2.2). You can install it using:

pip install imucal[calplot]

Supported Python versions and Platforms

imucal is officially tested on Python 3.7, 3.8, 3.9 and 3.10. It should further work with all major operating systems.

Quickstart

This package implements the IMU-infield calibration based on Ferraris1995. This calibration method requires the IMU data from 6 static positions (3 axes parallel and antiparallel to the gravitation vector) for calibrating the accelerometer and 3 rotations around the 3 main axes for calibrating the gyroscope. In this implementation, these parts are referred to as {acc,gyr}_{x,y,z}_{p,a} for the static regions and {acc,gyr}_{x,y,z}_rot for the rotations. As example, acc_y_a would be the 3D-acceleration data measured during a static phase, where the y-axis was oriented antiparallel to the gravitation vector. For more information on how to perform the calibration check our guide.

For the calibration, you need to separate your data into these individual sections. If you already recorded them separately or know where each section starts and ends in a continuous recording, you can use ferraris_regions_from_df and ferraris_regions_from_section_list, respectively to convert the data into the correct format for the calibration (section_data in the snippet below).

If you don't have that information yet, we recommend to use the included GUI to annotate the data. To annotate a Ferraris calibration session that was recorded in a single go, you can use the following code snippet.
Note: This will open an interactive Tkinter plot. Therefore, this will only work on your local PC and not on a server or remote hosted Jupyter instance.

```python from imucal import ferrarisregionsfrominteractiveplot

Your data as a 6 column dataframe

data = ...

sectiondata, sectionlist = ferrarisregionsfrominteractiveplot( data, acccols=["accx", "accy", "accz"], gyrcols=["gyrx", "gyry", "gyrz"] )

Save the section list as reference for the future

sectionlist.tocsv('./calibration_sections.csv') # This is optional, but recommended ```

Independent of how you obtained the section_data in the correct format, you can now calculate the calibration parameters:

```python from imucal import FerrarisCalibration

samplingrate = 100 #Hz cal = FerrarisCalibration() calmat = cal.compute(sectiondata, samplingrate, fromaccunit="m/s^2", fromgyrunit="deg/s")

cal_mat is your final calibration matrix object you can use to calibrate data

calmat.tojson_file('./calibration.json') ```

Applying a calibration:

```python from imucal.management import loadcalibrationinfo

calmat = loadcalibrationinfo('./calibration.json') newdata = pd.DataFrame(...) calibrateddata = calmat.calibratedf(newdata, accunit="m/s^2", gyrunit="deg/s") ```

For further information on how to perform a calibration check the User Guides or the Examples.

Further Calibration Methods

At the moment, this package only implements calibration methods based on Ferraris1994/95, because this is what we use to calibrate our IMUs. We are aware that various other methods exist and would love to add them to this package as well. Unfortunately, at the moment we can not justify the time investment.

Still, we think that this package provides a suitable framework to implement other calibration methods with relative ease. If you would like to contribute such a method, let us know via GitHub Issue, and we will try to help you as good as possible.

Citation

If you are using imucal in your scientific work, we would appreciate if you would cite our JOSS paper or link the project.

Küderle, Arne, Nils Roth, Robert Richer, and Bjoern M. Eskofier. “Imucal - A Python Library to Calibrate 6 DOF IMUs.” Journal of Open Source Software 7, no. 73 (May 26, 2022): 4338. https://doi.org/10.21105/joss.04338.

Contributing

All project management and development happens through this GitHub project. If you have any issues, ideas, or any comments at all, just open a new issue. We are always happy when people are interested to use our work and would like to support you in this process. In particular, we want to welcome contributions of new calibration algorithms, to make this package even more useful for a wider audience.

Dev Setup

We use poetry to manage our dependencies. Therefore, you need to first install Poetry locally on you machine.

Then you can run the following command to install a local development version of this library in a dedicated venv.

bash git clone https://github.com/mad-lab-fau/imucal cd imucal poetry install --all-extras

To run tests/the linter/... we use poethepoet. You can see all available commands by running:

poetry run poe list

This should show you all configured commands:

CONFIGURED TASKS format lint Lint all files with ruff. ci_check Check all potential format and linting issues. test Run Pytest with coverage. docs Build the html docs using Sphinx. bump_version

You execute any command by running

poetry run doit <command-name>

Updating dependencies

If you update or add dependencies using (poetry add or poetry update) you will see that the pyproject.toml and the poetry.lock files are both updated. Make sure you commit the changes to both files. Otherwise, wrong versions of dependencies will be used in the CI and by other developers.

In case you update dependencies by directly editing the pyproject.toml file, you need to be very careful and make sure, you run poetry lock [--no-update] afterwards. Otherwise, the lock file will be out of date.

In general, it is a good idea to just run poetry update from time to time. This will install the latest version of all dependencies that are still allowed by the version constrains in the pyproject.toml. This allows to check, if everything still works well with the newest versions of all libraries.

Owner

  • Name: Machine Learning and Data Analytics Lab FAU
  • Login: mad-lab-fau
  • Kind: organization
  • Location: Erlangen, Germany

Public projects of the Machine Learning and Data Analytics Lab at the Friedrich-Alexander-University Erlangen-Nürnberg

JOSS Publication

imucal - A Python library to calibrate 6 DOF IMUs
Published
May 26, 2022
Volume 7, Issue 73, Page 4338
Authors
Arne Küderle ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Nils Roth ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Robert Richer ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Bjoern M. Eskofier ORCID
Machine Learning and Data Analytics Lab (MaD Lab), Department Artificial Intelligence in Biomedical Engineering (AIBE), Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Editor
Adi Sinn ORCID
Tags
Machine Learning Data Analysis

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Küderle"
  given-names: "Arne"
  orcid: "https://orcid.org/0000-0002-5686-281X"
- family-names: "Roth"
  given-names: "Nils"
  orcid: "https://orcid.org/0000-0002-9166-3920"
- family-names: "Richer"
  given-names: "Robert"
  orcid: "https://orcid.org/0000-0003-0272-5403"
- family-names: "Eskofier"
  given-names: "Bjoern M."
  orcid: "https://orcid.org/0000-0002-0417-0336"
title: "imucal - A Python library to calibrate 6 DOF IMUs"
version: 2.0.2
doi: 10.17605/OSF.IO/37TD9
url: "https://github.com/mad-lab-fau/imucal"

preferred-citation:
  type: article
  authors:
  - family-names: "Küderle"
    given-names: "Arne"
    orcid: "https://orcid.org/0000-0002-5686-281X"
  - family-names: "Roth"
    given-names: "Nils"
    orcid: "https://orcid.org/0000-0002-9166-3920"
  - family-names: "Richer"
    given-names: "Robert"
    orcid: "https://orcid.org/0000-0003-0272-5403"
  - family-names: "Eskofier"
    given-names: "Bjoern M."
    orcid: "https://orcid.org/0000-0002-0417-0336"
  doi: 10.21105/joss.04338
  journal: "Journal of Open Source Software"
  start: 4338
  title: "imucal - A Python library to calibrate 6 DOF IMUs"
  issue: 73
  volume: 7
  year: 2022

GitHub Events

Total
  • Create event: 2
  • Release event: 2
  • Issues event: 5
  • Watch event: 9
  • Issue comment event: 7
  • Push event: 9
  • Fork event: 1
Last Year
  • Create event: 2
  • Release event: 2
  • Issues event: 5
  • Watch event: 9
  • Issue comment event: 7
  • Push event: 9
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 280
  • Total Committers: 7
  • Avg Commits per committer: 40.0
  • Development Distribution Score (DDS): 0.068
Past Year
  • Commits: 11
  • Committers: 1
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Arne Küderle a****e@f****e 261
Robert Richer r****r@f****e 6
fischmalte 5****e 5
Nils Roth n****h@f****e 5
MalteOlle 5****e 1
Juanjo Bazán j****n@g****m 1
Aksei 4****i 1
Committer Domains (Top 20 + Academic)
fau.de: 3

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 17
  • Total pull requests: 8
  • Average time to close issues: 7 months
  • Average time to close pull requests: about 22 hours
  • Total issue authors: 7
  • Total pull request authors: 4
  • Average comments per issue: 1.76
  • Average comments per pull request: 0.38
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 3 months
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 4.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • AKuederle (9)
  • MalteOlle (2)
  • finsberg (2)
  • Aleja-C (1)
  • defe41251135 (1)
  • lit-af (1)
  • tuliofalmeida (1)
Pull Request Authors
  • AKuederle (4)
  • MalteOlle (2)
  • Aksei (1)
  • xuanxu (1)
Top Labels
Issue Labels
documentation (1)
Pull Request Labels
documentation (1) good first issue (1)

Packages

  • Total packages: 14
  • Total downloads:
    • pypi 353 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 5
    (may contain duplicates)
  • Total versions: 40
  • Total maintainers: 3
pypi.org: imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 16
  • Dependent Packages: 2
  • Dependent Repositories: 5
  • Downloads: 353 Last month
Rankings
Dependent packages count: 3.2%
Dependent repos count: 6.6%
Average: 9.3%
Stargazers count: 11.6%
Downloads: 11.8%
Forks count: 13.3%
Maintainers (2)
Last synced: 4 months ago
alpine-v3.18: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 13.4%
Stargazers count: 25.6%
Forks count: 27.9%
Maintainers (1)
Last synced: 5 months ago
alpine-v3.18: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 13.4%
Stargazers count: 25.6%
Forks count: 27.9%
Maintainers (1)
Last synced: 4 months ago
alpine-edge: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 14.6%
Average: 17.7%
Stargazers count: 27.3%
Forks count: 28.7%
Maintainers (1)
Last synced: 4 months ago
alpine-edge: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 14.3%
Average: 18.2%
Stargazers count: 28.4%
Forks count: 30.1%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.17: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 18.8%
Stargazers count: 23.3%
Forks count: 24.5%
Dependent packages count: 27.3%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.20: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.21: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.19: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.22: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.19: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 4 months ago
alpine-v3.21: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.20: py3-imucal-pyc

Precompiled Python bytecode for py3-imucal

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago
alpine-v3.22: py3-imucal

A Python library to calibrate 6 DOF IMUs

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 4 months ago

Dependencies

poetry.lock pypi
  • alabaster 0.7.12 develop
  • astroid 2.11.3 develop
  • atomicwrites 1.4.0 develop
  • attrs 21.4.0 develop
  • babel 2.10.1 develop
  • beautifulsoup4 4.11.1 develop
  • black 22.3.0 develop
  • certifi 2021.10.8 develop
  • charset-normalizer 2.0.12 develop
  • click 8.1.2 develop
  • cloudpickle 2.0.0 develop
  • colorama 0.4.4 develop
  • commonmark 0.9.1 develop
  • coverage 5.5 develop
  • dill 0.3.4 develop
  • docutils 0.17.1 develop
  • dodgy 0.2.1 develop
  • doit 0.33.1 develop
  • flake8 2.3.0 develop
  • flake8-polyfill 1.0.2 develop
  • idna 3.3 develop
  • imagesize 1.3.0 develop
  • importlib-metadata 4.11.3 develop
  • iniconfig 1.1.1 develop
  • isort 5.10.1 develop
  • jinja2 3.0.3 develop
  • lazy-object-proxy 1.7.1 develop
  • macfsevents 0.8.1 develop
  • markupsafe 2.1.1 develop
  • mccabe 0.6.1 develop
  • memory-profiler 0.58.0 develop
  • mypy-extensions 0.4.3 develop
  • numpydoc 1.2.1 develop
  • pathspec 0.9.0 develop
  • pep8 1.7.1 develop
  • pep8-naming 0.10.0 develop
  • platformdirs 2.5.2 develop
  • pluggy 1.0.0 develop
  • prospector 1.7.7 develop
  • psutil 5.9.0 develop
  • py 1.11.0 develop
  • pycodestyle 2.8.0 develop
  • pydata-sphinx-theme 0.8.1 develop
  • pydocstyle 6.1.1 develop
  • pyflakes 2.4.0 develop
  • pygments 2.12.0 develop
  • pyinotify 0.9.6 develop
  • pylint 2.13.7 develop
  • pylint-celery 0.3 develop
  • pylint-django 2.5.3 develop
  • pylint-flask 0.6 develop
  • pylint-plugin-utils 0.7 develop
  • pytest 6.2.5 develop
  • pytest-cov 2.12.1 develop
  • pyyaml 6.0 develop
  • recommonmark 0.7.1 develop
  • requests 2.27.1 develop
  • requirements-detector 0.7 develop
  • setoptconf-tmp 0.3.1 develop
  • snowballstemmer 2.2.0 develop
  • soupsieve 2.3.2.post1 develop
  • sphinx 4.5.0 develop
  • sphinx-gallery 0.10.1 develop
  • sphinxcontrib-applehelp 1.0.2 develop
  • sphinxcontrib-devhelp 1.0.2 develop
  • sphinxcontrib-htmlhelp 2.0.0 develop
  • sphinxcontrib-jsmath 1.0.1 develop
  • sphinxcontrib-qthelp 1.0.3 develop
  • sphinxcontrib-serializinghtml 1.1.5 develop
  • toml 0.10.2 develop
  • typed-ast 1.5.3 develop
  • urllib3 1.26.9 develop
  • wrapt 1.14.0 develop
  • zipp 3.8.0 develop
  • cached-property 1.5.2
  • cycler 0.11.0
  • fonttools 4.33.3
  • h5py 3.6.0
  • kiwisolver 1.4.2
  • matplotlib 3.5.1
  • numpy 1.21.6
  • packaging 21.3
  • pandas 1.3.5
  • pillow 8.4.0
  • pyparsing 3.0.8
  • python-dateutil 2.8.2
  • pytz 2022.1
  • setuptools-scm 6.4.2
  • six 1.16.0
  • tomli 2.0.1
  • typing-extensions 4.2.0
pyproject.toml pypi
  • Pillow ^8.0.1 develop
  • Sphinx ^4.4.0 develop
  • black ^22.3.0 develop
  • coverage ^5.3 develop
  • doit ^0.33.1 develop
  • memory-profiler ^0.58.0 develop
  • numpydoc ^1.2.0 develop
  • prospector ^1.7.6 develop
  • pydata-sphinx-theme ^0.8.0 develop
  • pytest ^6.1.1 develop
  • pytest-cov ^2.10.1 develop
  • recommonmark ^0.7.1 develop
  • sphinx-gallery ^0.10.1 develop
  • toml ^0.10.2 develop
  • h5py ^3
  • matplotlib ^3.3.2
  • numpy ^1.19.2
  • packaging ^21.3
  • pandas ^1.1.3
  • python >=3.7.1,<3.11
  • typing-extensions >=3.7.4
.github/workflows/publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/test-and-lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v2 composite