Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noetic install #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
68 changes: 34 additions & 34 deletions scripts/fresh_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function check-pkg-installed
echo "Please specify package name" 1>&2
exit -1
else
if `apt list --installed 2>/dev/null | grep -iqwe ^$1/`; then
if `apt list 2>/dev/null | grep -iqwe ^$1/`; then
if ! `apt list --installed 2>/dev/null | grep -iqwe ^$1`; then
if [[ -z `apt-cache search --names-only ^$1` ]]; then
echo "Package $1 does not exist" 1>&2
exit -1
fi
Expand All @@ -27,55 +27,55 @@ function check-pkg-installed

function install-pkg
{
if [ $# -eq 0 ]; then
echo "Please specify package name" 1>&2
exit -1
if check-pkg-installed $1 -eq 0; then
sudo apt-get install -y $1
else
if `apt list --installed 2>/dev/null | grep -iqwe ^$1/`; then
if `apt list 2>/dev/null | grep -iqwe ^$1/`; then
echo "Package $1 does not exist" 1>&2
exit -1
else
sudo apt-get install $1
fi
else
echo "$1 already installed."
fi
echo "$1 already installed."
fi
}

function install-pkgs
{
for pkg in $*; do
install-pkg $pkg
done
for pkg in $*; do
install-pkg $pkg
done
}

#MAIN------------------------

ubuntu_release=$(get-ubuntu-release)
if [[ $ubuntu_release == *"18.04"* ]]; then
ROS_DISTRO="melodic"
PYTHON=python
if [[ $ubuntu_release == *"20.04"* ]]; then
ROS_DISTRO="noetic"
PYTHON=python3
elif [[ $ubuntu_release == *"18.04"* ]]; then
ROS_DISTRO="melodic"
elif [[ $ubuntu_release == *"16.04"* ]]; then
ROS_DISTRO="kinetic"
ROS_DISTRO="kinetic"
else
echo "Ubuntu release not supported: $ubuntu_release"
exit -1
echo "Ubuntu release not supported: $ubuntu_release"
exit -1
fi

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update

#ROS install
if check-pkg-installed ros-$ROS_DISTRO-desktop -eq 0; then
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt update
sudo apt install ros-$ROS_DISTRO-desktop
sudo rosdep init
rosdep update
sudo apt install python-wstool python-catkin-tools
echo "ROS $ROS_DISTRO installed."
sudo apt install -y ros-$ROS_DISTRO-desktop
install-pkg $PYTHON-rosdep
sudo rosdep init
rosdep update
echo "ROS $ROS_DISTRO installed."
else
echo "ROS $ROS_DISTRO already installed."
echo "ROS $ROS_DISTRO already installed."
fi

#ROS compilation utils
install-pkgs python-catkin-tools python-wstool
#ROS compilation utils and pip
install-pkgs $PYTHON-wstool $PYTHON-pip
if [[ $ROS_DISTRO == "noetic" ]]; then
$PYTHON -m pip install --user git+https://github.com/catkin/catkin_tools.git
else
install-pkg $PYTHON-catkin-tools
fi
44 changes: 28 additions & 16 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,44 @@ if roscd skiros2; then
fi

# Python Dependencies
PIP="python$ROS_PYTHON_VERSION -m pip"
if roscd skiros2; then
cd .. && python$ROS_PYTHON_VERSION -m pip install -r requirements.txt --user
cd .. && $PIP install -r requirements.txt --user
fi
if roscd skills_sandbox; then
python$ROS_PYTHON_VERSION -m pip install -r requirements.txt --user
if [[ $ROS_PYTHON_VERSION == 3 ]]; then
$PIP install --upgrade git+https://github.com/kivy/kivy
fi
$PIP install -r requirements.txt --user
fi
if roscd vision; then
python$ROS_PYTHON_VERSION -m pip install -r requirements.txt --user
if [[ $ROS_PYTHON_VERSION == 3 ]]; then
$PIP install --upgrade git+https://github.com/emmanuelkring/pypcd.git
fi
$PIP install -r requirements.txt --user
fi
if roscd low_level_logics; then
python$ROS_PYTHON_VERSION -m pip install -r requirements.txt --user
$PIP install -r requirements.txt --user
fi

# Install realsense drivers
# Currently not available on Ubuntu 20.04
# Get distribution environment variables
. /etc/lsb-release
export repo="http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo"
export repo_check="$repo $DISTRIB_CODENAME main"
export repo_add="$repo main"
if ! grep -q "^deb .*$repo_check" /etc/apt/sources.list /etc/apt/sources.list.d/*; then\
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "$repo_add" -u
if [[ $ROS_PYTHON_VERSION == 2 ]]; then
. /etc/lsb-release
export repo="http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo"
export repo_check="$repo $DISTRIB_CODENAME main"
export repo_add="$repo main"
if ! grep -q "^deb .*$repo_check" /etc/apt/sources.list /etc/apt/sources.list.d/*; then\
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "$repo_add" -u
else
echo "Realsense repo exists already."
fi

sudo apt update
sudo apt install librealsense2-dkms librealsense2-utils librealsense2-dev
else
echo "Realsense repo exists already."
echo "WARNING: realsense drivers are currently not available for this platform"
fi

sudo apt update
sudo apt install librealsense2-dkms librealsense2-utils librealsense2-dev