
Package Build Status: 
[^1]: Binaries for these pairings are provided from the packages.osrfoundation.org repository. Refer to https://gazebosim.org/docs/latest/ros_installation for installation instructions.
[^2]: Note that the Gazebo version on this row has reached end-of-life.
For information on ROS(1) and Gazebo compatibility, refer to the noetic branch README
Note: The ros_ign prefixed packages are shim packages that redirect to their ros_gz counterpart.
Under most circumstances you want to be using the ros_gz counterpart.
Integration between ROS and Gazebo
Packages
This repository holds packages that provide integration between
ROS and Gazebo:
Install
This branch supports ROS Rolling. See above for other ROS versions.
Binaries
Rolling binaries are available for Rotary.
They are hosted at https://packages.ros.org.
-
Add https://packages.ros.org with the ros2-apt-source package
(see the ROS installation instructions):
sudo apt-get update && sudo apt-get install -y curl
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
sudo dpkg -i /tmp/ros2-apt-source.deb
sudo apt-get update
-
Install ros_gz
sudo apt install ros-rolling-ros-gz
From source
ROS
Be sure you’ve installed
ROS Rolling
(at least ROS-Base). More ROS dependencies will be installed below.
Gazebo
The version of Gazebo paired with Rolling will automatically be installed when running rosdep below.
Compile ros_gz
The following steps are for Linux and macOS.
-
Create a colcon workspace:
# Setup the workspace
mkdir -p ~/ws/src
cd ~/ws/src
# Download needed software
git clone https://github.com/gazebosim/ros_gz.git -b ros2
-
Install dependencies (this may also install Gazebo):
cd ~/ws
rosdep install -r --from-paths src -i -y --rosdistro rolling
If rosdep fails to install Gazebo libraries and you have not installed them before, please follow Gazebo installation instructions.
-
Build the workspace:
# Source ROS distro's setup.bash
source /opt/ros/<distro>/setup.bash
# Build and install into workspace
cd ~/ws
colcon build
[!TIP]
The ros_gz library makes heavy use of templates which causes compilers to consume a lot of memory. If your build fails with c++: fatal error: Killed signal terminated program cc1plus
try building with colcon build --parallel-workers=1 --executor sequential. You might also have to set export MAKEFLAGS="-j 1" before running colcon build to limit
the number of processors used to build a single package.
ROSCon 2022

Project Template
A template project integrating ROS and Gazebo simulator
评论