Hi all,
I just went through the pain of setting up an M2 with IMU support. None of the existing guides were complete, so I thought I’d share my steps here for others to use. Enjoy!
EMLID Reach M2, IMU setup
My environment:
Ubuntu 20.04, x86_64
Follow the following steps to read data from the IMU on the M2 (with the bulleted caveats)
-
README.md · 11bb42a56d0d47694479ff0d9e8b93dd6ab801dd · Antoine RICHARD / IMU_REACH_M · GitLab
- For this step you will need the following:
-
README.md · 11bb42a56d0d47694479ff0d9e8b93dd6ab801dd · Antoine RICHARD / IMU_REACH_M · GitLab
- ssh reach@IP-ADDRESS
- Password: emlidreach
- ssh reach@IP-ADDRESS
-
README.md · 11bb42a56d0d47694479ff0d9e8b93dd6ab801dd · Antoine RICHARD / IMU_REACH_M · GitLab
- You will need to install Qt 5.12.11 with support for “android armv7” to your home directory
- Download and extract the following in XC-reach:
- Clone this fork instead of the one listed:
- See later in this guide for the “toolchain.cmake” I used.
- Before building, modify the following to be “OFF”
- Once the above steps are done, build the code as described in the guide.
- Secure copy (scp) the whole build folder you have just created over to the M2
- Copy “libRTIMULib.so.8” from your build folder to “/lib” on the M2
- You should now be able to run the examples
- Change directory into “~/build/RTIMULibDrive10” (assuming you put the build directory in home)
- Run the example with “./RTIMULibDrive10”
- It will fail, but at the same time create a “RTIMULib.ini” file which you can now modify with vim.
- Change “IMUType” to 11
- Change “BusIsI2C” to false
- Run the example again and it should work.
- At this point I would recommend calibrating the IMU with “RTIMULibCal”
- Copy your “RTIMULib.ini” into that directory first.
- Once you have run the calibration, copy the “ini” file modified by “RTIMULibCal” to all other examples to set those ranges.
toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(Qt5Core_DIR /home//Qt/5.12.11/android_armv7/lib/cmake/Qt5Core/)
set(Qt5Widgets_DIR /home//Qt/5.12.11/android_armv7/lib/cmake/Qt5Widgets/)
set(Qt5Gui_DIR /home//Qt/5.12.11/android_armv7/lib/cmake/Qt5Gui/)
set(_qt5gui_OPENGL_INCLUDE_DIR /usr/include/libdrm/)
set(tools /home//XC-reach/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf)
set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)
set(sysr /home//XC-reach/sysroot-glibc-linaro-2.25-2019.12-arm-linux-gnueabihf)
set(CMAKE_SYSROOT ${sysr})
set(QT5 true)
set(CMAKE_PREFIX_PATH /home//Qt/5.12.11/android_armv7/lib/)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)