From 383a56545f2d2b89477b1f7b4b8c4c71172351c2 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 20 Aug 2024 17:01:48 +0000 Subject: [PATCH 1/5] Refactor dockerfile --- .devcontainer/Dockerfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1eaba85..f92489f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM osrf/ros:iron-desktop ARG ROS_DISTRO=iron +FROM osrf/ros:$ROS_DISTRO-desktop ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID @@ -35,16 +35,18 @@ RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrin && rm -rf /var/lib/apt/lists/* ENV GZ_VERSION=harmonic -RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \ - mkdir -p /gz_ros2_control_ws/src && mkdir -p /gz_ros2_control_ws/src && \ - cd /gz_ros2_control_ws/src && \ - git clone --branch iron https://github.com/ros-controls/gz_ros2_control && \ - cd /gz_ros2_control_ws && \ +ENV GZ_ROS2_CONTROL_PATH='/gz_ros2_control_ws' +ENV GZ_ROS2_CONTROL_BRANCH='iron' +RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ + mkdir -p $GZ_ROS2_CONTROL_PATH/src && \ + cd $GZ_ROS2_CONTROL_PATH/src && \ + git clone --branch $GZ_ROS2_CONTROL_BRANCH https://github.com/ros-controls/gz_ros2_control && \ + cd $GZ_ROS2_CONTROL_PATH && \ colcon build ENV DEBIAN_FRONTEND=dialog ARG WORKSPACE RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/$USERNAME/.bashrc \ - && echo "if [ -f /gz_ros2_control_ws/install/setup.bash ]; then source /gz_ros2_control_ws/install/setup.bash; fi" >> /home/$USERNAME/.bashrc + && echo "if [ -f $GZ_ROS2_CONTROL_PATH/install/setup.bash ]; then source $GZ_ROS2_CONTROL_PATH/install/setup.bash; fi" >> /home/$USERNAME/.bashrc RUN pip3 install pre-commit From c7176728ea7173a07d936817ffa995bb5a06612e Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 20 Aug 2024 17:41:34 +0000 Subject: [PATCH 2/5] Update docker file to the jazzy version --- .devcontainer/Dockerfile | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f92489f..c0f7bfb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ -ARG ROS_DISTRO=iron +ARG ROS_DISTRO=jazzy FROM osrf/ros:$ROS_DISTRO-desktop ARG USERNAME=ros ARG USER_UID=1000 ARG USER_GID=$USER_UID ENV DEBIAN_FRONTEND=noninteractive -RUN groupadd --gid $USER_GID $USERNAME \ +RUN deluser ubuntu && groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ && apt-get update \ && apt-get install -y sudo \ @@ -23,30 +23,18 @@ RUN sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrin apt-get update --fix-missing \ && apt-get -y install \ gz-harmonic \ + python3-pip pre-commit \ ros-$ROS_DISTRO-xacro ros-$ROS_DISTRO-ros2-control \ - ros-$ROS_DISTRO-ros-gzharmonic-sim \ - ros-$ROS_DISTRO-ros-gzharmonic-bridge \ + ros-$ROS_DISTRO-ros-gz \ ros-$ROS_DISTRO-ros2-controllers \ ros-$ROS_DISTRO-rmw-cyclonedds-cpp \ ros-$ROS_DISTRO-gripper-controllers \ - ament-lint \ + ros-$ROS_DISTRO-gz-ros2-control \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* - -ENV GZ_VERSION=harmonic -ENV GZ_ROS2_CONTROL_PATH='/gz_ros2_control_ws' -ENV GZ_ROS2_CONTROL_BRANCH='iron' -RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ - mkdir -p $GZ_ROS2_CONTROL_PATH/src && \ - cd $GZ_ROS2_CONTROL_PATH/src && \ - git clone --branch $GZ_ROS2_CONTROL_BRANCH https://github.com/ros-controls/gz_ros2_control && \ - cd $GZ_ROS2_CONTROL_PATH && \ - colcon build - ENV DEBIAN_FRONTEND=dialog ARG WORKSPACE RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/$USERNAME/.bashrc \ - && echo "if [ -f $GZ_ROS2_CONTROL_PATH/install/setup.bash ]; then source $GZ_ROS2_CONTROL_PATH/install/setup.bash; fi" >> /home/$USERNAME/.bashrc -RUN pip3 install pre-commit + && echo "if [ -f /opt/ros/$ROS_DISTRO/setup.bash ]; then source /opt/ros/$ROS_DISTRO/setup.bash; fi" >> /home/$USERNAME/.bashrc From 5742526cd64e9853a4e28e3b4f40b46349b6428b Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 20 Aug 2024 17:42:24 +0000 Subject: [PATCH 3/5] Remove dds from decconatiner config --- .devcontainer/devcontainer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7ac1250..1e0cfa2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,8 +27,7 @@ "LIBGL_ALWAYS_SOFTWARE": "1", "NVIDIA_DRIVER_CAPABILITIES": "all", "NVIDIA_VISIBLE_DEVICES": "all", - "QT_X11_NO_MITSHM": "1", - "RMW_IMPLEMENTATION": "rmw_cyclonedds_cpp" + "QT_X11_NO_MITSHM": "1" }, // Set *default* container specific settings.json values on container create. "customizations": { From 40db30792f83d8795a6460cad88eae776fcdbdb3 Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Tue, 20 Aug 2024 17:42:49 +0000 Subject: [PATCH 4/5] Remove comand if from mimc joint --- .../open_manipulator_description/urdf/ros2_control.xacro | 1 - 1 file changed, 1 deletion(-) diff --git a/ros2_grasp_service_demo/open_manipulator/open_manipulator_description/urdf/ros2_control.xacro b/ros2_grasp_service_demo/open_manipulator/open_manipulator_description/urdf/ros2_control.xacro index 596acc3..66825c6 100644 --- a/ros2_grasp_service_demo/open_manipulator/open_manipulator_description/urdf/ros2_control.xacro +++ b/ros2_grasp_service_demo/open_manipulator/open_manipulator_description/urdf/ros2_control.xacro @@ -34,7 +34,6 @@ gripper 1 - From 333ab23b4fb1b60e2ba10924f776c03aa1e3958f Mon Sep 17 00:00:00 2001 From: Wiktor Bajor Date: Wed, 21 Aug 2024 17:21:51 +0200 Subject: [PATCH 5/5] Add pipeline for jazzy --- .github/workflows/build_and_test.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/build_and_test.yaml diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml new file mode 100644 index 0000000..e17d9b4 --- /dev/null +++ b/.github/workflows/build_and_test.yaml @@ -0,0 +1,25 @@ +--- +name: Build and Test (jazzy) + +on: + push: + branches: [jazzy] + + pull_request: + branches: [jazzy] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:jammy + + steps: + - uses: ros-tooling/setup-ros@v0.7 + with: + use-ros2-testing: true + - uses: ros-tooling/action-ros-ci@v0.3 + with: + target-ros2-distro: jazzy