forked from kirmani/senior_design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·122 lines (96 loc) · 4.78 KB
/
setup.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/sh
#
# setup.sh
# Copyright (C) 2017 Sean Kirmani <[email protected]>
#
# Distributed under terms of the MIT license.
#
# This script sets up the build environment.
PROJECT_DIR=`pwd -P`
# Set-up githooks.
git config core.hooksPath .githooks
# Initialize and update submodules.
git submodule update --init --recursive
# Create a journey workspace.
mkdir -p ~/journey_ws/src
# Install ROS.
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# Setup your computer to accept software from packages.ros.org.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Set up your keys.
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# Make sure your Debian package index is up-to-date.
sudo apt-get update
# Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic
# libraries, 2D/3D simulators, navigation and 2D/3D perception
sudo apt-get -y install ros-kinetic-desktop-full
# In order to use rosdep, we have to initialize it.
sudo rosdep init
rosdep update
# Up to now you have installed what you need to run the core ROS packages. To
# create and manage your own ROS workspaces, there are various tools and
# requirements that are distributed separately. For example, rosinstall is a
# frequently used command-line tool that enables you to easily download many
# source trees for ROS packages with one command.
# To install this tool and other dependencies for building ROS packages, run:
sudo apt-get -y install python-rosinstall python-rosinstall-generator python-wstool build-essential python-catkin-tools ros-kinetic-joy ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard ros-kinetic-laser-proc ros-kinetic-rgbd-launch ros-kinetic-depthimage-to-laserscan ros-kinetic-rosserial-arduino ros-kinetic-rosserial-python ros-kinetic-rosserial-server ros-kinetic-rosserial-client ros-kinetic-rosserial-msgs ros-kinetic-amcl ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-compressed-image-transport ros-kinetic-rqt-image-view ros-kinetic-gmapping ros-kinetic-navigation ros-kinetic-ar-track-alvar
# Install hector quadrotor suite.
sudo apt-get -y install ros-kinetic-hector-*
# Install ardrone_autonomy.
sudo apt-get -y install ros-kinetic-ardrone-autonomy freeglut3-dev liblapack-dev libopenblas-dev
# Install python packages
sudo apt-get install python-pip
sudo pip install scipy tensorflow
# Link this project to your journey workspace.
unlink ~/journey_ws/src/journey
ln -s $PROJECT_DIR ~/journey_ws/src/journey
# # Add some convenient bash commands.
echo "source ~/journey_ws/src/journey/journey.bash" >> ~/.bashrc
bash ~/.bashrc
# Build journey workspace.
cd ~/journey_ws
source /opt/ros/kinetic/setup.bash
catkin init
catkin clean --yes
cd src
wstool update
cd ..
catkin build
elif [[ "$OSTYPE" == "darwin"* ]]; then
# Use homebrew to install additional software.
brew update
brew install cmake
# Add our ROS Indigo tap and the Homebrew science tap so you can get some
# non-standard formulae.
brew tap ros/deps
brew tap osrf/simulation # Gazebo, sdformat, and ogre
brew tap homebrew/versions # VTK5
brew tap homebrew/science # others
# Export environment to path.
export PATH=/usr/local/bin:$PATH
# Tell python about modules installed with homebrew.
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
# If you don't already have pip, install it with:
brew install python
sudo -H python2 -m pip install -U pip # Update pip
# Install ROS using pip.
sudo -H python2 -m pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg sphinx
# In order to use rosdep, we have to initialize it.
sudo rosdep init
rosdep update
# Go to workspace.
cd ~/journey_ws
# Fetch core packages so we can build them. We will use wstool for this.
# Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall
# This will add all of the catkin or wet packages in the given variant and
# then fetch the sources into the ~/ros_catkin_ws/src directory. The command
# will take a few minutes to download all of the core ROS packages into the
# src folder. The -j8 option downloads 8 packages in parallel.
wstool init -j8 src kinetic-desktop-wet.rosinstall
# Before you can build your catkin workspace you need to make sure that you
# have all the required dependencies. We use the rosdep tool for this:
rosdep install --from-paths src --ignore-src --rosdistro kinetic -y
fi
exit 0