Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-time IMU Processing from ESP32

Supporting software to stream IMU (ICM-42688-p) connected to ESP32 via SPI onto desktop computer via serial or WiFi. Serial/UDP IO is handled in C++ and exposed to Python with pybind11.

Building from Source

Linux / MacOS

After cloning this project onto your computer:

  1. Build C++ driver with Python bindings (requires Boost):
mkdir build
cd build
cmake ..
make

Once the package builds successfully, you can install the esp32comm Python package as described below.

Windows

Compilation of this package has been tested on a Windows 10 machine. The environment was setup as follows. Explicit versions used are listed, but these steps are expected to work with reasonably recent versions of these tools.

  1. Install git bash (2.30.1)
  2. Install CMake (3.19.5)
  3. Install Python (3.9.1)
  4. Install Visual Studio Community or Professional (Pro 2019, v16.8.5 with MSVC 14.28.29333)
  5. Install Boost (1.75.0, boost_1_75_0-msvc-14.2-64.exe)

Once the development environment is setup, use git bash (or cmd) to run the following commands

$ git clone https://github.com/plusk01/esp32comm # clone this repo in your preferred directory
$ cd esp32comm
$ mkdir build
$ cd build
$ cmake -DBUILD_SHARED_LIBS=OFF ..
$ cmake --build . --target ALL_BUILD --config Release # or open in VS: start esp32comm.sln
$ cmake --build . --target pypkg --config Release # to tar python pkg

Once the package builds successfully, you can install the esp32comm Python package as described below.

Installing Python Package from Source

Install the built-from-source Python package with pip:

cd build
make pip-install

Setting up the ESP32 firmware

Flash ESP32 with firmware_serial/firmware_serial.ino sketch for serial comm and firmware_udp/firmware_udp.ino for WiFi/UDP.

Examples

See an IMU data plot in real-time with python -m esp32comm.plotimu. Alternatively, you can see the frequency spectrum with python -m esp32comm.plotfreq

Creating New Messages

To create new or change existing messages, changes need to be made in esp32comm.h and in serial_driver.cpp. For these changes to appear in Python, py_teensyimu.cpp also needs to be changed. For an example of necessary changes, see this commit where two new messages (IMU_NoMag and IMU_3DOF) were added.

If messages are changed, this project must be built from source.

About

real-time processing of imu on desktop sampled from esp32 -- transferred via serial or wifi

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages