-
Notifications
You must be signed in to change notification settings - Fork 57
/
cartographer_ros.sh
executable file
·91 lines (70 loc) · 2.13 KB
/
cartographer_ros.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
86
87
88
89
90
91
# source: https://gist.github.com/phatblat/1713458
# Save script's current directory
DIR=$(pwd)
set -e
set -u
set -x
echo "###############################################"
echo "# Google Cartographer - ROS"
echo "###############################################"
echo "#"
echo "# https://github.com/googlecartographer/cartographer_ros"
echo "# also see: https://github.com/googlecartographer/cartographer"
echo "#"
echo "# Extra steps: this runs ceres.sh first!"
# Install the required libraries that are available as debs.
sudo apt-get update
sudo apt-get install -y \
cmake \
g++ \
git \
libboost-all-dev \
libcairo2-dev \
libeigen3-dev \
libgflags-dev \
libgoogle-glog-dev \
liblua5.2-dev \
libprotobuf-dev \
libsuitesparse-dev \
ninja-build \
protobuf-compiler \
python-sphinx
# install googletest from source
./googletest.sh
# Install ROS
./ros.sh
# Install wstool and rosdep.
sudo apt-get update
sudo apt-get install -y python-wstool python-rosdep ninja-build
# make sure TMPDIR variable is set
if [ -z ${var+x} ]; then export TMPDIR="/tmp"; fi
source /opt/ros/kinetic/setup.bash
cd ~/src
# Create a new workspace in 'catkin_ws'.
mkdir -p cartographer_ws
cd cartographer_ws
if [ ! -f ~/src/cartographer_ws/src/.rosinstall ]
then
wstool init src
fi
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src
# Install deb dependencies.
# The command 'sudo rosdep init' will print an error if you have already
# executed it since installing ROS. This error can be ignored.
if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]
then
sudo rosdep init
fi
# make sure ROS_DISTRO variable is set
if [ -z ${var+x} ]; then export ROS_DISTRO="kinetic"; fi
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y
cd ~/src/cartographer_ws
# Build and install.
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
# Build and install.
# catkin build --install --use-ninja
cd $DIR