Skip to content

Instantly share code, notes, and snippets.

@bitoffdev
Last active July 20, 2017 05:37
Show Gist options
  • Save bitoffdev/a3a6ae87098c4c63e7a0cfc6cb38c2e0 to your computer and use it in GitHub Desktop.
Save bitoffdev/a3a6ae87098c4c63e7a0cfc6cb38c2e0 to your computer and use it in GitHub Desktop.
###############################################################################
##### INSTALL ROS KINETIC #####################################################
###############################################################################
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://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-get update
sudo apt-get install -y ros-kinetic-ros-base
sudo rosdep init
rosdep update
###############################################################################
##### INSTALL GCC 5 AND 6 #####################################################
###############################################################################
sudo apt-get update
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-snapshot -y
sudo apt-get update
sudo apt-get install gcc-6 g++-6 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
###############################################################################
##### INSTALL CUDA ############################################################
###############################################################################
cd ~/Downloads
sudo update-alternatives --set gcc /usr/bin/gcc-5
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run && \
mv cuda_8.0.61_375.26_linux-run.1 cuda_8.0.61_375.26_linux.run && \
chmod +x cuda_8.0.61_375.26_linux.run && \
sudo ./cuda_8.0.61_375.26_linux.run --silent --toolkit --samples --override
###############################################################################
##### INSTALL OpenCV ##########################################################
###############################################################################
# Download OpenCV zip from SourceForge
cd ~/Downloads
curl -L -o opencv.zip "https://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.13/opencv-2.4.13.zip"
unzip opencv.zip -d ~
rm opencv.zip
# Install packages
sudo apt-get install build-essential -y
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev -y
# Setup build directory
mkdir ~/opencv-2.4.13/release
cd ~/opencv-2.4.13/release
sudo update-alternatives --set gcc /usr/bin/gcc-5
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..;
make -j4
sudo make install
###############################################################################
##### SETTING UP A WORKSPACE WITH WSTOOL ######################################
###############################################################################
sudo update-alternatives --set gcc /usr/bin/gcc-6
sudo apt-get install -y python-wstool
mkdir -p ~/iarc7/src
cd ~/iarc7
git clone https://github.com/Pitt-RAS/iarc7_common.git
source /opt/ros/kinetic/setup.bash
wstool init src iarc7_common/main.rosinstall
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
catkin_make
echo "source ~/iarc7/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
###############################################################################
##### INSTALLING MORSE ########################################################
###############################################################################
sudo apt-get install -y cmake python3-dev python3-numpy
# Download and unzip blender
cd ~ && \
wget http://download.blender.org/release/Blender2.78/blender-2.78c-linux-glibc219-x86_64.tar.bz2 && \
tar xvjf blender-2.78c-linux-glibc219-x86_64.tar.bz2;
# Clone the latest morse and build/install it:
git clone https://github.com/morse-simulator/morse.git && \
cd morse && \
mkdir build && cd build && \
cmake .. && \
sudo make install;
# Add blender environment variable
echo "export MORSE_BLENDER="~/blender-2.78c-linux-glibc219-x86_64/blender" ">> ~/.bashrc && \
source ~/.bashrc;
# Check if everything is ok with:
morse check
# Install ROS support for MORSE
sudo apt-get install -y python3-pip
pip3 install --ignore-installed --install-option="--prefix=~/blender-2.78c-linux-glibc219-x86_64/2.78/python" rospkg catkin_pkg
# Download iarc7_simulator
cd ~/iarc7
wstool merge -t src iarc7_common/simulator.rosinstall;
# Update
wstool update -t src
# Compile the sim
cd ~/iarc7/src/iarc7_simulator
morse import sim
cd ~/iarc7
catkin_make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment