This the ROS2 Package for the using the Easy IMU Module (MPU9250 EIMU Module) with ROS2 in a PC or microcomputer, after successful setup with the eimu_setup_application.
Note
It should be used with your ros2 project running on Ubuntu - ros-humble, ros-jazzy, etc.
- download and install the eimu-serial-dev pkg. you can also check the release
PC (AMD64)
wget https://github.com/robocre8/eimu_serial_cpp/releases/download/v1.1.1/eimu-serial-dev_1.1.1_amd64.debsudo apt install ./eimu-serial-dev_1.1.1_amd64.debRaspberry Pi (ARM64)
wget https://github.com/robocre8/eimu_serial_cpp/releases/download/v1.1.1/eimu-serial-dev_1.1.1_arm64.debsudo apt install ./eimu-serial-dev_1.1.1_arm64.deb- install
rosdepso you can install necessary ros related dependencies for the package (if you have not).sudo apt-get update sudo apt install python3-rosdep sudo rosdep init rosdep update
-
cd into the
src/folder of yourros workspaceand clone the repogit clone https://github.com/robocre8/eimu_ros.git
-
from the
src/folder, cd into the root directory of yourros workspaceand run rosdep to install all necessary ros dependenciescd ../ rosdep install --from-paths src --ignore-src -r -y -
build the packages with colcon (in the root directory of your
ros workspace):colcon build --packages-select eimu_ros --symlink-install
-
check the serial port the driver is connected to:
ls /dev/ttyA*you should see /dev/ttyACM0 or /dev/ttyACM1 and so on
-
go to the
configfolder inside theeimu_rospackage folder. You'll see two params file. Change the serial port value to that found in the previous step. You don't need to change theframe_idandpublish_frequncyvalues. leave thepublish_tf_on_map_framevalue as it is in both param files. -
to vizualize in rviz (i.e quick test to see the IMU working), run:
don't forget to source your
ros workspaceros2 launch eimu_ros test.launch.py
in another terminal run:
rviz2
Add TF and rotate the EIMU to see the transform from the imu frame to the map frame for test.
-
to use in your project (e.g with a URDF file).
Ensure the name of the imu link frame in your URDF FILE is the same as that of the
frame_idin theeimu_ros_start_params.yamlFirst launch or run your robot's package file, then run:
don't forget to source your
ros workspaceros2 launch eimu_ros start.launch.py
the imu data should now be published with (or on) the robot's imu link frame.
NOTE: Feel free to use/edit the package as you see fit on your project.