/
ros.sh
executable file
·39 lines (30 loc) · 1.66 KB
/
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
#!/bin/bash
clear
echo "******************************************************************************"
echo -e "\e[1;92mInstalling ROS Hydro for Ubuntu 12.04 (Precise)\e[0m"
echo "******************************************************************************"
sleep 5
echo -e "\e[1;92m*******Installing ROS*******\e[0m"
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install ros-hydro-desktop
sudo apt-get -y install ros-hyrdo-rosbridge-suite
sudo rosdep init
rosdep update
sudo apt-get install -y ros-hydro-joy
sudo apt-get install -y python-rosinstall
sudo sed -i 's/CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ > $_SETUP_TMP/CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ >> $_SETUP_TMP/g' /opt/ros/hydro/setup.sh
sudo sed -i 's/while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do/while [[ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]]; do/g' /opt/ros/hydro/setup.sh
source /opt/ros/hydro/setup.bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws/
catkin_make
echo "source /opt/ros/hydro/setup.bash" >> ~/.bashrc
echo "sed -i 's/while [ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]; do /while [[ $_i -lt $_CATKIN_ENVIRONMENT_HOOKS_COUNT ]]; do/g' ~/catkin_ws/devel/setup.sh" >> .bashrc
echo "sed -i 's/CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ > $_SETUP_TMP/CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ >> $_SETUP_TMP/g' ~/catkin_ws/devel/setup.sh" >> .bashrc
echo "#source ~/catkin_ws/install/setup.bash" >> .bashrc
echo "source ~/catkin_ws/devel/setup.sh" >> .bashrc
cd $HOME