Skip to content

Commit

Permalink
Relocate ROS 2 rosdep update (#191)
Browse files Browse the repository at this point in the history
* Install, init, update rosdep outside of ros2 check

* Add some comments

* Fix script syntax error

* Always remove rosdep source list
  • Loading branch information
lukeschmitt-tr committed Apr 24, 2024
1 parent 6bf8998 commit 5411b4d
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions interbotix_ros_xsarms/install/amd64/xsarm_amd64_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,24 +259,32 @@ function install_ros2() {
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
sudo apt-get update
sudo apt-get install -yq ros-"$ROS_DISTRO_TO_INSTALL"-desktop
if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
fi
echo "source /opt/ros/$ROS_DISTRO_TO_INSTALL/setup.bash" >> ~/.bashrc
sudo apt-get install -yq \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential \
python3-colcon-common-extensions
sudo rosdep init
rosdep update --include-eol-distros
else
echo "ros-$ROS_DISTRO_TO_INSTALL-desktop-full is already installed!"
fi
source /opt/ros/"$ROS_DISTRO_TO_INSTALL"/setup.bash

# Install rosdep and other necessary tools
sudo apt-get install -yq \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential \
python3-colcon-common-extensions

# Remove sources if they exist
if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
fi

# Initialize rosdep sources
sudo rosdep init

# Update local rosdep database, including EoL distros
rosdep update --include-eol-distros

if [ "$INSTALL_PERCEPTION" = true ]; then
# Install apriltag ROS Wrapper, no official Apriltag ROS 2 package yet
if source /opt/ros/"$ROS_DISTRO_TO_INSTALL"/setup.bash 2>/dev/null && \
Expand Down

0 comments on commit 5411b4d

Please sign in to comment.