@@ -154,10 +154,10 @@ function install_essential_packages() {
154
154
sudo pip3 install transforms3d
155
155
fi
156
156
if [ $PY_VERSION == 2 ]; then
157
- sudo apt-get install -yq install python-pip
157
+ sudo apt-get install -yq python-pip
158
158
python -m pip install modern_robotics
159
159
elif [ $PY_VERSION == 3 ]; then
160
- sudo apt-get install -yq install python3-pip
160
+ sudo apt-get install -yq python3-pip
161
161
python3 -m pip install modern_robotics
162
162
else
163
163
failed " Something went wrong. PY_VERSION='$PY_VERSION ', should be 2 or 3."
@@ -173,32 +173,40 @@ function install_ros1() {
173
173
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
174
174
sudo apt-get update
175
175
sudo apt-get install -yq ros-" $ROS_DISTRO_TO_INSTALL " -desktop-full
176
- if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
177
- sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
178
- fi
179
176
echo " source /opt/ros/$ROS_DISTRO_TO_INSTALL /setup.bash" >> ~ /.bashrc
180
- if [ $PY_VERSION == 2 ]; then
181
- sudo apt-get install -yq \
182
- python-rosdep \
183
- python-rosinstall \
184
- python-rosinstall-generator \
185
- python-wstool \
186
- build-essential
187
- elif [ $PY_VERSION == 3 ]; then
188
- sudo apt-get install -yq \
189
- python3-rosdep \
190
- python3-rosinstall \
191
- python3-rosinstall-generator \
192
- python3-wstool \
193
- build-essential
194
- fi
195
- sudo rosdep init
196
- rosdep update --include-eol-distros
197
177
else
198
178
echo " ros-$ROS_DISTRO_TO_INSTALL -desktop-full is already installed!"
199
179
fi
200
180
source /opt/ros/" $ROS_DISTRO_TO_INSTALL " /setup.bash
201
181
182
+ # Install rosdep and other necessary tools
183
+ if [ $PY_VERSION == 2 ]; then
184
+ sudo apt-get install -yq \
185
+ python-rosdep \
186
+ python-rosinstall \
187
+ python-rosinstall-generator \
188
+ python-wstool \
189
+ build-essential
190
+ elif [ $PY_VERSION == 3 ]; then
191
+ sudo apt-get install -yq \
192
+ python3-rosdep \
193
+ python3-rosinstall \
194
+ python3-rosinstall-generator \
195
+ python3-wstool \
196
+ build-essential
197
+ fi
198
+
199
+ # Remove sources if they exist
200
+ if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
201
+ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
202
+ fi
203
+
204
+ # Initialize rosdep sources
205
+ sudo rosdep init
206
+
207
+ # Update local rosdep database, including EoL distros
208
+ rosdep update --include-eol-distros
209
+
202
210
# Install Arm packages
203
211
if source /opt/ros/" $ROS_DISTRO_TO_INSTALL " /setup.bash 2> /dev/null && \
204
212
source " $INSTALL_PATH " /devel/setup.bash 2> /dev/null && \
@@ -242,24 +250,32 @@ function install_ros2() {
242
250
echo " deb [arch=$( dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $( source /etc/os-release && echo " $UBUNTU_CODENAME " ) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
243
251
sudo apt-get update
244
252
sudo apt-get install -yq ros-" $ROS_DISTRO_TO_INSTALL " -desktop
245
- if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
246
- sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
247
- fi
248
253
echo " source /opt/ros/$ROS_DISTRO_TO_INSTALL /setup.bash" >> ~ /.bashrc
249
- sudo apt-get install -yq \
250
- python3-rosdep \
251
- python3-rosinstall \
252
- python3-rosinstall-generator \
253
- python3-wstool \
254
- build-essential \
255
- python3-colcon-common-extensions
256
- sudo rosdep init
257
- rosdep update --include-eol-distros
258
254
else
259
255
echo " ros-$ROS_DISTRO_TO_INSTALL -desktop is already installed!"
260
256
fi
261
257
source /opt/ros/" $ROS_DISTRO_TO_INSTALL " /setup.bash
262
258
259
+ # Install rosdep and other necessary tools
260
+ sudo apt-get install -yq \
261
+ python3-rosdep \
262
+ python3-rosinstall \
263
+ python3-rosinstall-generator \
264
+ python3-wstool \
265
+ build-essential \
266
+ python3-colcon-common-extensions
267
+
268
+ # Remove sources if they exist
269
+ if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
270
+ sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
271
+ fi
272
+
273
+ # Initialize rosdep sources
274
+ sudo rosdep init
275
+
276
+ # Update local rosdep database, including EoL distros
277
+ rosdep update --include-eol-distros
278
+
263
279
# Install Arm packages
264
280
if source /opt/ros/" $ROS_DISTRO_TO_INSTALL " /setup.bash 2> /dev/null && \
265
281
source " $INSTALL_PATH " /install/setup.bash 2> /dev/null && \
0 commit comments