-
Notifications
You must be signed in to change notification settings - Fork 69
/
step1.bash
executable file
·51 lines (38 loc) · 1.44 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
50
51
#!/bin/bash -exv
UBUNTU_VER=$(lsb_release -sc)
ROS_VER=noetic
[ "$UBUNTU_VER" = "focal" ] || exit 1
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 -f /etc/ros/rosdep/sources.list.d/20-default.list
sudo apt install -y python3-pip
sudo -H pip3 install rosdep
sudo rosdep init
sudo rosdep update
sudo apt-get install -y python3-rosinstall
sudo apt-get install -y build-essential
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
sudo mkdir -p $HOME/.ros/
sudo chown $USER:$USER $HOME/.ros/ -R
### instruction for user ###
set +xv
echo '***INSTRUCTION*****************'
echo '* do the following command *'
echo '* $ source ~/.bashrc *'
echo '* after that, try *'
echo '* $ LANG=C roscore *'
echo '*******************************'