A template project integrating ROS and Gazebo simulator
-
ros_gz_example_description
- holds the sdf description of the simulated system and any other assets -
ros_gz_example_gazebo
- holds gazebo specific code and configurations. Namely this is where systems end up. -
ros_gz_example_application
- holds ros2 specific code and configurations -
ros_gz_example_bringup
- holds launch files and high level utilities
Directly Use this template
and create your project repository on github.
On Ubuntu Jammy
-
Install ROS 2 Humble
-
Install Gazebo Garden
-
Install necessary tools
sudo apt install python3-vcstool python3-colcon-common-extensions git wget
-
Create a workspace, for example:
mkdir -p ~/template_ws/src cd ~/template_ws/src
-
Clone the template:
git clone wget https://raw.githubusercontent.com/gazebosim/ros_gz_project_template/main/template_workspace.yaml vcs import < template_workspace.yaml cd ~/template_ws
-
Set the Gazebo version to Garden:
export GZ_VERSION=garden
-
Install ROS dependencies
sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src -r -y -i
-
Build and install
cd ~/template_ws colcon build --cmake-args -DBUILD_TESTING=ON
-
Source the workspace
. ~/template_ws/install/setup.sh
-
Launch the simulation
ros2 launch ros_gz_example_bringup example.launch.py