This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
/
ros_install.sh
100 lines (85 loc) · 2.53 KB
/
ros_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
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
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# Install dependecies
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get upgrade
# list of packages to be installed
packagelist=(
cmake
google-mock
libapr1-dev
libaprutil1-dev
libboost-all-dev
libbz2-dev
libconsole-bridge-dev
libgpgme-dev
libgtest-dev
liblog4cxx-dev
liblz4-dev
libpoco-dev
libssl-dev
libtinyxml2-dev
pkg-config
python-catkin-pkg
python-coverage
python-defusedxml
python-empy
python-gnupg
python-imaging
python-mock
python-netifaces
python-nose
python-numpy
python-paramiko
python-pip
python-rosdep
python-rospkg
python-yaml
python3-pip
python3-yaml
)
apt-get install -y ${packagelist[@]}
# Upgrade pip version
pip install --upgrade setuptools
# Use pip to intall ros
pip install -U rosdep rosinstall_generator wstool rosinstall
# Use pip3 to install python 3 ros package
pip3 install -U rospkg catkin_pkg
# Install sbcl
wget http://netcologne.dl.sourceforge.net/project/sbcl/sbcl/1.2.7/sbcl-1.2.7-armel-linux-binary.tar.bz2
tar -xjf sbcl-1.2.7-armel-linux-binary.tar.bz2
cd sbcl-1.2.7-armel-linux
chmod +x install.sh
INSTALL_ROOT=/usr/local
./install.sh
cd ..
# Initiallize ros
rosdep init
echo -e "sbcl:\n debian:\n stretch: []" > /etc/ros/rosdep/ev3dev.yaml
echo "yaml file:///etc/ros/rosdep/ev3dev.yaml" >> /etc/ros/rosdep/sources.list.d/20-default.list
# Switch to robot user and build ros
sudo -i -u robot bash << EOF
rosdep update
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
rosinstall_generator ros_comm sensor_msgs --rosdistro melodic --deps --tar > melodic-ros_comm.rosinstall
wstool init -j8 src melodic-ros_comm.rosinstall
rosdep install --from-paths src --ignore-src --rosdistro melodic -y
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
echo "source ~/ros_catkin_ws/install_isolated/setup.bash" >> ~/.bashrc
echo "export ROS_MASTER_URI=http://raspberrypi:11311/" >> ~/.bashrc
EOF
# COPY ROS APP AND SERVICE