-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathros_indigo_install.sh
74 lines (58 loc) · 2.1 KB
/
ros_indigo_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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# The BSD License
# Copyright (c) 2015 Laboratory For Intelligent Robots & Vision System, Kyushu University.
version=`lsb_release -sc`
echo "[Checking the ubuntu version]"
case $version in
"saucy" | "trusty")
;;
*)
echo "[This script will only work on ubuntu saucy(13.10) or trusty(14.04)]"
exit 0
esac
echo "[Update & upgrade the package]"
sudo apt-get update -qq
sudo apt-get upgrade -qq
echo "[Check the 14.04.2 TLS issue]"
relesenum=`grep DISTRIB_DESCRIPTION /etc/*-release | awk -F 'Ubuntu ' '{print $2}' | awk -F ' LTS' '{print $1}'`
if [ "$relesenum" = "14.04.2" ]
then
echo "Your ubuntu version is $relesenum"
echo "Intstall the libgl1-mesa-dev-lts-utopic package to solve the dependency issues during the ROS installation"
sudo apt-get install -y libgl1-mesa-dev-lts-utopic
else
echo "Your ubuntu version is $relesenum"
fi
echo "[Installing chrony and setting the ntpdate]"
sudo apt-get install -y chrony
sudo ntpdate ntp.ubuntu.com
echo "[Add the ROS repository]"
if [ ! -e /etc/apt/sources.list.d/ros-latest.list ]; then
sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu ${version} main\" > /etc/apt/sources.list.d/ros-latest.list"
fi
echo "[Set up your ROS keys]"
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
echo "[Update & upgrade the package]"
sudo apt-get update -qq
sudo apt-get upgrade -qq
echo "[Installing ROS]"
sudo apt-get install -y ros-indigo-desktop-full ros-indigo-rqt-*
echo "[rosdep init and python-rosinstall]"
sudo sh -c "rosdep init"
rosdep update
. /opt/ros/indigo/setup.sh
sudo apt-get install -y python-rosinstall
echo "[Making the catkin workspace and testing the catkin_make]"
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make
echo "[Setting the ROS evironment]"
sh -c "echo \"source /opt/ros/indigo/setup.bash\" >> ~/.bashrc"
sh -c "echo \"source ~/catkin_ws/devel/setup.bash\" >> ~/.bashrc"
sh -c "echo \"export ROS_MASTER_URI=http://localhost:11311\" >> ~/.bashrc"
sh -c "echo \"export ROS_HOSTNAME=localhost\" >> ~/.bashrc"
echo "[Complete!!!]"
exec bash
exit 0