How To Use the EPMC With ROS2
Learn how to test and integrate the Easy IMU (EIMU) in your ROS2 project
Last updated
Learn how to test and integrate the Easy IMU (EIMU) in your ROS2 project
Last updated
Firstly, ensure you have your Geared DC motors connected to the EPMC Module and the motor PID gains already set up. 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, 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)
First clone and install the epmc harware plugin package - epmc_ros_hw_plugin.
Next clone and install the demo_bot package - demo_bot. The demo_bot package is a test robot for testing the EPMC plugin package. I contains example on how to implement the EPMC ROS2 control on a differential drive robot. (It requires that the epmc hardware interface plugin be installed on your computer)
Basically, after cloning, installing necessary dependencies, compiling, and installing both packages using colcon build --symlink-install
, you can quickly follow the steps below to test the EPMC.
You need to first connect the EPMC Module to your PC (or microcomputer)
Check the USB port the EPMC Module is connected to and give the port necessary permissions.
Go to the epmc_ros2_control.xacro
file found in the demo_bot/demo_bot_description/urdf/ folder
change the port
param file to the USB port found in the second step above
<param name="port"> {discovered port value} </param>
Then ensure the motorA_wheel_name
and the motorB_wheel_name
params properly indicates which port you connected your left and right motor wheel.
Change the command interface velocity min and max parameter, to that of you Motor (i.e *W_MAX value during setup)
open a new terminal (and source your workspace) and launch the demo_bot_base
ros2 launch demo_bot_base robot.launch.py
open another terminal (and source your workspace) and launch the demo_bot_rviz view file
ros2 launch demo_bot_rviz robot.launch.py
You can drive using the ros teleop package or the arrow_key_teleop_drive package
Finally, please chekout and go through the demo_bot
package to see proper sample of how combine the EIMU with the EPMC and ekf sensor-fusion in a mobile robot.