This the ROS2 Hardware Interface Package for the EPMC (Easy PID Motor Controller) Module
(i.e L298N EPMC Module
or any Custom EPMC Interface Board
) with ROS2 in a PC or microcomputer, after successful setup with the epmc_setup_application.
-
ensure you've already set up your microcomputer or PC system with ROS2
-
install the
libserial-dev
package on your linux machinesudo apt-get update sudo apt install libserial-dev
-
install
rosdep
so you can install necessary ros related dependencies for the package.sudo apt-get update sudo apt install python3-rosdep sudo rosdep init rosdep update
-
In the
src/
folder of yourros workspace
, clone the repo (or you can download and add it manually to thesrc/
folder)git clone https://github.com/robocre8/epmc_ros_hw_plugin.git
-
from the
src/
folder, cd into the root directory of yourros workspace
and run rosdep to install all necessary ros dependenciescd ../ rosdep install --from-paths src --ignore-src -r -y
-
build the
epmc_ros_hw_plugin
package with colcon (in the root folder of your ros workspace):colcon build --packages-select epmc_ros_hw_plugin
Note
The epmc_ros_hw_plugin package will now be available for use in any project in your ros workspace.
You can see example of how the use the epmc_ros_hw_plugin
in the example_control_file
- Please check out the
demo_bot
package to see a proper sample of how the EPMC is used.
-
ensure the
Easy PID Motor Controller (EPMC) Module
(i.eL298N EPMC Module
or anyCustom EPMC Interface Board
), with the motors connected and fully set up for velocity PID, is connected to the microcomputer or PC via USB. -
check the serial port the driver is connected to:
The best way to select the right serial port (if you are using multiple serial device) is to select by path
ls /dev/serial/by-path
you should see a value (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
-
once you have gotten the port, update the port parameter in the
<ros2_control>
tag in the URDF'sepmc_ros2_control.xacro
-
you can the build and run your robot.
-
Good Luck !!!