How To Build A Simulated Mobile Robot Base Using ROS - Automatic Addison
How To Build A Simulated Mobile Robot Base Using ROS - Automatic Addison
Automatic Addison
Build the Future
In this tutorial, we will build a mobile robot base from scratch using ROS. In a future
post, I will add a robotic arm to this base so that we have a complete mobile
manipulator. By the end of this post, you will have a robot that looks like this:
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 1/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
This tutorial would not have been possible without Ramkumar Gandhinathan and
Lentin Joseph’s awesome book ROS Robotics Projects Second Edition (Disclosure: As
an Amazon Associate I earn from qualifying purchases). I highly recommend it if
you want to learn ROS 1. Many of the files (URDF, configuration, and STL files),
come from their book’s public GitHub page.
Table of Contents
Real-World Applications
Prerequisites
Install ROS Packages
Create a ROS Package
Create Folders
Build the Base of the Robot
Launch the Base of the Robot
References
Real-World Applications
This project has a number of real-world applications:
Power Plants
Prerequisites
You have ROS running on Ubuntu Linux
I am using ROS Noetic.
I’m running my Ubuntu Linux inside a virtual machine on Windows 10. If you
have MacOS or Linux, that will work just fine. Just make sure you have ROS
installed.
Also, if you did the Hello World ROS project (to create a basic ROS Publisher and
Subscriber node), you will find this tutorial easier to follow.
In a new terminal window, move to the src (source) folder of your workspace.
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 3/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
cd ~/catkin_ws/src
cd ~/catkin_ws/
Create Folders
roscd mobile_manipulator_body
cd meshes
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 4/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
Put the mesh files into your meshes folder inside your mobile_manipulator_body
package.
dir
cd ..
cd urdf
Create a file named robot_base.urdf. In this file, we will define the four wheels of
the robot and the base (i.e. five different “links”. Links are the rigid parts of the
robot).
gedit robot_base.urdf
Now, let’s launch RViz to see what our robot looks like so far.
roscd mobile_manipulator_body/urdf/
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 5/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 6/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 7/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
roscd mobile_manipulator_body/config/
gedit control.yaml
roscd mobile_manipulator_body/launch/
gedit base_gazebo_control.launch
cd ~/catkin_ws/
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 8/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
rostopic list
You can steer the robot by opening a new window and typing:
You will need to change the topic inside the GUI to:
/robot_base_velocity_controller/cmd_vel
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 9/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 10/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
References
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 11/12
06/01/2022, 01:25 How to Build a Simulated Mobile Robot Base Using ROS – Automatic Addison
https://automaticaddison.com/how-to-build-a-simulated-mobile-robot-base-using-ros/ 12/12