Skip to content

ROS 2 jazzy package #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: ros2-main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .docker/dev-container/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
version: '2'
services:
ros-rrc-dev:
image: compasrrc/compas_rrc_driver:v1.1.2
image: compasrrc/compas_rrc_driver:jazzy
container_name: ros-rrc-dev
environment:
- ROS_HOSTNAME=ros-rrc-dev
- ROS_MASTER_URI=http://ros-rrc-dev:11311
- ROS_LANG_DISABLE=genlisp:gennodejs:geneus
ports:
- "9090:9090"
- "30101:30101"
- "30201:30201"
command:
- roslaunch
- /root/catkin_ws/scripts/main.launch
- ros2
- run
- compas_rrc_driver
- driver
- "--ros-args"
- "-p"
- "robot_ip_address:=host.docker.internal"
volumes:
- ./scripts:/root/catkin_ws/scripts
- ./logs:/root/catkin_ws/logs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Source ROS distro environment and local catkin workspace
source "/opt/ros/$ROS_DISTRO/setup.bash" && source "$CATKIN_WS/devel/setup.bash"
source "/opt/ros/$ROS_DISTRO/setup.bash" && source "$WS/install/setup.bash"

exec "$@"
5 changes: 3 additions & 2 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
- "ros2"
tags:
- "v*"
pull_request:
Expand Down Expand Up @@ -36,8 +37,8 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
continue-on-error: true
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -46,6 +47,6 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.repository_owner == 'compas-rrc' && github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
18 changes: 18 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build ROS packages

on:
push:

jobs:
build-pkg:
runs-on: ubuntu-latest
container:
image: ubuntu:noble
steps:
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: jazzy
- uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: compas_rrc_driver
target-ros2-distro: jazzy
196 changes: 0 additions & 196 deletions CMakeLists.txt

This file was deleted.

28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@
# Usage:
# docker pull compasrrc/compas_rrc_driver

FROM ros:noetic-ros-core
FROM ros:jazzy-ros-core
LABEL maintainer="RRC Team <rrc@arch.ethz.ch>"

SHELL ["/bin/bash","-c"]

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

# Install packages
RUN apt-get update && apt-get install -y \
# Basic utilities
iputils-ping \
# ROS bridge server and related packages
ros-${ROS_DISTRO}-rosbridge-server \
ros-${ROS_DISTRO}-tf2-web-republisher \
--no-install-recommends \
# Clear apt-cache to reduce image size
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -28,29 +23,28 @@ RUN apt-get update && apt-get install -y \
ENV RRC_BUILD=1

# Create local catkin workspace
ENV CATKIN_WS=/root/catkin_ws
ENV WS=/root/ws
# Add COMPAS RRC Driver package
ADD . $CATKIN_WS/src/compas_rrc_driver
WORKDIR $CATKIN_WS/src
ADD . $WS/src/compas_rrc_driver
WORKDIR $WS/src

RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
# Update apt-get because its cache is always cleared after installs to keep image size down
&& apt-get update \
&& test $ROS_PYTHON_VERSION -eq 3 && ROSDEP_PKG="python3-rosdep" || ROSDEP_PKG="python-rosdep" \
; apt-get install build-essential $ROSDEP_PKG -y \
&& apt-get install ros-dev-tools -y \
# Reconfigure rosdep
&& rm -rf /etc/ros/rosdep/sources.list.d/* \
&& rosdep init && rosdep update --include-eol-distros \
&& rosdep init && rosdep update \
# Install dependencies
&& cd $CATKIN_WS \
&& cd $WS \
&& rosdep install -y --from-paths . --ignore-src --rosdistro ${ROS_DISTRO} \
# Build catkin workspace
&& ROS_LANG_DISABLE=geneus:genlisp:gennodejs catkin_make \
&& colcon build \
# Clear apt-cache to reduce image size
&& rm -rf /var/lib/apt/lists/*

COPY ./.docker/ros_catkin_entrypoint.sh /
RUN chmod +x /ros_catkin_entrypoint.sh
COPY ./.docker/ros_entrypoint.sh /
RUN chmod +x /ros_entrypoint.sh

ENTRYPOINT ["/ros_catkin_entrypoint.sh"]
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
Loading