Skip to main content

MAGYC: Magnetometer and Gyroscope Calibration

The goal of this library is to provide a set of tools for the calibration of Attitude and Heading Reference System (AHRS) magnetometers and gyroscopes. The proses of calibration consist of determine the scale and non-orthogonality vectors for the magnetometer, soft-iron (SI), and the biases for the gyroscope and the magnetometer, hard-iron (HI).

To solve the calibration problem, this library provides a set of least squares and factor graph method that need the magnetometer and gyroscope measurements, and the timestamp for each one of this samples. As both measurement are from the same device, the timestamp will be the same for both. This library was developed in the context of a research publication in the IEEE Journal of Oceanic Engineering. In this library the user can find the methods developed for this research under the MAGYC: Magnetometer and Gyroscope Calibration novel approach, and as well the benchmark methods implemented.

Dependencies

Poetry will be used for dependencies handling. For further details on the required dependencies, please refer to the pyproject.toml file.

Build

To isolate this library's use in the local environment, this project is built with Poetry. If you do not have poetry installed on your machine, you can follow the steps in this tutorial. Once you have poetry installed, you can follow the next steps.

If you want to use the library as a pip module, you can build the project with the following command:

poetry build

This will create a dist directory with the built magical package. Then, you can install the built package with the following command:

pip3 install dist/magyclib-<VERSION>-py3-none-any.whl

Development

If you want to install the library for development purposes, you can install the required packages in the virtual environment with the following command inside the repository:

poetry install

If you are installing the library through an SSH server, there might be a problem related to the python keyring. To avoid this problem, run keyring --disable before the last command in your terminal.

If you want to avoid the development, documentation, example and test packages, you can use the following command:

poetry install --without dev docs test example

Now, to run and modify the code, you have to spawn a new shell with the environment activated:

poetry shell

VSCode Development

If you use VSCode as your development tool, you need to consider that the python interpreter must be set to the virtual environment activated for this project. By default, poetry saves the virtual environment in the directory: /home/<user>/.cache/pypoetry/virtualenvs/. To have this directory available for our interpreter selection, you need to open VSCode preferences (ctrl + ,) and search for venv. You will find Python: Venv Folders and Python: Venv Path. You must add the virtual environments directory path in both sections, including the / at the end.

Once the path is added, you can select the python interpreter in the lower right corner for the python scripts and the upper right corner for the python notebooks.

Documentation

Documentation is built with mkdocs. To create it, you will need to install the project development dependencies:

poetry install --no-root

Then, run the following command:

mkdocs build

By default, this will create a site/ directory with the built documentation in html format. However, if you want to build the documentation and serve it locally, you can run the following command:

mkdocs serve

Then, navigate to http://localhost:8000/ to view the documentation.

Release files for magyc 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magyc 1.0.0
File Size Uploaded
magyc-1.0.0.tar.gz 39.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for magyc 1.0.0
File Interpreter ABI Platform
magyc-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.5 kB

Release files / magyc-1.0.0.tar.gz

Download URL magyc-1.0.0.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3d02968c66c981ba32d85701f8c17c5dff373a547f56947a5936835efbcf7c76
BLAKE2b-256 checksum
How to use checksums
fff7e513a5dd58d7cea3d5568fe329a71ad41d91236b9b960e963b7c4658149e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.8.0-49-generic

Release files / magyc-1.0.0-py3-none-any.whl

Download URL magyc-1.0.0-py3-none-any.whl
Size 44.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
385873ee2d612624209707f9faa894d48bfbfa617122782529570426521318c9
BLAKE2b-256 checksum
How to use checksums
d824972a05247b98fba1b5c4d2c5872bffa181cd8c169b9f01115474e5711d76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/6.8.0-49-generic

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page