This repository has been archived by the owner on Jan 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
install.sh
executable file
·81 lines (66 loc) · 2.25 KB
/
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
#!/bin/bash
set -e
# Tell apt to read from the ROS package repository
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
# Update apt
sudo apt-get update
sudo apt-get -y upgrade
# Install dependencies
sudo apt-get install -y python-pip
sudo pip install rosdep rosinstall_generator wstool
# Initialize rosdep
if [ -f /etc/ros/rosdep/sources.list.d/20-default.list ];
then sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
fi
sudo rosdep init
rosdep update
# Create a service
sudo cp ./run.sh /opt/openag_run.sh
sudo cp ./openag.service /lib/systemd/system/openag.service
# Create a catkin workspace
mkdir -p ~/ros_catkin_ws
cd ~/ros_catkin_ws
# Install ros_comm and rosserial
echo Generating rosinstall file...
rm -f indigo.rosinstall src/.rosinstall
rosinstall_generator ros_comm rosserial rosserial_arduino usb_cam --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo.rosinstall
wstool init src indigo.rosinstall
# Install dependencies for all installed packages
rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:jessie
# Install packages in system directory
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo -j2
# Activate the ROS environment
source /opt/ros/indigo/setup.bash
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
# Install couchdb
sudo apt-get install -y couchdb
# Download and install core openag python package
mkdir -p ~/openag/src
cd ~/openag/src
if [ -x openag_python ]; then
cd openag_python
git pull
else
git clone https://github.com/OpenAgInitiative/openag_python.git
cd openag_python
fi
sudo pip install -e .
# Create a catkin workspace to work in and install openag_brain in it
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
if [ ! -f ./CMakeLists.txt ]; then
catkin_init_workspace
fi
if [ -x openag_brain ]; then
cd openag_brain
git pull
else
git clone https://github.com/OpenAgInitiative/openag_brain.git
fi
cd ~/catkin_ws
catkin_make
catkin_make install
source devel/setup.bash
rosdep install -i -y openag_brain || exit 1
rosrun openag_brain install_pio