Skip to content

Commit

Permalink
PR #2406 from Samer: Support ROS2 Humble
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Jul 14, 2022
2 parents be06827 + 766c770 commit 505c23b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 17 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -48,20 +50,48 @@ jobs:
run: |
cd ${{github.workspace}}/ros2/src/realsense-ros/scripts
./pr_check.sh
- uses: ros-tooling/[email protected]
## If distro is one of [galactic, foxy, eloquent, dashing], use the [email protected]
## 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/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- name: build ROS2 Humble
if: ${{ matrix.ros_distro == 'humble' }}
uses: ros-tooling/[email protected]
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
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main"
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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,7 +76,7 @@ LibRealSense supported version: v2.50.0 (see [realsense2_camera release notes](h

### Step 6: Terminal environment
```bash
ROS_DISTRO=<YOUR_SYSTEM_ROS_DISTRO> # set your ROS_DISTRO: galactic, foxy, eloquent, dashing
ROS_DISTRO=<YOUR_SYSTEM_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
Expand Down
4 changes: 4 additions & 0 deletions realsense2_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion realsense2_camera/src/dynamic_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 505c23b

Please sign in to comment.