From fde7c26e713189c4cd5e1041f27f1405cf6b96cc Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Fri, 7 Jun 2024 11:29:55 +0530 Subject: [PATCH] Jazzy support --- .github/workflows/main.yml | 23 +++++++++++++++-------- realsense2_camera/CMakeLists.txt | 6 +++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49eeebd637..61ebb1e003 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - ros_distro: [rolling, iron, humble, foxy] + ros_distro: [rolling, iron, humble, foxy, jazzy] include: - ros_distro: 'rolling' os: ubuntu-22.04 @@ -35,6 +35,8 @@ jobs: os: ubuntu-22.04 - ros_distro: 'foxy' os: ubuntu-20.04 + - ros_distro: 'jazzy' + os: ubuntu-24.04 steps: @@ -53,14 +55,14 @@ jobs: ./pr_check.sh # setup-ros@v0.6 is the last version supporting foxy (EOL) - # setup-ros@v0.7 is needed to support humble/iron/rolling + # setup-ros@v0.7 is needed to support humble/iron/rolling/jazzy # so, seperating steps with if conditions - name: build ROS2 for foxy if: ${{ matrix.ros_distro == 'foxy' }} uses: ros-tooling/setup-ros@v0.6 with: required-ros-distributions: ${{ matrix.ros_distro }} - - name: build ROS2 for humble/iron/rolling + - name: build ROS2 for humble/iron/rolling/jazzy if: ${{ matrix.ros_distro != 'foxy' }} uses: ros-tooling/setup-ros@v0.7 with: @@ -92,13 +94,13 @@ jobs: echo "================= ROSDEP UPDATE =====================" # temp fix for rolling sources.. TODO: track when we can remove the two commands below # see https://discourse.ros.org/t/psa-rolling-ci-or-docker-build-fix-from-rosdep-errors-in-24-04-transition/36902 - sudo sed -i "s|ros\/rosdistro\/master|ros\/rosdistro\/rolling\/2024-02-28|" /etc/ros/rosdep/sources.list.d/20-default.list - export ROSDISTRO_INDEX_URL=https://raw.githubusercontent.com/ros/rosdistro/rolling/2024-02-28/index-v4.yaml + sudo sed -i "s|ros\/rosdistro\/master|ros\/rosdistro\/rolling\/2024-04-30|" /etc/ros/rosdep/sources.list.d/20-default.list + export ROSDISTRO_INDEX_URL=https://raw.githubusercontent.com/ros/rosdistro/rolling/2024-04-30/index-v4.yaml rosdep update --rosdistro ${{ matrix.ros_distro }} --include-eol-distros echo "================= ROSDEP INSTALL ====================" rosdep install -i --reinstall --from-path src --rosdistro ${{ matrix.ros_distro }} --skip-keys=librealsense2 -y echo "================== COLCON BUILD ======================" - colcon build --cmake-args '-DBUILD_TOOLS=ON' + colcon build --cmake-args '-DBUILD_TOOLS=ON' --no-warn-unused-cli ## This step is commented out since we don't use rosbag files in "Run Tests" step below. ## Please uncomment when "Run Tests" step is fixed to run all tests. @@ -114,9 +116,13 @@ jobs: - name: Install Packages For Tests run: | + sudo apt install python3-venv + python3 -m venv .venv + source .venv/bin/activate sudo apt-get install python3-pip pip3 install numpy --upgrade - pip3 install numpy-quaternion tqdm + pip3 install numpy-quaternion tqdm pyyaml + - name: Run Tests run: | @@ -126,7 +132,8 @@ jobs: # the next command might be needed for foxy distro, since this package is not installed # by default in ubuntu 20.04. For other distro, the apt install command will be ignored. sudo apt install -y ros-${{matrix.ros_distro}}-sensor-msgs-py - python3 src/realsense-ros/realsense2_camera/scripts/rs2_test.py non_existent_file + source ../.venv/bin/activate + ../.venv/bin/python3 src/realsense-ros/realsense2_camera/scripts/rs2_test.py non_existent_file # don't run integration tests for foxy since some testing dependecies packages like # tf_ros_py are not avaialble diff --git a/realsense2_camera/CMakeLists.txt b/realsense2_camera/CMakeLists.txt index 0d6d14475d..d888a3a8c5 100644 --- a/realsense2_camera/CMakeLists.txt +++ b/realsense2_camera/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright 2023 Intel Corporation. All Rights Reserved. +# Copyright 2024 Intel Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -170,6 +170,10 @@ elseif("$ENV{ROS_DISTRO}" STREQUAL "rolling") message(STATUS "Build for ROS2 Rolling") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROLLING") set(SOURCES "${SOURCES}" src/ros_param_backend.cpp) +elseif("$ENV{ROS_DISTRO}" STREQUAL "jazzy") + message(STATUS "Build for ROS2 Jazzy") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJAZZY") + set(SOURCES "${SOURCES}" src/ros_param_backend.cpp) else() message(FATAL_ERROR "Unsupported ROS Distribution: " "$ENV{ROS_DISTRO}") endif()