Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A demo showing the pose of the bmi160 6DoF IMU sensor in 3D using esp-idf

License

NotificationsYou must be signed in to change notification settings

nopnop2002/esp-idf-bmi160

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A demo showing the pose of the bmi160 6DoF IMU sensor in 3D using esp-idf.

You can use the Kalman filter or the Madgwick filter to estimate the Euler angle.
Euler angles are roll, pitch and yaw.
It's very intuitive and easy to understand.
However, since BMI160 is a 6DoF IMU, YAW estimation is not possible.
a-Pitch-yaw-and-roll-angles-of-an-aircraft-with-body-orientation-O-u-v-original

I usedthis library.

Software requiment

ESP-IDF V4.4/V5.x.
ESP-IDF V5.0 is required when using ESP32-C2.
ESP-IDF V5.1 is required when using ESP32-C6.

Hardware requirements

BMI160 Accelerometer Gyroscope module 6 Dof inertial Measurement Sensors.

Wireing

BMI160ESP32ESP32-S2/S3ESP32-C2/C3/C6
VIN--N/CN/CN/C
3V3--3.3V3.3V3.3V
GND--GNDGNDGND
SCL--GPIO22GPIO12GPIO5(*1)
SDA--GPIO21GPIO11GPIO4(*1)
CS--3.3V3.3V3.3VUse i2c
SAO--GND/3.3VGND/3.3VGND/3.3V(*2)

(*1)You can change it to any pin using menuconfig.

(*2)Choosing an i2c address.
GND:i2c address is 0x68.
3.3V:i2c address is 0x69.

Get Euler angles from bmi160 using Kalman filter

I usedthis.

git clone https://github.com/nopnop2002/esp-idf-bmi160cd esp-idf-bmi160/Kalmanidf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}idf.py menuconfigidf.py flash

Configuration

config-topconfig-app

Get Euler angles from bmi160 using Madgwick filter

I usedthis.

git clone https://github.com/nopnop2002/esp-idf-bmi160cd esp-idf-bmi160/Madgwickidf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}idf.py menuconfigidf.py flash

Configuration

config-topconfig-app

View Euler angles with built-in web server

ESP32 acts as a web server.
I usedthis component.
This component can communicate directly with the browser.
It's a great job.
Enter the following in the address bar of your web browser.

http:://{IP of ESP32}/orhttp://esp32.local/

bmi160-euler

WEB pages are stored in the html folder.
I usedthis for gauge display.
I usedthis for 3D display.
You can change the design and color according to your preference.

View Euler angles using PyTeapot

You can view Euler angles usingthis tool.
It works as a UDP display server.
This is a great application.

+-------------+     +-------------+     +-------------+|     IMU     | i2c |    ESP32    | UDP | pyteapot.py ||             |---->|             |---->|             ||             |     |             |     |             |+-------------+     +-------------+     +-------------+

Installation for Linux

$ sudo apt install python3-pip python3-setuptools$ python3 -m pip install -U pip$ python3 -m pip install pygame$ python3 -m pip install PyOpenGL PyOpenGL_accelerate$ git clone https://github.com/thecountoftuscany/PyTeapot-Quaternion-Euler-cube-rotation$ cd PyTeapot-Quaternion-Euler-cube-rotation$ python3 pyteapot.py

The posture of your sensor is displayed.
bmi180_2023-03-17_06-08-57

Installation for Windows

Install Git for Windows fromhere.
Install Python Releases for Windows fromhere.
Open Git Bash and run:

$ python --versionPython 3.11.9$ python -m pip install -U pip$ python -m pip install pygame$ python -m pip install PyOpenGL PyOpenGL_accelerate$ git clone https://github.com/thecountoftuscany/PyTeapot-Quaternion-Euler-cube-rotation$ cd PyTeapot-Quaternion-Euler-cube-rotation$ python pyteapot.py

Image

About

A demo showing the pose of the bmi160 6DoF IMU sensor in 3D using esp-idf

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp