Skip to content

vincexl/gazebo_controller_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Gazebo Controller Workspace

A ROS2 workspace for controlling differential drive robots in Gazebo simulation.

Overview

This workspace contains a ROS2 package (gazebo_controller) that provides:

  • Differential drive robot simulation in Gazebo
  • ROS2-Gazebo bridge for topic communication
  • Custom robot models with differential drive capabilities
  • Launch files for easy simulation startup

Package Structure

gazebo_controller_ws/
├── src/
│   └── gazebo_controller/
│       ├── gazebo_controller/          # Python package
│       ├── launch/                     # Launch files
│       │   ├── ros_gz_bridge.launch.py
│       │   └── gazebo_with_bridge.launch.py
│       ├── config/                     # Configuration files
│       │   └── gazebo_bridge.yaml
│       ├── sdf/                        # Robot model files
│       │   └── building_robot.sdf
│       ├── package.xml                 # Package dependencies
│       └── setup.py                    # Package setup
└── README.md

Quick Start

1. Build the Workspace

cd gazebo_controller_ws
colcon build
source install/setup.bash

2. Launch Options

Option A: Complete System (Gazebo + Bridge)

ros2 launch gazebo_controller gazebo_with_bridge.launch.py

Option B: Bridge Only (if Gazebo already running)

ros2 launch gazebo_controller ros_gz_bridge.launch.py

Option C: Manual Control

# Terminal 1: Start Gazebo
gz sim $(ros2 pkg prefix gazebo_controller)/share/gazebo_controller/sdf/building_robot.sdf

# Terminal 2: Start Bridge
ros2 launch gazebo_controller ros_gz_bridge.launch.py

3. Control the Robot

# Move forward
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}"

# Turn left
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.5}"

# Stop
ros2 topic pub /cmd_vel geometry_msgs/msg/Twist "linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}"

Robot Model

The building_robot.sdf contains a unique Pizza Delivery Bot design featuring:

  • Red chassis with yellow delivery compartment
  • Differential drive with realistic tire/rim wheels
  • Dual front support wheels for stability
  • Communication antenna for autonomous operation

Available Topics

Topic Type Direction Description
/cmd_vel geometry_msgs/msg/Twist ROS → Gazebo Velocity commands
/odom nav_msgs/msg/Odometry Gazebo → ROS Robot odometry
/tf tf2_msgs/msg/TFMessage Gazebo → ROS Transform data
/clock rosgraph_msgs/msg/Clock Gazebo → ROS Simulation time

Dependencies

  • ROS2 (Jazzy/Humble)
  • Gazebo (Garden/Harmonic)
  • ros_gz_bridge
  • geometry_msgs
  • nav_msgs
  • tf2_ros

Notes

  • Ensure you run colcon build from the workspace root, not from inside src/gazebo_controller
  • Source the workspace with source install/setup.bash after building
  • The robot uses differential drive kinematics for realistic movement

Troubleshooting

Issue: Launch file not found

  • Solution: Rebuild from workspace root and source properly

Issue: Topics not bridging

  • Solution: Check if Gazebo and ROS2 are using compatible DDS settings

Issue: Robot not moving

  • Solution: Verify /cmd_vel topic is being published correctly

Course: EN613
Author: [Your Name]
Date: October 2025

About

EN613 Project Group 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages