forked from ryuichiueda/ros_setup_scripts_Ubuntu16.04_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
step1.bash
executable file
·49 lines (35 loc) · 1.39 KB
/
step1.bash
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
#!/bin/bash -exv
UBUNTU_VER=$(lsb_release -sc)
ROS_VER=kinetic
[ "$UBUNTU_VER" = "trusty" ] && ROS_VER=indigo
echo "deb http://packages.ros.org/ros/ubuntu $UBUNTU_VER main" > /tmp/$$-deb
sudo mv /tmp/$$-deb /etc/apt/sources.list.d/ros-latest.list
set +vx
while ! sudo apt-get install -y curl ; do
echo '***WAITING TO GET A LOCK FOR APT...***'
sleep 1
done
set -vx
curl -k https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add -
sudo apt-get update || echo ""
sudo apt-get install -y ros-${ROS_VER}-ros-base
ls /etc/ros/rosdep/sources.list.d/20-default.list && sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
sudo rosdep init
rosdep update
sudo apt-get install -y python-rosinstall
sudo apt-get install -y build-essential
#[ "$ROS_VER" = "kinetic" ] && sudo apt-get install -y ros-${ROS_VER}-roslaunch
grep -F "source /opt/ros/$ROS_VER/setup.bash" ~/.bashrc ||
echo "source /opt/ros/$ROS_VER/setup.bash" >> ~/.bashrc
grep -F "ROS_MASTER_URI" ~/.bashrc ||
echo "export ROS_MASTER_URI=http://localhost:11311" >> ~/.bashrc
grep -F "ROS_HOSTNAME" ~/.bashrc ||
echo "export ROS_HOSTNAME=localhost" >> ~/.bashrc
### instruction for user ###
set +xv
echo '***INSTRUCTION*****************'
echo '* do the following command *'
echo '* $ source ~/.bashrc *'
echo '* after that, try *'
echo '* $ LANG=C roscore *'
echo '*******************************'