@@ -26,7 +26,18 @@ function setup {
2626 travis_time_start setup.before_install
2727 # before_install:
2828 # Install ROS
29- sudo sh -c " echo \" deb http://packages.ros.org/ros-shadow-fixed/ubuntu ` lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
29+ if [[ " $ROS_DISTRO " == " one" ]]; then
30+ UBUNTU_DISTRO=$( echo " $DOCKER_IMAGE " | cut -d' :' -f2)
31+ echo " deb [trusted=yes] https://raw.githubusercontent.com/k-okada/ros-o-builder/$UBUNTU_DISTRO -one-unstable/repository/ ./" | sudo tee /etc/apt/sources.list.d/ros-o-builder.list
32+ DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt install -y software-properties-common
33+ [[ " $UBUNTU_DISTRO " == " noble" ]] && sudo -E add-apt-repository -y ppa:v-launchpad-jochen-sprickerhof-de/ros
34+ [[ " $UBUNTU_DISTRO " == " jammy" ]] && sudo -E add-apt-repository -y ppa:k-okada/python3-catkin-tools
35+ DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo -E apt install -y python3-rosdep2
36+ echo " yaml https://raw.githubusercontent.com/k-okada/ros-o-builder/$UBUNTU_DISTRO -one-unstable/repository/local.yaml debian" | sudo tee /etc/ros/rosdep/sources.list.d/1-ros-o-builder.list
37+ rosdep update
38+ else
39+ sudo sh -c " echo \" deb http://packages.ros.org/ros-shadow-fixed/ubuntu ` lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
40+ fi
3041 wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
3142 # Setup EoL repository
3243 if [[ " $ROS_DISTRO " == " hydro" || " $ROS_DISTRO " == " jade" || " $ROS_DISTRO " == " lunar" ]]; then
@@ -41,15 +52,33 @@ function setup {
4152 fi
4253 # ##
4354 # Install ROS
44- if [[ " $ROS_DISTRO " == " noetic" ]]; then
55+ if [[ " $ROS_DISTRO " == " one" ]]; then
56+ if [[ " $UBUNTU_DISTRO " == " jammy" ]]; then
57+ sudo apt-get install -y -q python3-catkin-pkg python3-wstool python3-rosinstall-generator python3-osrf-pycommon
58+ sudo apt-get install -y -q python3-catkin-tools
59+ else
60+ sudo apt-get install -y -q python3-pip python3-zombie-imp
61+ pip3 install --user --break-system-packages vcstool
62+ pip3 install --user --break-system-packages rosinstall-generator
63+ export PATH=" $PATH :~/.local/bin"
64+ sudo apt-get install -y -q python3-catkin-pkg python3-osrf-pycommon
65+ sudo apt-get install -y -q catkin-tools
66+ fi
67+ elif [[ " $ROS_DISTRO " == " noetic" ]]; then
4568 sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon
4669 else
4770 sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator
4871 fi
49- sudo apt-get install -y -q ros-$ROS_DISTRO -catkin
72+ if [[ " $ROS_DISTRO " == " one" ]]; then
73+ sudo apt-get install -y -q catkin
74+ sudo apt-get install -y -q ros-$ROS_DISTRO -rosbash ros-$ROS_DISTRO -ros-environment
75+ else
76+ sudo apt-get install -y -q ros-$ROS_DISTRO -catkin
77+ fi
78+ export ROS_DISTRO=$_ROS_DISTRO
5079 source /opt/ros/$ROS_DISTRO /setup.bash
5180 # Setup for rosdep
52- sudo rosdep init
81+ [ -e /etc/ros/rosdep/sources.list.d ] || sudo rosdep init
5382 # use snapshot of rosdep list
5483 # https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517
5584 if [[ " $ROS_DISTRO " =~ " hydro" | " indigo" | " jade" | " kinetic" | " lunar" ]]; then
@@ -78,14 +107,16 @@ function setup {
78107 # before_script:
79108 # source dependencies: install using wstool.
80109 cd ~ /catkin_ws/src
81- wstool init
110+ wstool init || echo " OK "
82111 # if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
83112 if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator image_pipeline --upstream >> .rosinstall.opencv3; fi # need to recompile image_proc
84113 if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator compressed_image_transport --upstream >> .rosinstall.opencv3; fi # need to recompile compressed_image_transport
85114 if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator vision_opencv --upstream >> .rosinstall.opencv3; fi # need to recompile visoin_opencv
86- if [ " $OPENCV_VERSION " == 3 ]; then wstool merge .rosinstall.opencv3; fi # need to recompile visoin_opencv
87- wstool up
88- wstool info
115+ if [ " $OPENCV_VERSION " == 3 ]; then wstool merge .rosinstall.opencv3 || [ ! -s .rosinstall.opencv3 ] || vcs import . < .rosinstall.opencv3 ; fi # need to recompile visoin_opencv
116+ git config --global --add safe.directory $CI_SOURCE_PATH
117+ git config --global --add safe.directory ~ /catkin_ws/src || echo " OK"
118+ wstool up || vcs pull
119+ wstool info || vcs branch
89120 if [ " $OPENCV_VERSION " == 3 ]; then sed -i ' s@libopencv-dev@opencv3@' * /* /package.xml ; fi
90121
91122
@@ -96,6 +127,7 @@ function setup {
96127}
97128
98129function build {
130+ export ROS_DISTRO=$_ROS_DISTRO
99131 travis_time_start build.script
100132 source /opt/ros/$ROS_DISTRO /setup.bash
101133 cd ~ /catkin_ws
@@ -104,6 +136,7 @@ function build {
104136}
105137
106138function run_test {
139+ export ROS_DISTRO=$_ROS_DISTRO
107140 travis_time_start run_test.script
108141 source /opt/ros/$ROS_DISTRO /setup.bash
109142 cd ~ /catkin_ws
@@ -113,6 +146,7 @@ function run_test {
113146}
114147
115148function build_install {
149+ export ROS_DISTRO=$_ROS_DISTRO
116150 travis_time_start build_install.script
117151 source /opt/ros/$ROS_DISTRO /setup.bash
118152 cd ~ /catkin_ws
@@ -122,20 +156,25 @@ function build_install {
122156 travis_time_end
123157}
124158
159+ # setup.bash override ROS_DISTRO...
160+ export _ROS_DISTRO=$ROS_DISTRO
161+
125162travis_time_start apt.before_install
126163apt-get -y -qq update || if [ $? -eq 100 ]; then sed -i ' s/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; apt-get -y -qq update; fi
127- apt-get install -y -q wget sudo lsb-release gnupg # for docker
164+ apt-get install -y -q wget sudo lsb-release gnupg ca-certificates git # for docker
128165# set DEBIAN_FRONTEND=noninteractive
129166echo ' debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
130167travis_time_end
131168
132169if [ " $TEST " == " catkin_lint" ]; then
133170
134171 travis_time_start catkin_lint.script
135- apt-get install -y -q python-pip
136- pip install catkin_lint rosdep
172+ apt-get install -y -q python3-pip
173+ # See https://github.com/ros-perception/opencv_apps/pull/143
174+ # In catkin_lint > 1.6.18, cmake_minimum_required >= 2.8.12
175+ sudo pip3 install catkin_lint==1.6.18 rosdep
137176 rosdep init
138- rosdep update
177+ rosdep update --include-eol-distros
139178 travis_time_end
140179 ROS_DISTRO=melodic catkin_lint --resolve-env --strict $CI_SOURCE_PATH
141180
0 commit comments