![]() |
gazebo_differential_drive_robot repositoryrobot simulation gazebo ros2 gazebo_differential_drive_robot |
|
Repository Summary
Description | Simulation of a differential drive robot using ROS 2 Jazzy Jalisco and Gazebo Harmonic. |
Checkout URI | https://github.com/lucasmazzetto/gazebo_differential_drive_robot.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-03-09 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | robot simulation gazebo ros2 |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
gazebo_differential_drive_robot | 0.0.0 |
README
Differential Drive Robot Simulation
About
This package provides a simple differential drive robot model designed for use in Gazebo Harmonic simulation with ROS 2 Jazzy Jalisco.
Requirements
To run this package, you’ll need the following:
Install Required ROS 2 Packages
Make sure to install the following ROS 2 Jazzy Jalisco packages:
sudo apt install -y \
ros-jazzy-ros-gz \
ros-jazzy-ros-gz-bridge \
ros-jazzy-joint-state-publisher \
ros-jazzy-xacro \
ros-jazzy-teleop-twist-keyboard \
ros-jazzy-teleop-twist-joy
Usage
Clone the Repository
Clone this repository into your workspace/src
folder. If you don’t have a workspace set up, you can learn more about creating one in the ROS 2 workspace tutorial.
cd <path_to_your_workspace>/src
git clone git@github.com:lucasmazz/gazebo_differential_drive_robot.git
cd ..
Build the Package
Source the ROS 2 environment and build the package:
source /opt/ros/jazzy/setup.bash
colcon build
Launch the Robot
After building the package, launch the
``` file from the
```gazebo_differential_drive_robot
``` package:
```bash
source install/setup.bash
ros2 launch gazebo_differential_drive_robot robot.launch.py
To launch the robot in a specified world with a custom initial pose, run the robot.launch.py
file and specify the world path and robot pose arguments.
- world: Path to the world file
- x: Initial x-coordinate of the robot
- y: Initial y-coordinate of the robot
- z: Initial z-coordinate of the robot
- R: Initial roll orientation
- P: Initial pitch orientation
- Y: Initial yaw orientation
In the following example, the robot starts at position (x, y, z) = (1.0, 2.0, 0.5) with a yaw of 1.57 radians in the specified world:
ros2 launch gazebo_differential_drive_robot robot.launch.py world:=/path_to_world/world.sdf x:=1.0 y:=2.0 z:=0.5 R:=0.0 P:=0.0 Y:=1.57
Control the Robot
Using a Joystick
In a new terminal, source the environment and launch the
``` file from the
```teleop_twist_joy
``` package. Adjust the joy_config parameter to match your joystick controller (e.g., xbox).
```bash
source /opt/ros/jazzy/setup.bash
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'
Using a Keyboard
If you don’t have a joystick, you can control the robot using the
``` package. Run the following command:
```bash
source /opt/ros/jazzy/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard