forked from IntelRealSense/realsense-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
69 lines (60 loc) · 2.81 KB
/
.travis.yml
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
sudo: required
matrix:
include:
- dist: bionic
- dist: focal
env:
# - git clone -v --progress https://github.com/doronhi/realsense.git # This is Done automatically by TravisCI
before_install:
- if [[ $(lsb_release -sc) == "bionic" ]]; then _python=python; _ros_dist=dashing;
elif [[ $(lsb_release -sc) == "focal" ]]; then _python=python3; _ros_dist=foxy; fi
- echo _python:$_python
- echo _ros_dist:$_ros_dist
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --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-dkms --allow-unauthenticated -y
- sudo apt-get install librealsense2-dev --allow-unauthenticated -y
install:
# install ROS:
- sudo apt update && sudo apt install curl gnupg2 lsb-release -y
- curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
- sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt update -qq
- sudo apt install ros-$_ros_dist-ros-base -y
- sudo apt install python3-colcon-common-extensions -y
- sudo apt-get install python3-rosdep -y
#Environment setup
- echo "source /opt/ros/$_ros_dist/setup.bash" >> ~/.bashrc
- source ~/.bashrc
# install realsense2-camera
- mkdir -p ~/ros2_ws/src/realsense-ros
- mv * ~/ros2_ws/src/realsense-ros/ # This leaves behind .git, .gitignore and .travis.yml but no matter.
- cd ~/ros2_ws
- sudo rosdep init
- rosdep update
- rosdep install -i --from-path src --rosdistro $_ros_dist -y
- sudo apt purge ros-$_ros_dist-librealsense2 -y
- colcon build
- . install/local_setup.bash
script:
# download data:
- bag_filename="https://librealsense.intel.com/rs-tests/TestData/outdoors_1color.bag";
- wget $bag_filename -P "records/"
- bag_filename="https://librealsense.intel.com/rs-tests/D435i_Depth_and_IMU_Stands_still.bag";
- wget $bag_filename -P "records/"
# install packages for tests:
- sudo apt-get install python3-pip -y
- pip3 install numpy --upgrade
- pip3 install numpy-quaternion tqdm
# Run test:
- python3 src/realsense-ros/realsense2_camera/scripts/rs2_test.py --all
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache