diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37a64cfd8d..d6873a3d38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,12 +23,14 @@ jobs: strategy: fail-fast: false matrix: - ros_distro: [foxy, galactic, eloquent, dashing] + ros_distro: [humble, galactic, foxy, eloquent, dashing] include: - - ros_distro: 'foxy' - os: ubuntu-20.04 + - ros_distro: 'humble' + os: ubuntu-22.04 - ros_distro: 'galactic' os: ubuntu-20.04 + - ros_distro: 'foxy' + os: ubuntu-20.04 - ros_distro: 'eloquent' os: ubuntu-18.04 - ros_distro: 'dashing' @@ -38,7 +40,7 @@ jobs: - name: Setup ROS2 Workspace run: | mkdir -p ${{github.workspace}}/ros2/src - + - uses: actions/checkout@v2 with: path: 'ros2/src/realsense-ros' @@ -48,12 +50,27 @@ jobs: run: | cd ${{github.workspace}}/ros2/src/realsense-ros/scripts ./pr_check.sh - - - uses: ros-tooling/setup-ros@v0.2 + + ## If distro is one of [galactic, foxy, eloquent, dashing], use the setup-ros@v0.2 + ## which supports old versions of ROS2 and EOL versions. + ## For Humble distro, use v0.3 + ## See: 1) https://github.com/ros-tooling/setup-ros#Supported-platforms + ## 2) https://github.com/ros-tooling/setup-ros/tree/v0.2#Supported-platforms + - name: build ROS2 Galactic/Foxy/Eloquent/Dashing + if: ${{ matrix.ros_distro != 'humble'}} + uses: ros-tooling/setup-ros@v0.2 + with: + required-ros-distributions: ${{ matrix.ros_distro }} + - name: build ROS2 Humble + if: ${{ matrix.ros_distro == 'humble' }} + uses: ros-tooling/setup-ros@v0.3 with: required-ros-distributions: ${{ matrix.ros_distro }} + ## For all distros except humble, install RealSense SDK From Debinas + ## For Humble distro, install from source (TODO: Change this when we got debians for Humble) - name: Install RealSense SDK 2.0 Dependencies + if: ${{ matrix.ros_distro != 'humble' }} run: | sudo apt-get update sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-key C8B3A55A6F3EFCDE @@ -61,7 +78,20 @@ jobs: sudo apt-get update -qq sudo apt-get install librealsense2-dev --allow-unauthenticated -y sudo apt-get update - + - name: Build RealSense SDK 2.0 from source + if: ${{ matrix.ros_distro == 'humble' }} + run: | + cd ${{github.workspace}} + git clone https://github.com/IntelRealSense/librealsense.git -b master + cd librealsense + sudo mkdir build + cd build + sudo cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=false -DBUILD_GRAPHICAL_EXAMPLES=false + sudo make uninstall + sudo make clean + sudo make -j10 + sudo make install + - name: Build run: | echo "source /opt/ros/${{ matrix.ros_distro }}/setup.bash" >> ${{github.workspace}}/.bashrc diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c7b8304fde..adf299bb1b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -31,12 +31,12 @@ jobs: strategy: fail-fast: false matrix: - ros_distro: [foxy, galactic] + ros_distro: [galactic, foxy] include: - - ros_distro: 'foxy' - os: ubuntu-20.04 - ros_distro: 'galactic' os: ubuntu-20.04 + - ros_distro: 'foxy' + os: ubuntu-20.04 env: ROS_DISTRO: ${{ matrix.ros_distro }} diff --git a/README.md b/README.md index aec9f15a85..c5eb2c8592 100644 --- a/README.md +++ b/README.md @@ -28,18 +28,19 @@ LibRealSense supported version: v2.50.0 (see [realsense2_camera release notes](h ## Installation Instructions ### Step 1: Install the ROS2 distribution - - #### Ubuntu 18.04 : - - [ROS2 Dashing](https://docs.ros.org/en/dashing/Installation/Ubuntu-Install-Debians.html) - - [ROS2 Eloquent](https://docs.ros.org/en/eloquent/Installation/Linux-Install-Debians.html) + - #### Ubuntu 22.04: + - [ROS2 Humble](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) - #### Ubuntu 20.04: - [ROS2 Foxy](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) - [ROS2 Galactic](https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html) - - [ROS2 Rolling](https://docs.ros.org/en/rolling/Installation/Ubuntu-Install-Debians.html) + - #### Ubuntu 18.04 : + - [ROS2 Dashing](https://docs.ros.org/en/dashing/Installation/Ubuntu-Install-Debians.html) + - [ROS2 Eloquent](https://docs.ros.org/en/eloquent/Installation/Linux-Install-Debians.html) ### Step 2: Install the latest Intel® RealSense™ SDK 2.0 -- #### Option 1: Install librealsense2 debian package +- #### Option 1: Install librealsense2 debian package (Not supported in Ubuntu 22.04 yet) - Jetson users - use the [Jetson Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md) - Otherwise, install from [Linux Debian Installation Guide](https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages) - In this case treat yourself as a developer: make sure to follow the instructions to also install librealsense2-dev and librealsense2-dkms packages @@ -75,7 +76,7 @@ LibRealSense supported version: v2.50.0 (see [realsense2_camera release notes](h ### Step 6: Terminal environment ```bash - ROS_DISTRO= # set your ROS_DISTRO: galactic, foxy, eloquent, dashing + ROS_DISTRO= # set your ROS_DISTRO: humble, galactic, foxy, eloquent, dashing source /opt/ros/$ROS_DISTRO/setup.bash cd ~/ros2_ws . install/local_setup.bash diff --git a/realsense2_camera/CMakeLists.txt b/realsense2_camera/CMakeLists.txt index 82361c0401..4dcd142f65 100644 --- a/realsense2_camera/CMakeLists.txt +++ b/realsense2_camera/CMakeLists.txt @@ -145,6 +145,10 @@ elseif("$ENV{ROS_DISTRO}" STREQUAL "galactic") message(STATUS "Build for ROS2 Galactic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGALACTIC") set(SOURCES "${SOURCES}" src/ros_param_backend_foxy.cpp) +elseif("$ENV{ROS_DISTRO}" STREQUAL "humble") + message(STATUS "Build for ROS2 Humble") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHUMBLE") + set(SOURCES "${SOURCES}" src/ros_param_backend_foxy.cpp) elseif("$ENV{ROS_DISTRO}" STREQUAL "rolling") message(STATUS "Build for ROS2 Rolling") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DROLLING") diff --git a/realsense2_camera/src/dynamic_params.cpp b/realsense2_camera/src/dynamic_params.cpp index b6aaad6593..7622f54aad 100644 --- a/realsense2_camera/src/dynamic_params.cpp +++ b/realsense2_camera/src/dynamic_params.cpp @@ -103,7 +103,9 @@ namespace realsense2_camera try { ROS_DEBUG_STREAM("setParam::Setting parameter: " << param_name); -#if defined(GALACTIC) || defined(ROLLING) +#if defined(DASHING) || defined(ELOQUENT) || defined(FOXY) + //do nothing for old versions +#else descriptor.dynamic_typing=true; // Without this, undeclare_parameter() throws in Galactic onward. #endif if (!_node.get_parameter(param_name, result_value))