Skip to content

Commit

Permalink
Add the ability to configure ROS middleware upon build (#409)
Browse files Browse the repository at this point in the history
* Add the ability to configure ROS middleware upon build
* Conditionally install cyclonedds if was chosen
  • Loading branch information
Samahu authored Dec 6, 2024
1 parent f200438 commit e4dd8bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ jobs:
- humble
- iron
- jazzy
rmw_imp:
- rmw_fastrtps_cpp
- rmw_cyclonedds_cpp
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build the Docker image
run: |
docker build . \
--build-arg ROS_DISTRO=${{ matrix.ros_distro }} \
--file Dockerfile \
docker build . \
--build-arg ROS_DISTRO=${{ matrix.ros_distro }} \
--build-arg RMW_IMPLEMENTATION=${{ matrix.rmw_imp }} \
--file Dockerfile \
--tag ouster-ros-${{ matrix.ros_distro }}:$(date +%s)
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ARG ROS_DISTRO=rolling
ARG RMW_IMPLEMENTATION=rmw_fastrtps_cpp

FROM ros:${ROS_DISTRO}-ros-core AS build-env
ENV DEBIAN_FRONTEND=noninteractive \
RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION} \
BUILD_HOME=/var/lib/build \
OUSTER_ROS_PATH=/opt/ros2_ws/src/ouster-ros

Expand All @@ -20,6 +22,10 @@ RUN set -xue \
python3-bloom \
python3-colcon-common-extensions

RUN if [ "$RMW_IMPLEMENTATION" = "rmw_cyclonedds_cpp" ]; then \
apt-get install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp; \
fi

# Set up non-root build user
ARG BUILD_UID=1000
ARG BUILD_GID=${BUILD_UID}
Expand Down

0 comments on commit e4dd8bf

Please sign in to comment.