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.
-
install the
libserial-devpackage on your linux machinesudo apt-get update sudo apt install libserial-dev
-
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
-
before you start running the package, connect the
Easy IMU Moduleto the Computer (PC or microcomputer) and check its serial port:The best way to select the right serial port (if you are using multiple serial devices) is to select by path
ls /dev/serial/by-path
You should see a value printed on the terminal (if the driver is connected and seen by the computer), your serial port would be -> /dev/serial/by-path/[value]. for more info visit this tutorial from ArticulatedRobotics
- OR you can also try this:
ls /dev/ttyU*you should see /dev/ttyUSB0 or /dev/ttyUSB1 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.
- please chekout the
easy_demo_botpackage to see proper sample of how combine the EIMU with the EPMC and ekf sensor-fusion in a mobile robot.