-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall_ros.sh
executable file
·135 lines (96 loc) · 3 KB
/
install_ros.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
echo "*** add user to dialout for asctec hl ***"
username=`whoami`
sudo adduser $username dialout
echo
# system monitor
sudo add-apt-repository ppa:indicator-multiload/stable-daily -y
sudo apt-get update
# some usefull packages
sudo apt-get install vim htop meld gitk git-cola indicator-multiload -y
# install some codecs
#sudo apt-get install libavformat-extra-53 libavcodec-extra-53 ubuntu-restricted-extras -y
# --- SET UP ROS ---
# add ros repository to package manager
UBUNTU_VERSION=$(lsb_release -a)
if [[ $UBUNTU_VERSION == *12.10* ]]
then
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu quantal main" > /etc/apt/sources.list.d/ros-latest.list'
elif [[ $UBUNTU_VERSION == *13.04* ]]
then
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu raring main" > /etc/apt/sources.list.d/ros-latest.list'
elif [[ $UBUNTU_VERSION == *12.04* ]]
then
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
else
echo "Unknown Ubuntu Version for ROS Hydro"
fi
# add key to ros repository
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
# update package manager
sudo apt-get update
# install ros hydro
sudo apt-get install ros-hydro-desktop-full -y
# initialize rosdep
sudo rosdep init
rosdep update
# ros python install helper
sudo apt-get install python-rosinstall -y
# install node manager
sudo apt-get install ros-hydro-node-manager-fkie -y
echo
echo "*** SETTING UP ROS ***"
echo
cd ~
source /opt/ros/hydro/setup.bash
# create catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make
cd ~
# create rosbuild workspace
mkdir -p ~/rosbuild_ws
rosws init ~/rosbuild_ws ~/catkin_ws/devel
# add ros to bash
sh -c 'echo "source ~/rosbuild_ws/setup.bash" >> ~/.bashrc'
# --- SET UP GIT ---
while true; do
read -p "Do you wish to set up git? [y/n] " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# fancy bash coloring for git :)
sh -c 'echo "export GIT_PS1_SHOWDIRTYSTATE=1" >> ~/.bashrc'
echo "export PS1='\[\033[03;32m\]\u@\h\[\033[01;34m\]:\w\[\033[02;33m\]\$(__git_ps1)\[\033[01;34m\]\\$\[\033[00m\] '" >> ~/.bashrc
echo ""
read -p "your git user name (Full name)? " git_name
echo "$ git config --global user.name \"$git_name\""
git config --global user.name "$git_name"
echo ""
read -p "your git email? " git_email
echo "$ git config --global user.email "$git_email
git config --global user.email $git_email
echo ""
git config --global credential.helper cache
git config --global push.default current
git config --list
echo ""
echo "*** setting up ssh ***"
if [ ! -f ~/.ssh/id_rsa.pub ]; then
echo "ssh key not found!"
echo "generating one for you"
echo "$ ssh-keygen"
ssh-keygen
else
echo "ssh public key found!"
fi
echo
echo "$ cat ~/.ssh/id_rsa.pub"
cat ~/.ssh/id_rsa.pub
echo
read -p "Please copy your ssh public key to your github account" temp