Skip to content

Commit f03df9f

Browse files
authored
Merge pull request #53 from anadon/main
Added bash script to build and install everything.
2 parents 05fc11f + d67b080 commit f03df9f

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

build-everything.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#! /usr/bin/env bash
2+
3+
if (( EUID == 0 )); then
4+
SUDO=""
5+
else
6+
SUDO="sudo"
7+
fi
8+
9+
10+
$SUDO add-apt-repository universe
11+
$SUDO apt update
12+
13+
export DEBIAN_FRONTEND=noninteractive
14+
15+
DEPS_0="curl git sudo apt-utils dialog locales"
16+
DEPS_1="libboost-all-dev cmake libtbb-dev intel-mkl-full python3-rosdep python3-colcon-common-extensions sudo git software-properties-common python3-dev python3-full python3-pip"
17+
DEPS_2="ros-dev-tools ros-jazzy-desktop ros-jazzy-rtabmap ros-jazzy-rtabmap-msgs ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb* ros-jazzy-perception-pcl ros-jazzy-rtabmap-conversions ros-rolling-cv-bridge "
18+
19+
$SUDO apt install -y $DEPS_0
20+
21+
22+
$SUDO locale-gen en_US en_US.UTF-8
23+
$SUDO update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
24+
export LANG=en_US.UTF-8
25+
export LC_ALL=en_US.UTF-8
26+
27+
git clone https://github.com/anadon/cslam.git
28+
git clone https://github.com/lajoiepy/cslam_interfaces.git
29+
git clone https://github.com/lajoiepy/cslam_experiments.git
30+
git clone https://github.com/borglab/gtsam.git
31+
32+
$SUDO apt install -y $DEPS_1
33+
34+
$SUDO curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
35+
36+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "$UBUNTU_CODENAME") main" | sudo tee "/etc/apt/sources.list.d/ros2.list" > /dev/null
37+
38+
39+
$SUDO apt update
40+
$SUDO apt install -y $DEPS_2
41+
42+
pip install -r requirements.txt
43+
44+
45+
pushd gtsam || exit 1
46+
47+
echo "WARNING!!! This deviates from the Swarm-Slam instructions by using gtsam v4.2 and not 4.1.1."
48+
mkdir build
49+
cd build || exit 1
50+
cmake ..
51+
# make check (optional, runs unit tests)
52+
$SUDO make install
53+
54+
popd || exit 1
55+
56+
##################
57+
# ROS 2 OS SETUP #
58+
##################
59+
60+
echo "WARNING!!! This deviates from Swarm-Slam instructions by using ROS 2 Jazzy instead of Foxy"
61+
echo "WARNING!!! This is setting up a one-time configuration change because it is destructive to your environment. This installer is REQUIRING that you take manual action to make this change permenent."
62+
63+
# Replace ".bash" with your shell if you're not using bash
64+
# Possible values are: setup.bash, setup.sh, setup.zsh
65+
66+
echo 'source "/opt/ros/jazzy/setup.bash"' >> ~/.bashrc
67+
source "/opt/ros/jazzy/setup.bash"
68+
69+
$SUDO rosdep init
70+
71+
rosdep update
72+
rosdep install --from-paths src -y --ignore-src --rosdistro jazzy
73+
74+
pushd cslam_interfaces || exit 1
75+
colcon build
76+
echo 'source "/Swarm-SLAM/cslam_interfaces/install/setup.bash"' >> "$HOME/.bashrc"
77+
source "/Swarm-SLAM/cslam_interfaces/install/setup.bash"
78+
popd || exit 1
79+
80+
colcon build
81+
colcon test
82+
83+
echo 'source "/Swarm-SLAM/install/setup.bash"' >> "$HOME/.bashrc"
84+
source "/Swarm-SLAM/install/setup.bash"
85+

0 commit comments

Comments
 (0)