robocre8
AboutContactSocial
  • robocre8
  • About
  • Contact
  • Social
  • DOCUMENTATIONS
    • MoboBot Documentation
    • EPMC Documentation
    • EIMU Documentation
  • EIMU TUTORIALS
    • How To Calibrate And Setup The EIMU
    • How To Use EIMU With ROS2
    • How To Use EIMU With Arduino
  • EPMC TUTORIALS
    • How To Setup DC Motor PID Speed Control With The EPMC
  • How To Use the EPMC With ROS2
  • How To Use EPMC With Arduino
  • TUTORIALS
    • How To Install ROS2 Humble Desktop On PC (FULL INSTALL)
    • How To Install ROS2 Humble Base On Raspberry Pi 4B (FULL INSTALL)
Powered by GitBook
On this page
  • Before Running The EIMU ROS2 Package
  • Notes On Testing The Easy IMU (EIMU) With RVIZ
  • Notes On Using The Easy IMU (EIMU) In Your ROS2 Robotic Project
  1. EIMU TUTORIALS

How To Use EIMU With ROS2

Learn how to test and integrate the Easy IMU (EIMU) in your ROS2 project

PreviousHow To Calibrate And Setup The EIMUNextHow To Use EIMU With Arduino

Last updated 3 months ago

Before Running The EIMU ROS2 Package

  • Firstly, ensure you have calibrated and set its Madgwick filter gain and computed its orientation, rate, and acceleration variances. If not, follow the instructions here [link to the post]

  • Also, before you start, it is worth knowing that you can use it with a PC, Raspberry Pi 4, or any microcomputer running Ubuntu OS and ROS2. You can also use docker (if you can).

  • You should also have some experience with ROS2 as a beginner or intermediate user. (e.g. Installing ROS2, setting up ros workspace, building packages with colcon, rosdep, ros topics, rviz, ros transforms, e.t.c)

With the above in mind, follow the instructions from its Github repo (i.e. eimu_ros package) to get it up and running.


There are two ways of using and launching the eimu_ros package:

  • The first just involves quick test to see if the Easy IMU is working with ROS2.

  • The Other Involves using it in your robotics projects (with URDF and robot-state-publisher)

Notes On Testing The Easy IMU (EIMU) With RVIZ

After installing and building the eimu_ros package and connecting the EIMU Module to your PC or microcomputer as specified in its github repo. You can quickly test if it is working by running the test launch file with rviz.

ros2 launch eimu_ros test.launch.py
rviz2

You'll notice the eimu_ros_test_params.yaml in the config folder with following content:

eimu_ros:
  ros__parameters:
    # port: "/dev/serial/by-path/pci-0000:00:14.0-usb-0:1.3:1.0-port0"
    port: "/dev/ttyUSB0"
    frame_id: "imu"
    publish_frequency: 10.0
    eimu_reference_frame_id: 1  # 0 - NWU,  1 - ENU,  2 - NED
    publish_tf_on_map_frame: true

the parameters, I believe, are quite self explanatory. (You can adjust any parameter as you see fit)

You'll notice the publish_tf_on_map_frame is set to true. What this does is to publish the imu data transform from the imu frame to the map frame for quick test view with RVIZ.

all you need to do add TF to the rviz view.

Notes On Using The Easy IMU (EIMU) In Your ROS2 Robotic Project

The EIMU can also be used in your ROS2 robotic project where you have the robot's URDF transform published using the robot-state-publisher package.

You'll use the eimu_ros_start_params.yamlin the config folder with following content:

eimu_ros:
  ros__parameters:
    # port: "/dev/serial/by-path/pci-0000:00:14.0-usb-0:1.3:1.0-port0"
    port: "/dev/ttyUSB0"
    frame_id: "imu"
    publish_frequency: 10.0
    eimu_reference_frame_id: 1  # 0 - NWU,  1 - ENU,  2 - NED
    publish_tf_on_map_frame: false

the parameters, I believe, are quite self explanatory and are the same as that of the test. (You can adjust any parameter as you see fit)

You'll notice the publish_tf_on_map_frame is set to false. This means that the imu data transforms will not be published on the map frame. Since you would be using it with your robot's URDF, then the robot-state-publisher will handle the transform.

what you need to do before launching is to ensure the frame_id parameter in the param file has the same name/value as that of your imu frame/link in your robot URDF file. e.g

<!--  IMU LINK -->

<joint name="imu_joint" type="fixed">
    <parent link="chassis"/>
    <child link="imu"/>
    <origin xyz="0 0 ${chassis_height}"/>
</joint>


<link name="imu">
</link>

<!--  ########################### -->

Notice that the <link name="imu"> and frame_id: "imu" have the same value and publish_tf_on_map_frame: false

Once this is done you can start/launch your robot-state-publisher to publish the URDF transform and then run the command below to start the Easy IMU.

ros2 launch eimu_ros start.launch.py

Now the the IMU data will now be published on the IMU link of your robot.

Feel free to use the package launch and config file to your preferred taste.


Finally, please chekout the easy_demo_bot package to see proper sample of how combine the EIMU with the EPMC and ekf sensor-fusion in a mobile robot.