@@ -26,7 +26,18 @@ function setup {
26
26
travis_time_start setup.before_install
27
27
# before_install:
28
28
# 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
30
41
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
31
42
# Setup EoL repository
32
43
if [[ " $ROS_DISTRO " == " hydro" || " $ROS_DISTRO " == " jade" || " $ROS_DISTRO " == " lunar" ]]; then
@@ -41,15 +52,42 @@ function setup {
41
52
fi
42
53
# ##
43
54
# 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
45
68
sudo apt-get install -y -q python3-catkin-pkg python3-catkin-tools python3-rosdep python3-wstool python3-rosinstall-generator python3-osrf-pycommon
46
69
else
47
70
sudo apt-get install -y -q python-catkin-pkg python-catkin-tools python-rosdep python-wstool python-rosinstall-generator
48
71
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
50
79
source /opt/ros/$ROS_DISTRO /setup.bash
51
80
# Setup for rosdep
52
- sudo rosdep init
81
+ [ -e /etc/ros/rosdep/sources.list.d ] || sudo rosdep init
82
+ # use snapshot of rosdep list
83
+ # https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517
84
+ if [[ " $ROS_DISTRO " =~ " hydro" | " indigo" | " jade" | " kinetic" | " lunar" ]]; then
85
+ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
86
+ sudo wget https://raw.githubusercontent.com/jsk-ros-pkg/jsk_travis/refs/heads/master/rosdep_snapshots/30-xenial.list -O /etc/ros/rosdep/sources.list.d/30-xenial.list
87
+ elif [[ " $ROS_DISTRO " =~ " melodic" ]]; then
88
+ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
89
+ sudo wget https://raw.githubusercontent.com/jsk-ros-pkg/jsk_travis/refs/heads/master/rosdep_snapshots/30-bionic.list -O /etc/ros/rosdep/sources.list.d/30-bionic.list
90
+ fi
53
91
rosdep update --include-eol-distros
54
92
travis_time_end
55
93
@@ -69,14 +107,17 @@ function setup {
69
107
# before_script:
70
108
# source dependencies: install using wstool.
71
109
cd ~ /catkin_ws/src
72
- wstool init
110
+ wstool init || echo " OK "
73
111
# if [[ -f $ROSINSTALL_FILE ]] ; then wstool merge $ROSINSTALL_FILE ; fi
74
112
if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator image_pipeline --upstream >> .rosinstall.opencv3; fi # need to recompile image_proc
75
113
if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator compressed_image_transport --upstream >> .rosinstall.opencv3; fi # need to recompile compressed_image_transport
76
114
if [ " $OPENCV_VERSION " == 3 ]; then rosinstall_generator vision_opencv --upstream >> .rosinstall.opencv3; fi # need to recompile visoin_opencv
77
- if [ " $OPENCV_VERSION " == 3 ]; then wstool merge .rosinstall.opencv3; fi # need to recompile visoin_opencv
78
- wstool up
79
- wstool info
115
+ if [ " $ROS_DISTRO " == " indigo" ]; then ROS_DISTRO=kinetic rosinstall_generator roslaunch >> .rosinstall.opencv3; fi # face_detection.launch requires roslaunch-check >= 1.12.1
116
+ if [[ " $OPENCV_VERSION " == 3 || " $ROS_DISTRO " == " indigo" ]]; then wstool merge .rosinstall.opencv3 || [ ! -s .rosinstall.opencv3 ] || vcs import . < .rosinstall.opencv3 ; fi # need to recompile visoin_opencv
117
+ git config --global --add safe.directory $CI_SOURCE_PATH
118
+ git config --global --add safe.directory ~ /catkin_ws/src || echo " OK"
119
+ wstool up || vcs pull
120
+ wstool info || vcs branch
80
121
if [ " $OPENCV_VERSION " == 3 ]; then sed -i ' s@libopencv-dev@opencv3@' * /* /package.xml ; fi
81
122
82
123
@@ -87,6 +128,7 @@ function setup {
87
128
}
88
129
89
130
function build {
131
+ export ROS_DISTRO=$_ROS_DISTRO
90
132
travis_time_start build.script
91
133
source /opt/ros/$ROS_DISTRO /setup.bash
92
134
cd ~ /catkin_ws
@@ -95,15 +137,17 @@ function build {
95
137
}
96
138
97
139
function run_test {
140
+ export ROS_DISTRO=$_ROS_DISTRO
98
141
travis_time_start run_test.script
99
142
source /opt/ros/$ROS_DISTRO /setup.bash
100
143
cd ~ /catkin_ws
101
- catkin run_tests -p1 -j1 --no-status opencv_apps --no-deps
144
+ catkin run_tests -p1 -j1 --no-status -i opencv_apps --no-deps
102
145
catkin_test_results --verbose build || catkin_test_results --all build
103
146
travis_time_end
104
147
}
105
148
106
149
function build_install {
150
+ export ROS_DISTRO=$_ROS_DISTRO
107
151
travis_time_start build_install.script
108
152
source /opt/ros/$ROS_DISTRO /setup.bash
109
153
cd ~ /catkin_ws
@@ -113,28 +157,34 @@ function build_install {
113
157
travis_time_end
114
158
}
115
159
160
+ # setup.bash override ROS_DISTRO...
161
+ export _ROS_DISTRO=$ROS_DISTRO
162
+
116
163
travis_time_start apt.before_install
117
- apt-get update -qq && apt-get install -y -q wget sudo lsb-release gnupg # for docker
164
+ apt-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
165
+ apt-get install -y -q wget sudo lsb-release gnupg ca-certificates git # for docker
118
166
# set DEBIAN_FRONTEND=noninteractive
119
167
echo ' debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
120
168
travis_time_end
121
169
122
170
if [ " $TEST " == " catkin_lint" ]; then
123
171
124
172
travis_time_start catkin_lint.script
125
- apt-get install -y -q python-pip
126
- pip install catkin_lint rosdep
173
+ apt-get install -y -q python3-pip
174
+ # See https://github.com/ros-perception/opencv_apps/pull/143
175
+ # In catkin_lint > 1.6.18, cmake_minimum_required >= 2.8.12
176
+ sudo pip3 install catkin_lint==1.6.18 rosdep
127
177
rosdep init
128
- rosdep update
178
+ rosdep update --include-eol-distros
129
179
travis_time_end
130
180
ROS_DISTRO=melodic catkin_lint --resolve-env --strict $CI_SOURCE_PATH
131
181
132
182
133
183
elif [ " $TEST " == " clang-format" ]; then
134
184
135
185
travis_time_start clang_format.script
136
- apt-get install -y -q clang-format-3.9 git
137
- find $CI_SOURCE_PATH -name ' *.h' -or -name ' *.hpp' -or -name ' *.cpp' | xargs clang-format-3.9 -i -style=file
186
+ apt-get install -y -q clang-format git
187
+ find $CI_SOURCE_PATH -name ' *.h' -or -name ' *.hpp' -or -name ' *.cpp' | xargs clang-format -i -style=file
138
188
travis_time_end
139
189
git -C $CI_SOURCE_PATH --no-pager diff
140
190
git -C $CI_SOURCE_PATH diff-index --quiet HEAD -- .
@@ -156,9 +206,32 @@ elif [ "$TEST" == "clang-tidy" ]; then
156
206
run-clang-tidy -fix -p $( dirname $file )
157
207
done
158
208
travis_time_end
209
+ sudo chown -R $( whoami) $CI_SOURCE_PATH
159
210
git -C $CI_SOURCE_PATH --no-pager diff
160
211
git -C $CI_SOURCE_PATH diff-index --quiet HEAD -- .
161
212
213
+ elif [ " $TEST " == " debian-unstable" ]; then
214
+
215
+ sed -i ' s/Types: deb/Types: deb deb-src/' /etc/apt/sources.list.d/debian.sources
216
+ apt update
217
+ apt-get -y build-dep ros-opencv-apps
218
+
219
+ # rebuild cv-bridge to fix '/usr/bin/ld: cannot find -lopencv_barcode: No such file or directory'
220
+ travis_time_start rebuild_cv_bridge_deb.script
221
+ apt source ros-vision-opencv
222
+ apt-get -y build-dep $( find -type d -iname " ros-vision-opencv*" )
223
+ (cd $( find -type d -iname " ros-vision-opencv*" ) && dpkg-buildpackage -b -us -uc)
224
+ dpkg -i * .deb
225
+ travis_time_end
226
+
227
+ travis_time_start build_debian_unstable.script
228
+ cd $CI_SOURCE_PATH
229
+ mkdir build
230
+ cd build
231
+ cmake ..
232
+ make VERBOSE=1
233
+ travis_time_end
234
+
162
235
else
163
236
# Compile and test.
164
237
setup
0 commit comments