-
Notifications
You must be signed in to change notification settings - Fork 4
Installation
Note: The default install instructions for these packages will not work. You can get away with defaults for Ubuntu, ROS Kinetic, and gcc6, but the default install instructions will not work for wstool, Morse, or OpenCV.
ROS Kinetic requires ubuntu 16.04
If you don't have Ubuntu installed, install version 16.04 because it's LTS (Long term service). There's a useful tutorial here.
If you already have Ubuntu, but a version different from 16.04, you can install Ubuntu 16.04 in a chroot environment under your existing operating system. To do this, follow the instructions here, but replace every occurence of "Indigo" with "Kinetic" and "trusty" with "xenial".
Run the following (you can copy and paste the whole thing):
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 ros-kinetic-ros-base && \
sudo rosdep init && \
rosdep updateRun the following, you can copy and paste as one command:
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;
This snippet was originally derived from here: https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
Enable NVIDIA drivers (this depends on what GPU you have, you'll need to look up instructions online)
Download the CUDA 9 package
cd ~/Downloads && \
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux && \
mv cuda_9.1.85_387.26_linux cuda_9.1.85_387.26_linux.run && \
chmod +x cuda_9.1.85_387.26_linux.run && \
sudo ./cuda_9.1.85_387.26_linux.run --silent --toolkit --samples --override
Switch to gcc5
sudo update-alternatives --config gcc
It is easiest to install OpenCV from source given that we are using a specific version. Use version 3.3.1.
The instructions for install opencv are based off of this guide here.
Download this source tarball
cd ~/iarc7 && \
wget https://github.com/opencv/opencv/archive/3.3.1.tar.gz && \
tar -xvsf 3.3.1.tar.gz;
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
cd ~/iarc7/opencv-3.3.1 && \
mkdir release && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=Release -D CUDA_FAST_MATH=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..;
Build, replace the number for with the number of cores you have (This will take a hot minute)
make -j4
Install
sudo make install
Remember to switch back to gcc6 once OpenCV is installed.
First, install ROS's tool for managing workspaces:
sudo apt-get install python-wstool
Then, create a workspace. This folder can be anywhere, but here's how to create one in your home directory:
mkdir -p ~/iarc7/src
Clone the iarc7_common repository:
cd ~/iarc7
git clone https://github.com/Pitt-RAS/iarc7_common.git
Source ros variables:
source /opt/ros/kinetic/setup.bash
Download the repos:
wstool init src iarc7_common/main.rosinstall
Install dependencies:
rosdep install --from-paths src --ignore-src --rosdistro=kinetic -y
Build for the first time
catkin_make
And finally, make your ROS environment be set up automatically in the future:
echo "source ~/iarc7/devel/setup.bash" >> ~/.bashrc && \
source ~/.bashrc;
If you don't do this, you'll have to run source ~/iarc7/devel/setup.bash every time you open a new terminal.
Install required packages:
sudo apt-get install cmake python3-dev python3-numpy
Download and unzip blender: We need this specific version because it matches the system python version.
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, assumes you installed blender in your home directory:
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 (Note: DO NOT install python3-rospkg with apt-get)
sudo apt-get install 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 (instructions copied from https://github.com/Pitt-RAS/iarc7_simulator)
cd ~/iarc7 && \
wstool merge -t src iarc7_common/simulator.rosinstall;
If this is your first time setting up an iarc workspace run
wstool update -t src
Now import and compile the sim
cd ~/iarc7 && \
cd src/iarc7_simulator && \
morse import sim && \
cd ~/iarc7 && \
catkin_make;
To launch the simulator (It won't do anything, just render the scene)
roslaunch iarc7_simulator morse.launch
If you wish to use ssh keys instead of http authentication:
cd ~/iarc7
find . -path "./src/*/.git/config" | xargs -n 1 sed -i "s/https:\/\/github.com\//git@github.com:/"
sed -i "s/https:\/\/github.com\//git@github.com:/" ./src/.rosinstall
When new packages are added to the rosinstall files in this repository, run
the following to update:
cd ~/iarc7/iarc7_common && \
git pull && \
cd ~/iarc7 && \
wstool merge -t src iarc7_common/main.rosinstall && \
wstool update -t srcIf you're using ssh authentication, run the snippet under SSH Authentication for GitHub again after running the above.