Sets up Travis CI. (#34)

master
Wolfgang Hess 2016-08-30 08:33:45 +02:00 committed by Damon Kohler
parent ff65a1e7f1
commit cfd09abccf
7 changed files with 133 additions and 15 deletions

18
.travis.yml Normal file
View File

@ -0,0 +1,18 @@
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
sudo: required
services: docker
install: true
script: docker build ${TRAVIS_BUILD_DIR} -t cartographer_ros

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ros:indigo
COPY . cartographer_ros
RUN cartographer_ros/scripts/install.sh
COPY scripts/ros_entrypoint.sh /

View File

@ -12,16 +12,11 @@
See the License for the specific language governing permissions and
limitations under the License.
.. Cartographer documentation master file, created by
sphinx-quickstart on Fri Jul 8 10:41:33 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
============================
Cartographer ROS Integration
============================
|docs|
|build| |docs|
Purpose
=======
@ -49,6 +44,11 @@ at our `Contribution page`_.
.. _Contribution page: https://github.com/googlecartographer/cartographer_ros/blob/master/CONTRIBUTING.md
.. |build| image:: https://travis-ci.org/googlecartographer/cartographer_ros.svg?branch=master
:alt: Build Status
:scale: 100%
:target: https://travis-ci.org/googlecartographer/cartographer_ros
.. |docs| image:: https://readthedocs.org/projects/google-cartographer-ros/badge/?version=latest
:alt: Documentation Status
:scale: 100%

View File

@ -54,12 +54,6 @@ link_directories(${CARTOGRAPHER_LIBRARY_DIRS})
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
# TODO(pedrofernandez): CMake test rules are written differently in the core
# library. Change the way it's done here and reenable testing.
# enable_testing()
# find_package(GTest REQUIRED)
# include_directories(${GTEST_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
if(rviz_QT_VERSION VERSION_LESS "5")
message(STATUS "Using Qt4 based on the rviz_QT_VERSION: ${rviz_QT_VERSION}")
@ -119,7 +113,7 @@ add_dependencies(cartographer_rviz_submaps_visualization
${catkin_EXPORTED_TARGETS}
)
add_executable(time_conversion_test
catkin_add_gtest(time_conversion_test
src/time_conversion_test.cc
src/time_conversion.h
src/time_conversion.cc
@ -135,8 +129,6 @@ add_dependencies(time_conversion_test
${catkin_EXPORTED_TARGETS}
)
add_test(time_conversion_test time_conversion_test)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch/
)

View File

@ -24,14 +24,19 @@
<buildtool_depend>catkin</buildtool_depend>
<build_depend>g++-static</build_depend>
<build_depend>wget</build_depend> <!-- for glog -->
<build_depend>cartographer</build_depend>
<build_depend>eigen_conversions</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>cartographer_ros_msgs</build_depend>
<build_depend>libgflags-dev</build_depend>
<build_depend>libpcl-all-dev</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>pcl_conversions</build_depend>
<build_depend>protobuf-dev</build_depend>
<build_depend>python-sphinx</build_depend>
<build_depend>qtbase5-dev</build_depend>
<build_depend>rosbag</build_depend>
<build_depend>roscpp</build_depend>
@ -39,6 +44,7 @@
<build_depend>rviz</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>suitesparse</build_depend>
<build_depend>tf2</build_depend>
<build_depend>tf2_eigen</build_depend>
<build_depend>visualization_msgs</build_depend>
@ -46,6 +52,7 @@
<run_depend>eigen_conversions</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>cartographer_ros_msgs</run_depend>
<run_depend>libgflags-dev</run_depend>
<run_depend>libpcl-all</run_depend>
<run_depend>libqt5-core</run_depend>
<run_depend>libqt5-gui</run_depend>
@ -59,10 +66,13 @@
<run_depend>rviz</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>suitesparse</run_depend>
<run_depend>tf2_eigen</run_depend>
<run_depend>tf2</run_depend>
<run_depend>visualization_msgs</run_depend>
<test_depend>rosunit</test_depend>
<export>
<rviz plugin="${prefix}/rviz_plugin_description.xml"/>
</export>

58
scripts/install.sh Executable file
View File

@ -0,0 +1,58 @@
#!/bin/sh
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o verbose
. /opt/ros/${ROS_DISTRO}/setup.sh
# Create a new workspace in 'catkin_ws'.
mkdir catkin_ws
cd catkin_ws
wstool init
# Merge the cartographer_ros rosinstall file and fetch code for dependencies.
wstool merge ../cartographer_ros/cartographer_ros.rosinstall
wstool update
# Use the local version of cartographer_ros to include local modifications.
rm -rf src/cartographer_ros
mv ../cartographer_ros src
# Install deb dependencies.
sudo apt-get update
sudo apt-get install -y libwebp-dev # TODO(whess): Move to rosdep.
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
rm -rf /var/lib/apt/lists/*
# Build and run tests.
catkin_make_isolated
catkin_make_isolated --catkin-make-args tests
catkin_make_isolated --catkin-make-args test
# TODO(whess): Fix installing cartographer_ros. For now we use a workaround:
echo Working around install issues...
mkdir /opt/cartographer_ros
ln -Tsf ${PWD}/devel_isolated/setup.bash /opt/cartographer_ros/setup.bash
exit
# Install under /opt/cartographer_ros.
catkin_make_isolated --install-space /opt/cartographer_ros --install
# Clean up.
cd ..
rm -rf catkin_ws

22
scripts/ros_entrypoint.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o verbose
source "/opt/ros/${ROS_DISTRO}/setup.bash"
source "/opt/cartographer_ros/setup.bash"
exec "$@"