-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup-ros.sh
executable file
·176 lines (161 loc) · 4.59 KB
/
setup-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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
set -euxo pipefail
readonly ROS_DISTRO=$1
apt-get update
apt-get install --no-install-recommends --quiet --yes sudo
# NOTE: this user is added for backward compatibility.
# Before the resolution of ros-tooling/setup-ros-docker#7 we used `USER rosbuild:rosbuild`
# and recommended that users of these containers run the following step in their workflow
# - run: sudo chown -R rosbuild:rosbuild "$HOME" .
# For repositories that still have this command in their workflow, they would fail if the user
# did not still exist. This user is no longer used but is just present so that command succeeds.
groupadd -r rosbuild
useradd --no-log-init --create-home -r -g rosbuild rosbuild
echo "rosbuild ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo 'Etc/UTC' > /etc/timezone
apt-get update
apt-get install --no-install-recommends --quiet --yes \
ca-certificates curl gnupg2 locales lsb-release
locale-gen en_US en_US.UTF-8
export LANG=en_US.UTF-8
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
apt-get install --no-install-recommends --quiet --yes tzdata
update-ca-certificates
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
ROS_VERSION="ros"
RTI_CONNEXT_DDS=""
case ${ROS_DISTRO} in
"noetic")
ROS_VERSION="ros"
;;
*)
RTI_CONNEXT_DDS="rti-connext-dds-6.0.1"
ROS_VERSION="ros2"
;;
esac
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/${ROS_VERSION}/ubuntu $(lsb_release -sc) main" |\
tee /etc/apt/sources.list.d/${ROS_VERSION}.list > /dev/null
apt-get update
# Required to install pip packages outside a venv with pip >=23.0.1 (older versions will ignore it)
export PIP_BREAK_SYSTEM_PACKAGES=1
UBUNTU_VERSION=$(lsb_release -cs)
case ${UBUNTU_VERSION} in
"noble" | "jammy")
# For 24.04 and 22.04, install using apt only
# Basics
apt-get install --no-install-recommends --quiet --yes \
clang \
lcov \
libc++-dev \
libc++abi-dev \
libssl-dev \
python3-dev
# Core, including some extra colcon packages and flake8 plugins
apt-get install --no-install-recommends --quiet --yes \
ros-dev-tools \
python3-pip \
python3-pytest-cov \
python3-flake8-blind-except \
python3-flake8-class-newline \
python3-flake8-deprecated \
python3-pytest-repeat \
python3-pytest-rerunfailures \
python3-flake8-docstrings \
python3-flake8-builtins \
python3-flake8-comprehensions \
python3-flake8-import-order \
python3-flake8-quotes \
python3-colcon-coveragepy-result \
python3-colcon-lcov-result \
python3-colcon-meson \
python3-colcon-mixin
# Fast DDS dependencies
apt-get install --no-install-recommends --quiet --yes \
libasio-dev \
libtinyxml2-dev
# RTI Connext
DEBIAN_FRONTEND=noninteractive RTI_NC_LICENSE_ACCEPTED=yes \
apt-get install --no-install-recommends --quiet --yes \
${RTI_CONNEXT_DDS}
;;
"focal")
# For 20.04, install with a mix of apt and pip
apt-get install --no-install-recommends --quiet --yes \
build-essential \
clang \
cmake \
git \
lcov \
libasio-dev \
libc++-dev \
libc++abi-dev \
libssl-dev \
libtinyxml2-dev \
python3-dev \
python3-pip \
python3-vcstool \
python3-wheel \
python3-rosdep \
wget
pip3 install --upgrade \
argcomplete \
catkin_pkg \
colcon-bash==0.4.2 \
colcon-cd==0.1.1 \
colcon-cmake==0.2.22 \
colcon-common-extensions==0.2.1 \
colcon-core==0.15.1 \
colcon-coveragepy-result==0.0.8 \
colcon-defaults==0.2.7 \
colcon-lcov-result==0.5.0 \
colcon-library-path==0.2.1 \
colcon-metadata==0.2.5 \
colcon-mixin==0.2.2 \
colcon-notification==0.2.15 \
colcon-output==0.2.12 \
colcon-package-information==0.3.3 \
colcon-package-selection==0.2.10 \
colcon-parallel-executor==0.2.4 \
colcon-pkg-config==0.1.0 \
colcon-powershell==0.3.7 \
colcon-python-setup-py==0.2.7 \
colcon-recursive-crawl==0.2.1 \
colcon-ros==0.3.23 \
colcon-test-result==0.3.8 \
coverage \
cryptography \
"empy<4" \
"flake8<3.8" \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
ifcfg \
importlib-metadata==2.* \
lark-parser \
mock \
mypy \
nose \
pep8 \
pydocstyle \
pytest \
pytest-cov \
pytest-mock \
pytest-repeat \
pytest-rerunfailures \
pytest-runner \
setuptools==58.2.0 \
pyparsing \
wheel
;;
*)
echo "${UBUNTU_VERSION} not supported"
exit 1
;;
esac
rosdep init
rm -rf "/var/lib/apt/lists/*"