We have a special workspace setup that should ensure that you can run everything on the robots and on your personal computer. Please follow the steps below:
Download the desktop image. Follow the installation instruction here.
Important: For the later installation of ROS you have to configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse.". You can follow the Ubuntu guide for instructions on doing this.
Update your installation to the newest version:
sudo apt update
sudo apt upgrade
For our setup, we named the main user of the robot smb
.
Install ROS Melodic (recommended: “Desktop-Full Install”) following the instructions. We work with Catkin Command Line Tools (catkin build instead of catkin_make) to build packages in your workspace. They can be installed with apt-get.
Setup your catkin workspace in which your packages will be built as follows. Source the environment
source /opt/ros/melodic/setup.bash
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
We recommend you to use terminator, that allows you to have multiple terminals in one window. It can be installed with.
sudo apt update
sudo apt install terminator
Install git and other dependencies:
sudo apt update
sudo apt-get install git python-catkin-tools doxygen
sudo apt-get install ros-melodic-octomap ros-melodic-octomap-msgs ros-melodic-octomap-ros ros-melodic-rosserial ros-melodic-joy ros-melodic-ompl ros-melodic-costmap-2d ros-melodic-velodyne-gazebo-plugins
sudo apt-get install libpcap0.8-dev libeigen3-dev libopencv-dev libboost-dev ros-melodic-cmake-modules libssh2-1-dev
sudo apt-get install libglpk-dev
sudo apt-get install python-wstool net-tools
sudo apt-get install liblapack-dev libblas-dev autotools-dev dh-autoreconf \
libboost-all-dev python-setuptools cppcheck default-jre libgtest-dev \
libglew-dev clang-format-3.9 python-git pylint python-termcolor \
"ros-melodic-camera-info-manager*" protobuf-compiler protobuf-c-compiler \
libssh2-1-dev libatlas3-base libnlopt-dev \
"ros-melodic-tf2-*" python-pip python-autopep8 libreadline-dev ifstat \
ntpdate sysstat libv4l-0 ros-melodic-gps-common
ccache is a tool that caches intermediate build files to speed up rebuilds of the same code. On Ubuntu it can be set up with the following command. The max. cache size is set to 10GB and can be adapt on the lines below:
sudo apt install -y ccache &&\
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc &&\
source ~/.bashrc && echo $PATH
ccache --max-size=10G
Your path (at least the beginning) should look like:
/usr/lib/ccache:/usr/local/cuda-5.5/bin/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
And g++/gcc should now point to:
which g++ gcc
/usr/lib/ccache/g++
/usr/lib/ccache/gcc
Show cache statistics:
ccache -s
Empty the cache and reset the stats:
ccache -C -z
ccache only works for a clean workspace. You will need a make clean
otherwise.
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
catkin config --extend /opt/ros/melodic
catkin config --merge-devel
catkin config -DCMAKE_BUILD_TYPE=Release
We use wstool to manage external packages in the workspace, at least for your initial setup, do:
cd ~/catkin_ws/src/
git clone https://github.com/ethz-asl/eth_supermegabot.git
wstool init
wstool merge eth_supermegabot/dependencies.rosinstall
wstool up
Note: We are currently reworking some robot-specific drivers. Therefore parts of the code are temporarily moved to a private dependent repository summer_school_private. Should you require access in the meantime, please contact the maintainers. If you want to only build/run the perception stack, you can follow the instructions here.
Build the workspace (This can take some time, grab a coffee or take a power nap).
cd ~/catkin_ws/
catkin build
Source your workspace.
source devel/setup.bash
Add your workspace to the .bashrc such that it is sourced every time you start a new shell (terminal).
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc