From 4444143ae245212b3cb352897f1ecf03ad193a0a Mon Sep 17 00:00:00 2001 From: andermi Date: Fri, 20 Jan 2023 19:45:02 -0800 Subject: [PATCH] Switch to Humble/Garden on 22.04 (#22) * Upgrade to Humble + Garden Signed-off-by: Louise Poubel * gz Signed-off-by: Louise Poubel * Temporarily override versions for CI Signed-off-by: Michael Carroll * add instructions for pythonpath building gz-sim from source Signed-off-by: Michael Anderson * typo Signed-off-by: Michael Anderson * Update README.md * use cyclonedds in dockerfile Signed-off-by: Michael Anderson * typo Signed-off-by: Michael Anderson * swap branches to main in vcs yaml Signed-off-by: Michael Anderson Signed-off-by: Louise Poubel Signed-off-by: Michael Carroll Signed-off-by: Michael Anderson Co-authored-by: Louise Poubel Co-authored-by: Dharini Dutia Co-authored-by: Michael Carroll --- README.md | 35 +++++++++++++++++++++++++---------- buoy_all.yaml | 10 +++++----- docker/buoy/Dockerfile | 18 +++++++++++++++--- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f25d4795..ca588bef 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,29 @@ These are the repositories for the project: ## Install ### On Host System ##### Requirements -At the moment, only source installation is supported. Use Ubuntu Focal. +At the moment, only source installation is supported. Use Ubuntu Jammy. -1. Install [ROS 2 Galactic](https://docs.ros.org/en/galactic/index.html) +1. Install [ROS 2 Humble](https://docs.ros.org/en/humble/index.html) -1. Install [Gazebo Fortress](https://ignitionrobotics.org/docs/fortress) +Buoy Sim is tested against cyclonedds rmw implementation (default changed from Galactic to Humble) +``` +sudo apt install -y ros-humble-rmw-cyclonedds-cpp +export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp +``` + +2. Install [Gazebo Garden](https://gazebosim.org/docs/garden) + +Currently, in order to use added mass, it is necessary to build gz-sim Garden from source. + +When building from source, it is necessary to export the `PYTHONPATH` for gz-math python bindings when building buoy_sim +``` +export PYTHONPATH=$PYTHONPATH:/install/lib/python` +``` + +See [gz-math Python Get Started tutorial](https://github.com/gazebosim/gz-math/blob/gz-math7/tutorials/pythongetstarted.md). This step is needed until `PYTHONPATH` is automatically exported upstream, tracked in [this issue](https://github.com/osrf/buoy_sim/issues/81) -1. Install necessary tools + +3. Install necessary tools ``` sudo apt install python3-vcstool python3-colcon-common-extensions python3-pip git wget @@ -50,12 +66,11 @@ At the moment, only source installation is supported. Use Ubuntu Focal. cd ~/buoy_ws ``` -1. Set the Gazebo version to Fortress. This is needed because we're not using an +1. Set the Gazebo version to Garden. This is needed because we're not using an official ROS + Gazebo combination: ``` - export IGNITION_VERSION=fortress - export GZ_VERSION=fortress + export GZ_VERSION=garden ``` 1. Install ROS dependencies @@ -70,7 +85,7 @@ At the moment, only source installation is supported. Use Ubuntu Focal. 1. Build and install ``` - source /opt/ros/galactic/setup.bash + source /opt/ros/humble/setup.bash cd ~/buoy_ws colcon build ``` @@ -107,7 +122,7 @@ At the moment, only source installation is supported. Use Ubuntu Focal. ``` 1. Build the docker image - + ``` ./build.bash buoy ``` @@ -137,5 +152,5 @@ At the moment, only source installation is supported. Use Ubuntu Focal. Inside the docker container, run: ``` -ign gazebo mbari_wec.sdf -r +gz sim mbari_wec.sdf -r ``` diff --git a/buoy_all.yaml b/buoy_all.yaml index ccf7f12e..5128e1c4 100644 --- a/buoy_all.yaml +++ b/buoy_all.yaml @@ -8,12 +8,12 @@ repositories: type: git url: https://github.com/osrf/buoy_sim version: main - # Must compile ros_ign from source because Galactic + Fortress is not an official combination - ros_ign: + # Must compile ros_gz from source because Humble + Garden is not an official combination + ros_gz: type: git - url: https://github.com/osrf/ros_ign - version: galactic + url: https://github.com/gazebosim/ros_gz + version: ros2 sdformat_urdf: type: git url: https://github.com/ros/sdformat_urdf - version: galactic + version: ros2 diff --git a/docker/buoy/Dockerfile b/docker/buoy/Dockerfile index 339093f3..43abcd22 100644 --- a/docker/buoy/Dockerfile +++ b/docker/buoy/Dockerfile @@ -1,6 +1,12 @@ -FROM ros:galactic-ros-base +FROM ros:humble-ros-base ENV DEBIAN_FRONTEND=noninteractive +# Need to use cyclonedds rather than default rmw provider +RUN apt update \ + && apt install -y \ + ros-humble-rmw-cyclonedds-cpp +ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp + # Necessary tools RUN apt update \ && apt install -y \ @@ -8,8 +14,14 @@ RUN apt update \ wget # Using non-official Gazebo + ROS combination, set it explicitly -ENV IGNITION_VERSION fortress -ENV GZ_VERSION fortress +ENV GZ_VERSION garden + +# Garden only has nightlies for now +RUN /bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' \ + && /bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list' \ + && /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \ + && apt-get update \ + && apt-get install -y gz-garden # Create project directory and import packages RUN mkdir -p /tmp/buoy_ws/src \