-
Notifications
You must be signed in to change notification settings - Fork 39
/
.travis.sh
85 lines (79 loc) · 3.29 KB
/
.travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
$!/bin/bash
set -x
echo "Environment Variables"
echo "CI_SOURCE_PATH=$CI_SOURCE_PATH"
echo "REPOSITORY_NAME=$REPOSITORY_NAME"
echo "DEB_REPOSITORY=$DEB_REPOSITORY"
echo "CI_ROS_DISTRO=$CI_ROS_DISTRO"
echo "DISTRO=$DISTRO"
env | grep ROS
apt-get update -qq
apt-get install -qq -y sudo wget git lsb-release gnupg
function error {
## after_failure:
catkin_test_results --verbose build
exit 1
}
trap error ERR
## before_install:
# use host xserver
sudo apt-get -y -qq install xvfb mesa-utils
export DISPLAY=:99
Xvfb $DISPLAY -ac -screen 0 1024x768x24 &
sleep 3 # wait x server up
glxinfo
####### https://github.com/ros-planning/moveit/pull/581
if [ "$CI_ROS_DISTRO" == "kinetic" ]; then
apt-get install -y python-pyassimp
sed -i 's@load, load_mem, release, dll@load, release, dll@' /usr/lib/python2.7/dist-packages/pyassimp/core.py
cat -n /usr/lib/python2.7/dist-packages/pyassimp/core.py
## fix "A new DepthBuffer for a RenderTarget was created, but after creation" problem
## http://answers.gazebosim.org/question/9395/gazebo-crashes-when-inserting-camera-in-virtual-machine-with-ubuntu-vivid-ros-jade/
## https://bitbucket.org/osrf/gazebo/issues/1837/vmware-rendering-z-ordering-appears-random#comment-31756295
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get install -qq -y gazebo7
fi
#######
## install:
# set DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
sudo sh -c "echo \"deb ${DEB_REPOSITORY} `lsb_release -cs` main\" > /etc/apt/sources.list.d/ros-latest.list"
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq
if [[ "$CI_ROS_DISTRO" == "noetic" ]]; then
sudo apt-get install -qq -y python3-rosdep python3-catkin-tools
else
sudo apt-get install -qq -y python-rosdep python-catkin-tools
fi
if [[ "$CI_ROS_DISTRO" == "melodic" || "$CI_ROS_DISTRO" == "noetic" ]]; then
git clone https://github.com/turtlebot-release/turtlebot-release -b release/kinetic/turtlebot_description
git clone https://github.com/turtlebot-release/turtlebot_create-release -b release/kinetic/create_description
git clone https://github.com/yujinrobot-release/kobuki-release -b release/kinetic/kobuki_description
fi
sudo rosdep init
rosdep update --include-eol-distros
# Use rosdep to install all dependencies (including ROS itself)
rosdep install --from-paths ./ -i -y -q --rosdistro $CI_ROS_DISTRO
## script:
source /opt/ros/$CI_ROS_DISTRO/setup.bash
mkdir -p $CATKIN_WS_SRC
ln -s $TRAVIS_BUILD_DIR $CATKIN_WS_SRC
cd $CATKIN_WS
catkin init
# Enable install space
catkin config --install
# Build [and Install] packages
catkin build --limit-status-rate 0.1 --no-notify -DCMAKE_BUILD_TYPE=Release
# Build tests
catkin build --limit-status-rate 0.1 --no-notify --make-args tests
# Run tests
####### kinteic has problem on runnning gazebo with image on headless mode????
if [ "$CI_ROS_DISTRO" == "kinetic" ]; then
touch src/rtmros_nextage/nextage_calibration/CATKIN_IGNORE
fi
#######
catkin run_tests -j1 -p1
# check test (this only works from indigo onward)
catkin_test_results build