A ROS 2 Humble differential-drive robot simulation built with Gazebo, RViz2, URDF/Xacro, and Python.
This project implements a differential-drive mobile robot in ROS 2 Humble. The robot model is created using URDF/Xacro and can be visualized in RViz2 or simulated in Gazebo.
- π Differential Drive Robot
- π¦Ύ Robot Model with URDF/Xacro
- π Gazebo Simulation
- π Robot State Publisher
- π Joint State Publisher
- π RViz2 Visualization
- π ROS2 Launch Files
- βοΈ Python & C++ ROS Nodes
my_robot/
βββ config/ # Configuration files (RViz, controllers, parameters, etc.)
βββ description/ # Robot description (URDF/Xacro, meshes, sensors)
βββ launch/ # ROS2 launch files
βββ worlds/ # Gazebo world files
βββ CMakeLists.txt # CMake build configuration
βββ package.xml # ROS2 package manifest
βββ LICENSE.md # Project license
βββ requirements.txt
βββ README.md # Project documentation
Before running the project, make sure the following software is installed:
- Ubuntu 22.04
- ROS 2 Humble
- Gazebo Classic
- Python 3.10+
- Colcon
- Git
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/srcgit clone https://github.com/quangdz312/my_robot.git(Optional but recommended)
Create a virtual environment
python3 -m venv venvActivate it
source venv/bin/activateUpgrade pip
pip install --upgrade pipInstall Python packages
pip install -r requirements.txtGo back to the workspace
cd ~/ros2_wsInstall ROS package dependencies
rosdep install --from-paths src --ignore-src -r -ycolcon buildsource /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bashTo avoid sourcing every time, add it to your .bashrc
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc
source ~/.bashrcros2 launch my_robot gazebo.launch.pyros2 launch my_robot rviz.launch.pyros2 launch my_robot display.launch.pyNote: Replace the launch file names above if your project uses different launch files.
ros2 topic listros2 topic echo /odomros2 node listros2 run tf2_tools view_framesReplace the images above with screenshots from your project.
| Technology | Description |
|---|---|
| ROS2 Humble | Robot middleware |
| Gazebo Classic | Robot simulation |
| RViz2 | Robot visualization |
| URDF/Xacro | Robot modeling |
| Python | ROS scripting |
| C++ | ROS nodes |
Before running the project, always source ROS2:
source /opt/ros/humble/setup.bashThen source your workspace:
source ~/ros2_ws/install/setup.bashIf any ROS package is missing, install it using:
rosdep install --from-paths src --ignore-src -r -yContributions are welcome!
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Open a Pull Request.
This project is released under the MIT License.
Dang Minh Quang
GitHub: https://github.com/quangdz312
If you find this project useful, consider giving it a β on GitHub.

