Skip to content

Commit

Permalink
Switch to Humble/Garden on 22.04 (#22)
Browse files Browse the repository at this point in the history
* Upgrade to Humble + Garden

Signed-off-by: Louise Poubel <louise@openrobotics.org>

* gz

Signed-off-by: Louise Poubel <louise@openrobotics.org>

* Temporarily override versions for CI

Signed-off-by: Michael Carroll <michael@openrobotics.org>

* add instructions for pythonpath building gz-sim from source

Signed-off-by: Michael Anderson <anderson@mbari.org>

* typo

Signed-off-by: Michael Anderson <anderson@mbari.org>

* Update README.md

* use cyclonedds in dockerfile

Signed-off-by: Michael Anderson <anderson@mbari.org>

* typo

Signed-off-by: Michael Anderson <anderson@mbari.org>

* swap branches to main in vcs yaml

Signed-off-by: Michael Anderson <anderson@mbari.org>

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Anderson <anderson@mbari.org>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
Co-authored-by: Dharini Dutia <dharini@openrobotics.org>
Co-authored-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
4 people authored Jan 21, 2023
1 parent febc870 commit 4444143
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<path to your gz-sim workspace>/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
Expand All @@ -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
Expand All @@ -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
```
Expand Down Expand Up @@ -107,7 +122,7 @@ At the moment, only source installation is supported. Use Ubuntu Focal.
```
1. Build the docker image
```
./build.bash buoy
```
Expand Down Expand Up @@ -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
```
10 changes: 5 additions & 5 deletions buoy_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 15 additions & 3 deletions docker/buoy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
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 \
apt-utils \
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 \
Expand Down

0 comments on commit 4444143

Please sign in to comment.