====== Run ROS locally ====== ===== At Labs ===== At [[https://cyber.felk.cvut.cz/study/computer-labs/|labs]] (e.g., E130, E132), Robot Operating System (ROS) is available through [[https://en.wikipedia.org/wiki/Singularity_(software)|Singularity]] containers. Open terminal and run singularity image with Ubuntu 20.04 + ROS Noetic:\\ ''singularity shell %%--%%nv /opt/singularity/robolab/noetic''\\ (''%%--%%nv'' is needed for graphical output, e.g. RViz)\\ Then source common ARO catkin workspace:\\ ''source /opt/ros/aro/setup.bash''\\ or, your own workspace (if you have any):\\ ''source ~/workspace/aro/devel/setup.bash'' /* All images from Docker Hub are available too, e.g.:\\ ''singularity shell %%--%%nv docker:%%//%%ros:noetic-robot''\\ Note however that the images are quite large and download to your home (with limited space) by default: So one may need to switch the cache directory somewhere else, e.g.:\\ ''mkdir -p /tmp/$USER/singularity''\\ ''ln -s /tmp/$USER/singularity ~/.singularity''*/ ===== On Your Computer ===== ==== Linux ==== Use either local installation on Ubuntu 20.04, or Singularity below. === Local installation on Ubuntu 20.04 === http://wiki.ros.org/noetic/Installation/Ubuntu If you don't use Singularity and the provided image, all dependencies and parent workspaces must be installed manually. Scripts in repository https://gitlab.fel.cvut.cz/robolab/deploy can help with that. Install dependencies: git clone https://gitlab.fel.cvut.cz/robolab/deploy.git sudo xargs -a deploy/config/robolab_noetic.apt apt-get install /* cat deploy/config/robolab_noetic.apt | sudo apt-get install */ Configure required workspaces (robolab, aro, lar, mkr) in a selected parent directory, e.g. ''~/workspace/ros'': ws_parent=~/workspace/ros rosdep=y sudo deploy/scripts/setup_noetic_workspaces If you encounter error message ''error: option --install-layout not recognized'', you may need to purge incompatible libraries installed via pip, or install a compatible version, see [[https://github.com/ros/catkin/issues/863#issuecomment-1000446018|the issue]]. Then, your student's workspace, e.g. ''~/workspace/aro'', should extend your local ''~/workspace/ros/aro'' workspace instead of ''/opt/ros/aro'' used with Singularity image. catkin config --extend ~/workspace/ros/aro === Singularity === /* - Download and build [[https://gitlab.fel.cvut.cz/robolab/deploy/-/blob/master/singularity/robolab_noetic.txt|Singularity image recipe]] provided for labs using ''sudo singularity build robolab_noetic.simg robolab_noetic.txt''. You also need to have this file [[https://gitlab.fel.cvut.cz/robolab/deploy/-/blob/master/singularity/sudo | this file ]] in the same directory. */ - If you have Ubuntu 20.04 installed, the package is missing in system repositories and you have to install Singularity manually.\\ Follow the Quick Start Guide https://sylabs.io/guides/3.5/user-guide/quick_start.html \\ and use version 3.5.3 https://github.com/hpcng/singularity/releases/tag/v3.5.3 (download command: ''wget https://github.com/apptainer/singularity/releases/download/v3.5.3/singularity-3.5.3.tar.gz''). For other systems, refer to https://sylabs.io/guides/latest/user-guide/. - Build Singularity image:git clone https://gitlab.fel.cvut.cz/robolab/deploy.git cd deploy/singularity singularity build --fakeroot robolab_noetic.simg robolab_noetic.txt - run singularity image with Ubuntu 20.04 + ROS Noetic:\\ ''singularity shell %%--%%nv path/to/robolab_noetic.simg''\\ (''%%--%%nv'' is needed for graphical output with NVIDIA graphic card, e.g. RViz)\\ - Then source common ARO catkin workspace:\\ ''source /opt/ros/aro/setup.bash''\\ or, your own workspace (if you have any):\\ ''source ~/workspace/aro/devel/setup.bash'' /* (built from [[http://ptak.felk.cvut.cz/tradr/share/aro_melodic.txt|recipe]]). To build the image (on your own computer), you can use one of these commands: - '' $ sudo singularity build ros-noetic-desktop-full.simg ros-noetic-desktop-full.txt ''\\ or in general: \\ '' $ sudo singularity build .simg .txt '' - Alternatively, you can build "an unpacked image" via \\ '' $ sudo singularity build %%--%%sandbox ros/ ros-kinetic-desktop-full.txt ''\\ or in general: \\ '' $ sudo singularity build %%--%%sandbox .txt '' Both of these alternatives will create an image from the recipe. You can also edit the recipe (since it is a simple text file). You need to use ''sudo'' when building images or use "fakeroot" (see ''singularity help build'' for more details). The unpacked image is useful when you would like to add (install) additional packages to the image. You can to this by running ''sudo singularity shell %%--%%writable '' after building the unpacked image. Afterwards, you should be able to use "apt-get install" to install additional packages. */ /*==== Windows ==== * Ubuntu in [[https://www.virtualbox.org/|VirtualBox]] * Via [[https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux|Windows Subsystem for Linux (WSL)]], see [[http://wiki.ros.org/Installation/Windows]] * Expect the support to be only partial as WSL have some limitations. * Use ROS Melodic with Ubuntu 18.04 or ROS Kinetic with Ubuntu 16.04. ROS installation instructions for Linux shoud work once you are in the Ubuntu Bash shell. * For applications with graphical output (e.g., RViz), you will need: * Running X Server for Windows (e.g., [[https://sourceforge.net/projects/xming/|XMing]]) * Target X display specified (usually '':0'') when running graphical applications:\\ ''DIPLAY=:0 rosrun rviz rviz'' * You can add it to ''~/.bashrc'' for it to stay in effect:\\ ''echo 'export DISPLAY=:0' > ~/.bashrc'' * Dual boot with Ubuntu */