How To Use The SMC_L298N PID Motor Driver With ROS2

THE SMC_L298N ROS2 HARDWARE PLUGIN PACKAGE SETUP

You’ll need to get and build two packages in your ros workspace to use [or test] the hardware plugin package. One is the actual hardware plugin package – smc_l298n_ros_plugin – and the other is a test robot package for testing/implementing the already installed hardware plugin – smc_diff_bot.

In summary, you first get and build the smc_l298n ros2 hardware plugin package, smc_l298n_ros_plugin, and then you get and build the smc_diff_bot package to test the plugin.

NOTE: you are free to use or follow [as a template] the smc_diff_bot test robot package codes, URDF file (especially how the ros2 control was used), and launch files (setting up controller manager) in your preferred ros2 wheeled mobile robotics project using the smc_l298n_pid_driver module.

Some quick notes before downloading and building the smc_l298n_ros_plugin package and the smc_diff_bot package:

  • Firstly, ensure you have already set up the PID gains and encoder parameters for the smc_l298n_pid_driver module. If not, follow the instructions here [link to the post].
  • Also, before you start, it is worth knowing that its ROS2 hardware plugin package is currently implemented in ROS2 humble with the Ubuntu 22.04 LTS OS (It has not been tested in Windows). You can use it with a PC, Raspberry Pi 4, or any microcomputer running Ubuntu 22.04 LTS OS with ROS2 humble. You can also use docker.
  • You should also have some experience with ROS2 as a beginner or intermediate user.
    (e.g. Install ros-humble, setting up ros workspace, building packages with colcon, rosdep, ros topics, rviz, ros transforms, etc.)

With the above in mind, follow the instructions from their Github repos below: