This repository contains the follow-along code for simulating and building a mobile robot in Gazebo Harmonic and ROS2 Jazzy Jalisco. The series can be found on the blog: Diffbot Tutorial Series
Diffbot is a simulated robot designed in ROS2 with Gazebo. This tutorial series will guide you through the process of setting up the Diffbot environment, controlling the robot, and implementing various functionalities.
To set up the Diffbot environment for the tutorial, follow these steps:
- Clone the template repository:
git clone https://github.com/adoodevv/diffbot.git cd diffbot - Follow the instructions in the blog series to install necessary dependencies and configure your ROS2 and Gazebo environment.
- Build the workspace:
colcon build
- Source the workspace:
source install/setup.bash - Launch the Diffbot simulation:
ros2 launch diffbot_tut robot.launch.py
Once the simulation is running, you can control the Diffbot using ROS2 commands. For example, to move the robot forward, you can publish velocity commands to the appropriate topic.
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}}"To stop the robot, you can publish a zero velocity command:
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}}"Contributions to this repository are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.