-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup_atos.sh
executable file
·72 lines (60 loc) · 2.05 KB
/
setup_atos.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
#!/bin/bash
#####################################
###### Pre-installation checks ######
#####################################
source "scripts/installation/install_functions.sh"
# Get this file location
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
# Check if running on Ubuntu
if ! grep -q "Ubuntu" /etc/os-release; then
echo "This script is designed for Ubuntu systems only."
exit 1
fi
# Set ROS_DISTRO based on Ubuntu distribution
case "$(get_ubuntu_codename)" in
"focal")
;;
"jammy")
;;
*)
echo "Unsupported Ubuntu distribution. Only 20.04 (focal) and 22.04 (jammy) are supported."
exit 1
;;
esac
# Add -h/--help option
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "Usage: ./setup_atos.sh [single option]"
echo "This script will install all necessary dependencies, setup the ROS workspace at ~/atos_ws and install ATOS. Please open and inspect this script for further details."
echo "Options:"
echo " -h, --help Show this help message and exit"
echo " -r Reinstall dependencies"
exit 0
fi
# Only install dependencies
if [ "$1" == "-r" ]; then
REINSTALL_DEPS="-r"
fi
#######################################
###### Install ATOS dependencies ######
#######################################
echo "Installing ATOS dependencies..."
${REPO_DIR}/scripts/installation/install_deps.sh ${REPO_DIR} ${REINSTALL_DEPS}
if [ $? -ne 0 ]; then
echo "Failed to install dependencies."
exit 1
fi
########################################
###### Start installation of ATOS ######
########################################
if ! [ -z "$REINSTALL_DEPS" ]; then
echo "ATOS installation skipped."
exit 0
fi
echo "Installing ATOS..."
${REPO_DIR}/scripts/installation/install_atos.sh ${REPO_DIR}
if [ $? -ne 0 ]; then
echo "Failed to install ATOS."
exit 1
fi
echo "ATOS build and setup is complete. Please restart your terminal to complete the installation."
echo "Please see the documentation for further details: https://atos.readthedocs.io/en/latest/"