diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c7cd54..5df9f7c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,13 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: build rmf image and push to gh registry - uses: docker/build-push-action@v1 - with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: docker.pkg.github.com - repository: ${{ github.repository }}/rmf_demos - # update registry only during push to main and nightly build - push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - tags: latest + - name: build rmf_demos image + run: ./build-docker.sh + - name: push to gh registry + if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + run: docker push ghcr.io/open-rmf/rmf/rmf_demos diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 295dffa..dc3bcf4 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -8,19 +8,23 @@ on: jobs: build_and_test: name: Nightly build and test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: deps - uses: ros-tooling/setup-ros@v0.2 + uses: ros-tooling/setup-ros@v0.3 with: - required-ros-distributions: galactic + required-ros-distributions: humble + - name: setup clang + run: | + sudo apt update && sudo apt install -y clang lldb lld + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 - uses: actions/checkout@v2 - name: build_and_test uses: ros-tooling/action-ros-ci@v0.2 env: QT_QPA_PLATFORM: offscreen with: - target-ros2-distro: galactic + target-ros2-distro: humble # build all packages listed in the meta package package-name: | rmf_utils diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81da6b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/rmf_deployment_template/ diff --git a/Dockerfile b/Dockerfile index ba23765..f705ed8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,74 +1,6 @@ -#----------------------- -# Stage 1 - Dependencies -#----------------------- +FROM ghcr.io/open-rmf/rmf_deployment_template/builder-rmf -FROM ros:galactic AS builder - -RUN apt-get update \ - && apt-get install -y \ - cmake \ - curl \ - git \ - python3-colcon-common-extensions \ - python3-vcstool \ - qt5-default \ - wget \ - python3-pip \ - && pip3 install flask-socketio \ - && rm -rf /var/lib/apt/lists/* - -# setup keys -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 - -# setup sources.list -RUN . /etc/os-release \ - && echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list - -RUN mkdir $HOME/rmf_demos_ws -WORKDIR $HOME/rmf_demos_ws -RUN mkdir src -RUN rosdep update --rosdistro $ROS_DISTRO - -# This replaces: wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos -ENV DEBIAN_FRONTEND=noninteractive -COPY rmf.repos rmf.repos -RUN vcs import src < rmf.repos \ - && apt-get update \ - && apt-get upgrade -y \ - && rosdep update \ - && rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -yr \ - && rm -rf /var/lib/apt/lists/* -RUN apt-get update \ - && apt-get install -y ignition-edifice \ - && rm -rf /var/lib/apt/lists/* - -#----------------- -# Stage 2 - build -#----------------- - -# compile rmf_demo_panel gui -# use wget -# RUN npm install --prefix src/demonstrations/rmf_demos/rmf_demos_panel/rmf_demos_panel/static/ \ - # && npm run build --prefix src/demonstrations/rmf_demos/rmf_demos_panel/rmf_demos_panel/static/ - -# colcon compilation -RUN . /opt/ros/$ROS_DISTRO/setup.sh \ - && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release - -#---------- -# Stage 3 -#---------- - -# TODO: rosdep doesn't support installing only exec dependencies (https://github.com/ros-infrastructure/rosdep/pull/727) -# When the PR is merged, we can do a multi-stage build and include only whats needed at runtime. -# FROM ros:foxy -# COPY --from=0 /root/rmf/install /opt/rmf -# RUN rosdep ... -# COPY --from=builder /root/rmf/install /opt/rmf - -# cleanup -RUN rm -rf build devel src \ - && sed -i '$isource "/rmf_demos_ws/install/setup.bash"' /ros_entrypoint.sh +RUN sed -i '$isource "/opt/rmf/install/setup.bash"' /ros_entrypoint.sh ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["bash"] diff --git a/README.md b/README.md index b28a0bd..b4af985 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ The OpenRMF platform for multi-fleet robot management. --- -## Install ROS 2 Galactic +## Install ROS 2 Humble -First, please follow the installation instructions for ROS 2 Galactic. -If you are on an Ubuntu 20.04 LTS machine (as recommended), [here is the binary install page for ROS 2 Galactic on Ubuntu 20.04](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html). +First, please follow the installation instructions for ROS 2 Humble. +If you are on an Ubuntu 22.04 LTS machine (as recommended), [here is the binary install page for ROS 2 Humble on Ubuntu 22.04](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html). ## Setup Gazebo repositories @@ -26,18 +26,18 @@ wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - ## Binary install -OpenRMF binary packages are available for Ubuntu Focal 20.04 for the `Foxy`, `Galactic` and `Rolling` releases of ROS 2. Most OpenRMF packages have the prefix `rmf` on their name, therefore, you can find them by them by searching for the pattern `ros--rmf`, e.g., for galatic it would be: +Latest OpenRMF binary packages are available for Ubuntu Jammy 22.04 for the `Humble` and `Rolling` releases of ROS 2. Older releases are also available on Ubuntu Focal 20.04 for `Foxy` and `Galactic`. Most OpenRMF packages have the prefix `rmf` on their name, therefore, you can find them by them by searching for the pattern `ros--rmf`, e.g., for galatic it would be: ```bash -apt-cache search ros-galactic-rmf +apt-cache search ros-humble-rmf ``` ### RMF Demos -A good way to install the `rmf` set of packages in one go is to install the one of the main [RMF Demos](https://github.com/open-rmf/rmf_demos) packages. This will pull all the rest of the OpenRMF packages as a dependency. The core of RMF demos is contained on the `rmf_demos` package. However, if you want to install it with simulation support, you should install the `rmf_demos_gz` or `rmf_demos_ign` package which come with gazebo or ignition support respectively. As an example, to install the ROS 2 Galactic release with gazebo support package, you would run: +A good way to install the `rmf` set of packages in one go is to install the one of the main [RMF Demos](https://github.com/open-rmf/rmf_demos) packages. This will pull all the rest of the OpenRMF packages as a dependency. The core of RMF demos is contained on the `rmf_demos` package. However, if you want to install it with simulation support, you should install the `rmf_demos_gz` or `rmf_demos_ign` package which come with gazebo or ignition support respectively. As an example, to install the ROS 2 Humble release with gazebo support package, you would run: ```bash -sudo apt install ros-galactic-rmf-demos-gz +sudo apt install ros-humble-rmf-demos-gz ``` ## Building from sources @@ -76,24 +76,37 @@ mkdir -p ~/rmf_ws/src cd ~/rmf_ws wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos vcs import src < rmf.repos +wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf-simulation.repos +vcs import src < rmf-simulation.repos ``` Ensure all ROS 2 prerequisites are fulfilled, ``` cd ~/rmf_ws -rosdep install --from-paths src --ignore-src --rosdistro galactic -y +rosdep install --from-paths src --ignore-src --rosdistro humble -y ``` ### Compiling Instructions -> NOTE: Due to newer changes in the source build, there might be conflicts and compilation errors with older header files installed by the binaries. Please remove the binary installations before building from source, using `sudo apt remove ros-galactic-rmf*`. +> NOTE: Due to newer changes in the source build, there might be conflicts and compilation errors with older header files installed by the binaries. Please remove the binary installations before building from source, using `sudo apt remove ros-humble-rmf*`. -Compiling on `Ubuntu 20.04`: +Compiling on `Ubuntu 22.04`: + +Install clang + +```bash +sudo apt update +sudo apt install clang lldb lld +``` + +**NOTE: RMF does not support building on gcc.** + +Compile using clang ```bash cd ~/rmf_ws -source /opt/ros/galactic/setup.bash -colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release +source /opt/ros/humble/setup.bash +CXX=clang++ LDFLAGS='-fuse-ld=lld' colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ``` > NOTE: The first time the build occurs, many simulation models will be downloaded from Ignition Fuel to populate the scene when the simulation is run. @@ -106,18 +119,8 @@ Demonstrations of OpenRMF are shown in [rmf_demos](https://github.com/open-rmf/r ### Docker Containers Alternatively, you can run RMF Demos by using [docker](https://docs.docker.com/engine/install/ubuntu/). -Pull docker image from `open-rmf/rmf` github registry (setup refer [here](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token)). - -```bash -docker pull ghcr.io/open-rmf/rmf/rmf_demos:latest -docker tag ghcr.io/open-rmf/rmf/rmf_demos:latest rmf:latest -``` - -Run it! - ```bash - -docker run -it --network host rmf:latest bash -c "export ROS_DOMAIN_ID=9; ros2 launch rmf_demos_gz office.launch.xml headless:=1" +docker run -it --network host ghcr.io/open-rmf/rmf/rmf_demos:latest bash -c "export ROS_DOMAIN_ID=9; ros2 launch rmf_demos_gz office.launch.xml headless:=1" ``` This will run `rmf_demos` in headless mode. Open [this link](https://open-rmf.github.io/rmf-panel-js/) with a browser to start a task. diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..d85f527 --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e + +cd "$(dirname $0)" + +git clone --depth 1 -b build/rmf https://github.com/open-rmf/rmf_deployment_template.git +pushd rmf_deployment_template +docker build -t ghcr.io/open-rmf/rmf_deployment_template/builder-rosdep -f rmf/builder-rosdep.Dockerfile . +docker build -t ghcr.io/open-rmf/rmf_deployment_template/builder-rmf -f rmf/builder-rmf.Dockerfile . +popd + +docker build -t ghcr.io/open-rmf/rmf/rmf_demos - < Dockerfile diff --git a/rmf-simulation.repos b/rmf-simulation.repos new file mode 100644 index 0000000..e729239 --- /dev/null +++ b/rmf-simulation.repos @@ -0,0 +1,15 @@ +repositories: + rmf/rmf_simulation: + type: git + url: https://github.com/open-rmf/rmf_simulation.git + version: main + rmf/rmf_internal_msgs: + type: git + url: https://github.com/open-rmf/rmf_internal_msgs.git + version: main + rmf/rmf_building_map_msgs: + type: git + url: https://github.com/open-rmf/rmf_building_map_msgs.git + thirdparty/menge_vendor: + type: git + url: https://github.com/open-rmf/menge_vendor.git diff --git a/rmf.repos b/rmf.repos index 15e1487..18ece44 100644 --- a/rmf.repos +++ b/rmf.repos @@ -67,7 +67,3 @@ repositories: type: git url: https://github.com/open-rmf/pybind11_json_vendor.git version: main - thirdparty/ros_ign: - type: git - url: https://github.com/ignitionrobotics/ros_ign.git - version: galactic