LSM9DS1-Adafruit-AHRS/README.md
2024-06-25 11:04:31 +00:00

31 lines
No EOL
1.6 KiB
Markdown

# LSM9DS1-Adafruit-AHRS
This library is a Mahony-based AHRS and Tilt compensated compass for ESP32s and the LSM9DS1 sensor, written and tested for the Adafruit LSM9DS1 breakout board, using I2C connection on a Tiny S3 (ESP32) using PlatformIO. This library is a a fork of jremington's AHRS library for the sensor of the same name, however it utilizes [Adafruits's LSM9DS1](https://github.com/adafruit/Adafruit_LSM9DS1) library instead of the Sparkfun one and operates using C++ instead of Arduino conventions. This library is not affiliated with Adafruit.
![Image of the IMU](https://cdn-shop.adafruit.com/970x728/4634-12.jpg)
This library was written to support the Ringinator project and to better understand the science behind Mahony.
# Installation
All you need to do is to copy this folder into the /lib folder of your PlatformIO project and add lib_deps = lib/LSM9DS1_Adafruit_AHRS to your init file.
## How to use
### Calibration
first run the mega_calibration.cpp on your Microcontroller and then copy the code snippets into the library file.
### Absolute orientation
Simply import the headers and take a look at the sample_main.cpp file
# Commentary
The implementation does not fully work, because the up-vector seems to be tilted, causing the horizontal plane to be tilted as well. You can visualize the output using [this guide](https://learn.adafruit.com/how-to-fuse-motion-sensor-data-into-ahrs-orientation-euler-quaternions/webserial-visualizer)
# Dependencies
- [Adafruit LSM9DS1](https://github.com/adafruit/Adafruit_LSM9DS1)
- [Adafruit Unified Sensor Driver](https://github.com/adafruit/Adafruit_Sensor)
- Arduino Framework