Skip to content

Commit

Permalink
Relocate RPi4 rosdep update (#202)
Browse files Browse the repository at this point in the history
* Relocate RPi4 rosdep

* Fix bad installation directive
  • Loading branch information
lukeschmitt-tr committed Jul 10, 2024
1 parent 3755600 commit d07c17c
Showing 1 changed file with 50 additions and 34 deletions.
84 changes: 50 additions & 34 deletions interbotix_ros_xsarms/install/rpi4/xsarm_rpi4_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ function install_essential_packages() {
sudo pip3 install transforms3d
fi
if [ $PY_VERSION == 2 ]; then
sudo apt-get install -yq install python-pip
sudo apt-get install -yq python-pip
python -m pip install modern_robotics
elif [ $PY_VERSION == 3 ]; then
sudo apt-get install -yq install python3-pip
sudo apt-get install -yq python3-pip
python3 -m pip install modern_robotics
else
failed "Something went wrong. PY_VERSION='$PY_VERSION', should be 2 or 3."
Expand All @@ -173,32 +173,40 @@ function install_ros1() {
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -yq ros-"$ROS_DISTRO_TO_INSTALL"-desktop-full
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
if [ $PY_VERSION == 2 ]; then
sudo apt-get install -yq \
python-rosdep \
python-rosinstall \
python-rosinstall-generator \
python-wstool \
build-essential
elif [ $PY_VERSION == 3 ]; then
sudo apt-get install -yq \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential
fi
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
if [ $PY_VERSION == 2 ]; then
sudo apt-get install -yq \
python-rosdep \
python-rosinstall \
python-rosinstall-generator \
python-wstool \
build-essential
elif [ $PY_VERSION == 3 ]; then
sudo apt-get install -yq \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential
fi

# 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

# Install Arm packages
if source /opt/ros/"$ROS_DISTRO_TO_INSTALL"/setup.bash 2>/dev/null && \
source "$INSTALL_PATH"/devel/setup.bash 2>/dev/null && \
Expand Down Expand Up @@ -242,24 +250,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 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

# Install Arm packages
if source /opt/ros/"$ROS_DISTRO_TO_INSTALL"/setup.bash 2>/dev/null && \
source "$INSTALL_PATH"/install/setup.bash 2>/dev/null && \
Expand Down

0 comments on commit d07c17c

Please sign in to comment.