Skip to content

Commit fc19ffd

Browse files
committed
Fix issue related to ROS2 on 24.04
1 parent 57aa95b commit fc19ffd

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
lines changed

.github/workflows/test_ubuntu.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,20 @@ jobs:
1919
- name: Build AirLib
2020
run: ./build.sh
2121

22-
- name: Build ROS Wrapper
22+
- name: Build ROS2 Jammy Wrapper
23+
if: matrix.os == 'ubuntu-22.04'
2324
run: |
24-
./tools/install_ros_deps.sh
25+
chmod +x ./tools/install_ros2_deps.sh
26+
./tools/install_ros2_deps.sh
2527
source /opt/ros/*/setup.bash
26-
cd ros
27-
catkin build -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12
28+
cd ros2
29+
colcon build --cmake-args -DCMAKE_C_COMPILER=gcc-12 --cmake-args -DCMAKE_CXX_COMPILER=g++-12
2830
29-
- name: Build ROS2 Wrapper
30-
if: matrix.os == 'ubuntu-22.04'
31+
- name: Build ROS2 Foxy Wrapper
32+
if: matrix.os == 'ubuntu-24.04'
3133
run: |
3234
chmod +x ./tools/install_ros2_deps.sh
3335
./tools/install_ros2_deps.sh
3436
source /opt/ros/*/setup.bash
3537
cd ros2
3638
colcon build --cmake-args -DCMAKE_C_COMPILER=gcc-12 --cmake-args -DCMAKE_CXX_COMPILER=g++-12
37-
38-
# Removing support for GazeboDrone. Gazebo is dead. Long live AirSim/Colosseum.
39-
# - name: Build GazeboDrone
40-
# run: |
41-
# sudo apt-get install -qq libgazebo9-dev gcc-12 g++-12
42-
# ./clean.sh && ./build.sh --gcc
43-
# cd GazeboDrone
44-
# mkdir build && cd build
45-
# cmake -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 ..
46-
# make

setup.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,29 @@ else #linux
108108
# in ubuntu 18 docker CI, avoid building cmake from scratch to save time
109109
# ref: https://apt.kitware.com/
110110
ubuntu_version="$(lsb_release -rs)"
111-
if [[ "$ubuntu_version" == "22.04" || "$ubuntu_version" == "24.04" ]]; then
111+
112+
if [[ "$ubuntu_version" == "22.04" ]]; then
112113
sudo apt-get -y install \
113114
apt-transport-https \
114115
ca-certificates \
115116
gnupg
116117
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
117-
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
118-
sudo apt-get -y install --no-install-recommends \
118+
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ jammy main"
119+
sudo apt update && apt-get -y install --no-install-recommends \
119120
make \
120-
cmake
121-
121+
cmake \
122+
openssl
123+
elif [[ "$ubuntu_version" == "24.04" ]]; then
124+
sudo apt-get -y install \
125+
apt-transport-https \
126+
ca-certificates \
127+
gnupg
128+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
129+
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ noble main"
130+
sudo apt update && apt-get -y install --no-install-recommends \
131+
make \
132+
cmake \
133+
openssl
122134
else
123135
# For anything else, build CMake 3.10.2 from source
124136
if [[ ! -d "cmake_build/bin" ]]; then

tools/install_ros2_deps.sh

100644100755
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
set -x
66

77
DISTRO="$(lsb_release -sc)"
8-
if [[ "$DISTRO" == "focal" ]]; then
9-
ROS_DISTRO="galactic"
8+
if [[ "$DISTRO" == "jammy" ]]; then
9+
ROS_DISTRO="humble"
10+
11+
elif [[ "$DISTRO" == "noble" ]]; then
12+
ROS_DISTRO="kilted"
1013
else
11-
echo "ROS2 support only ubuntu focal"
14+
echo "ROS2 support only ubuntu jammy (22.04) and noble (24.04) at the moment."
1215
exit 1
1316
fi
1417

0 commit comments

Comments
 (0)