forked from erlerobot/gym-gazebo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_indigo.bash
executable file
·124 lines (112 loc) · 4.06 KB
/
setup_indigo.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
if [ -z "$ROS_DISTRO" ]; then
echo "ROS not installed. Check the installation steps: https://github.com/erlerobot/gym#installing-the-gazebo-environment"
fi
program="gazebo"
condition=$(which $program 2>/dev/null | grep -v "not found" | wc -l)
if [ $condition -eq 0 ] ; then
echo "Gazebo is not installed. Check the installation steps: https://github.com/erlerobot/gym#installing-the-gazebo-environment"
fi
source /opt/ros/indigo/setup.bash
# Create catkin_ws
ws="catkin_ws"
if [ -d $ws ]; then
echo "Error: catkin_ws directory already exists" 1>&2
exit 1
fi
src=$ws"/src"
mkdir -p $src
cd $src
catkin_init_workspace
# Install dependencies
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116
sudo apt-get update
sudo apt-get install -y git \
mercurial \
libsdl-image1.2-dev \
libspnav-dev \
libtbb-dev \
libtbb2 \
libusb-dev libftdi-dev \
pyqt4-dev-tools \
python-vcstool \
ros-indigo-bfl \
python-pip \
g++ \
ccache \
realpath \
libopencv-dev \
libtool \
automake \
autoconf \
libexpat1-dev \
ros-indigo-mavlink \
ros-indigo-octomap-msgs \
ros-indigo-joy \
ros-indigo-geodesy \
ros-indigo-octomap-ros \
ros-indigo-control-toolbox \
ros-indigo-pluginlib \
ros-indigo-trajectory-msgs \
ros-indigo-control-msgs \
ros-indigo-std-srvs \
ros-indigo-nodelet \
ros-indigo-urdf \
ros-indigo-rviz \
ros-indigo-kdl-conversions \
ros-indigo-eigen-conversions \
ros-indigo-tf2-sensor-msgs \
ros-indigo-pcl-ros \
gawk \
libtinyxml2-dev
sudo easy_install numpy
sudo easy_install --upgrade numpy
sudo pip install --upgrade matplotlib
sudo pip2 install pymavlink MAVProxy catkin_pkg --upgrade
echo "\nDependencies installed\n"
#Install Sophus
cd ../../
git clone https://github.com/stonier/sophus -b indigo
cd sophus
mkdir build
cd build
cmake ..
make
sudo make install
echo "## Sophus installed ##\n"
#Install APM/Ardupilot
cd ../../
mkdir apm
cd apm
git clone https://github.com/erlerobot/ardupilot.git -b gazebo_udp
git clone https://github.com/tridge/jsbsim.git
cd jsbsim
./autogen.sh --enable-libraries
make -j2
sudo make install
echo "## AMP/Ardupilot installed ##"
# Import and build dependencies
cd ../../catkin_ws/src/
vcs import < ../../gazebo.repos
cd ..
catkin_make --pkg mav_msgs
source devel/setup.bash
catkin_make -j 1
bash -c 'echo source `pwd`/devel/setup.bash >> ~/.bashrc'
echo "## ROS workspace compiled ##"
#add own models path to gazebo models path
if [ -z "$GAZEBO_MODEL_PATH" ]; then
bash -c 'echo "export GAZEBO_MODEL_PATH="`pwd`/../../assets/models >> ~/.bashrc'
exec bash #reload bashrc
fi
# Theano and Keras installation and requisites
cd ../
sudo pip install h5py
sudo apt-get install gfortran
git clone git://github.com/Theano/Theano.git
cd Theano/
sudo python setup.py develop
sudo pip install keras
echo "## Theano and Keras installed ##"
echo "## Installation finished ##"