bolderflight / invensense-imu

Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MIT License
500 stars 211 forks source link

Compilation Error on Arduino-Esp32 #124

Closed enoch-prince closed 5 months ago

enoch-prince commented 5 months ago

Compilation of the I2C example for the ESP-WROOM-32 Dev Board using the Arduino 2.3.2 IDE, failed with exit status 1 and the message:

cc1plus.exe: some warnings being treated as errors

Details of the error log is below:

c:\Users\LENOVO T460S\Documents\Arduino\libraries\Bolder_Flight_Systems_Unit_Conversions\src\convangacc.cpp: In function 'float bfs::convangacc(float, bfs::AngAccUnit, bfs::AngAccUnit)':
c:\Users\LENOVO T460S\Documents\Arduino\libraries\Bolder_Flight_Systems_Unit_Conversions\src\convangacc.cpp:59:9: error: 'out_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   float out_val;
         ^~~~~~~
c:\Users\LENOVO T460S\Documents\Arduino\libraries\Bolder_Flight_Systems_Unit_Conversions\src\convangacc.cpp:70:24: error: 'in_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       out_val = in_val / BFS_2PI_FLOAT * 60.0f;
                 ~~~~~~~^~~~~~~~~~~~~~~
cc1plus.exe: some warnings being treated as errors
flybrianfly commented 5 months ago

Please download the library directly from GitHub, it looks like you're on a very old version.

enoch-prince commented 5 months ago

Versions used

Yet still get the same compile errors as described above.

Furthermore, the following files in the Units library also produce the same errors:

convdensity.cpp
convangacc.cpp
convacc.cpp
convang.cpp
convangvel.cpp
flybrianfly commented 5 months ago

The current version of the InvenSense IMU library (v6.0.3) does not need Eigen or Units.

enoch-prince commented 5 months ago

Great 👍🏽! v6.0.3 fixed the compilation errors.