Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– My Robot

A ROS 2 Humble differential-drive robot simulation built with Gazebo, RViz2, URDF/Xacro, and Python.

ROS2 Ubuntu Gazebo Python


πŸ“– Overview

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.

✨ Features

  • πŸš— 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

πŸ“‚ Project Structure

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


πŸ›  Requirements

Before running the project, make sure the following software is installed:

  • Ubuntu 22.04
  • ROS 2 Humble
  • Gazebo Classic
  • Python 3.10+
  • Colcon
  • Git

πŸš€ Installation

1. Create a ROS2 Workspace (Skip if you already have one)

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src

2. Clone the Repository

git clone https://github.com/quangdz312/my_robot.git

3. Install Python Dependencies

(Optional but recommended)

Create a virtual environment

python3 -m venv venv

Activate it

source venv/bin/activate

Upgrade pip

pip install --upgrade pip

Install Python packages

pip install -r requirements.txt

4. Install ROS Dependencies

Go back to the workspace

cd ~/ros2_ws

Install ROS package dependencies

rosdep install --from-paths src --ignore-src -r -y

5. Build the Workspace

colcon build

6. Source the Workspace

source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash

To 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 ~/.bashrc

▢️ Running the Simulation

Launch Gazebo

ros2 launch my_robot gazebo.launch.py

Launch RViz2

ros2 launch my_robot rviz.launch.py

Launch Everything

ros2 launch my_robot display.launch.py

Note: Replace the launch file names above if your project uses different launch files.


πŸ” Useful ROS2 Commands

List all topics

ros2 topic list

Echo a topic

ros2 topic echo /odom

List running nodes

ros2 node list

Show TF tree

ros2 run tf2_tools view_frames

πŸ“Έ Demo

Gazebo


RViz2

Replace the images above with screenshots from your project.


🧰 Technologies Used

Technology Description
ROS2 Humble Robot middleware
Gazebo Classic Robot simulation
RViz2 Robot visualization
URDF/Xacro Robot modeling
Python ROS scripting
C++ ROS nodes

πŸ“ Notes

Before running the project, always source ROS2:

source /opt/ros/humble/setup.bash

Then source your workspace:

source ~/ros2_ws/install/setup.bash

If any ROS package is missing, install it using:

rosdep install --from-paths src --ignore-src -r -y

🀝 Contributing

Contributions are welcome!

  1. Fork the repository.
  2. Create a new feature branch.
  3. Commit your changes.
  4. Open a Pull Request.

πŸ“„ License

This project is released under the MIT License.


πŸ‘¨β€πŸ’» Author

Dang Minh Quang

GitHub: https://github.com/quangdz312

If you find this project useful, consider giving it a ⭐ on GitHub.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Generated from joshnewans/my_bot