This is a minimal sample robot for testing and learning how to use the EPMC module to setup base control for a mobile robot.
Feel free to adopt it in building your own mobile base control with ROS2
Note
You can test this on RaspberryPi or a devPC
- install the
libserial-devpackage on the Raspberry Pi 4b machine or on your Dev PCsudo apt-get update sudo apt install libserial-dev
-
create your ROS Workspace in the home directory
-
download and setup the
epmc_hardware_interfaceros2 package (if you don't have it)cd ~/<your-ros-ws>/src git clone https://github.com/robocre8/epmc_hardware_interface.git
-
cd into the src folder of your ROS Workspace and download the demo_bot packages
cd ~/<your-ros-ws>/src git clone https://github.com/robocre8/epmc_sample_bot.git
-
cd into the root directory of your ROS Workspace and run rosdep to install all necessary ros package dependencies
cd ~/<your-ros-ws>/ rosdep install --from-paths src --ignore-src -r -y
-
build your ROS Workspace
cd ~/<your-ros-ws>/ colcon build --symlink-install
OR
cd ~/<your-ros-ws>/ colcon build --symlink-install --parallel-workers 2
-
check the serial port the connected sensors and motor controller
The best way to select the right serial port (if you are using multiple serial device) is to select by path
ls /dev/ttyA* -
go to the
epmc_sample_bot_description/urdf/ros2_control.xacrofile and change theportparameter to the port value gotten -
you can also edit other parameters like the
command_interfaceminandmaxvelocity parameter, etc.
- View robot
source ~/<your-ros-ws>/install/setup.bash ros2 launch epmc_sample_bot_description rsp.launch.py use_joint_state_pub:=true
- on Your dev-PC, open
rviz2in a differnt terminal to vizualize the robot
- Open a new terminal and start the
epmc_sample_bot_basesource ~/<your-ros-ws>/install/setup.bash ros2 launch epmc_sample_bot_base robot.launch.py
Note
If any error occurs, unplug the USB HUB from the Raspberry Pi Port and plug it back. Everything should now work.
-
on Your dev-PC, open
rviz2in a differnt terminal to vizualize the robot -
control the robot via teleop
Note
your teleop should publish Stamped velocity on the /cmd_vel topic
- you can use the arrow_key_teleop_drive package