-
Notifications
You must be signed in to change notification settings - Fork 2
/
ros_install.sh
executable file
·31 lines (24 loc) · 1.19 KB
/
ros_install.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
#!/usr/bin/env bash
# Plinio Moreno @ Vislab
ROS_VERSION=melodic
read -p "[Vizzy]: What is your ROS VERSION? Default: $ROS_VERSION " NEW_ROS_VERSION
if [ ! -z "$NEW_ROS_VERSION" ]; then
ROS_VERSION=$NEW_ROS_VERSION
echo "[Vizzy]: I'm going to install ROS $ROS_VERSION"
fi
sudo apt install -y lsb-release
sudo apt install -y add-apt-key
if [ $ROS_VERSION = "melodic" ]; 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://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
elif [ $ROS_VERSION = "kinetic" ];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://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
fi
sudo apt update
sudo apt-get install -y ros-$ROS_VERSION-desktop-full
sudo apt install -y python-rosdep
sudo rosdep init
rosdep update
echo "source /opt/ros/$ROS_VERSION/setup.bash" >> $HOME/.bashrc
printf "\n [Vizzy]: After this script finishes, verify that you execute: source ~/.bashrc in your terminal\n"