This workspace is being developed since 2020 and it was tested on several computers. The last tests occurred on Jul 9, 2024, on an old laptop with a 4th Gen Intel i7 Processor, and it worked on the first attempt. It assumes that you have previous experience installing operating systems on your personal computer and understand tools such as git, curl, bash, and tmux, specifically how to run commands in a terminal.
All simulations in this workspace are intended to run on native Ubuntu 20.04. While many students and professionals might prefer to use Docker and install ROS in a container, I believe that the additional system architecture layer introduced by Docker is detrimental to understanding, mainly because ROS itself can be very complicated for the inexperienced explorer, as I’ve explained here. Another reason is that when working with mobile robots in simulations, we often need to visualize what is happening. Unfortunately, there is no easy way to make the graphics card driver communicate with the native system if they are different (e.g., a container running Ubuntu 20.04 with a host machine running Ubuntu 24.04 with different glibc libraries), which results in very clunky simulations and extremely low fps.
In summary, you would need to follow these steps:
- Download Ubuntu 20.04 image from here
- Use a USB Startup Disk Creator, such as Rufus to create a bootable device using the image downloaded from step 1.
- Restart your computer, boot from the pendrive, and follow the instructions.
- After finishing the installation, boot in Ubuntu 20.04 and login with your user name and password.
- Ensure that you have a graphics card good enough to run this workspace packages and that its driver is properly installed.
In summary, you need to follow these steps:
-
After loggin in Ubuntu, open a terminal.
-
At the terminal install the following package and add an entry pointing to ROS Jazzy repsitories at your sources list with the following commands.
sudo apt install curl sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo apt update -
Install ROS 1 Noetic with the following command. In particullar, I preffer installing the full package for research purposes to reduce the chances of unmet dependencies when testing and working with robots.
sudo apt install ros-noetic-desktop-full -
Add an entry at the start of your .bashrc file to make your system be able to see where ROS programs are installed and the resources provided in this workspace.
sed -i '1i export GAZEBO_MODEL_PATH = PATH_TO_MODELS' ~/.bashrc sed -i '1i export GAZEBO_RESOURCE_PATH = PATH_TO_RESOURCES' ~/.bashrc sed -i '1i source /opt/ros/noetic/setup.bash' ~/.bashrcthe starting of your .bashrc file should look something like this
source /opt/ros/noetic/setup.bash export GAZEBO_RESOURCE_PATH = PATH_TO_RESOURCES export GAZEBO_MODEL_PATH = PATH_TO_MODELS # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac
In this case, your MUST replace
PATH_TO_RESORRCESwith the path of theROS-Noetic-Multi-robot-Sandbox/gazebo_resources/worldsandPATH_TO_MODELSshoudl beROS-Noetic-Multi-robot-Sandbox/gazebo_resources/modelsfrom this workspace. This allows both, Gazebo 11 and rviz to see the available resources and load the models accordingly.
This project rely on Tmux. Therefore, you MUST install it to work with multiple robots and have a clean visualization. I highly recommend to install the theme described here.
-
Install Git hub program to be able to clone and push into remote repositories.
sudo apt install git -
Install tmux program with the following command.
sudo apt install tmux -
Install tmux plugin manager for a better experience.
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm -
Copy the following configuration into a file named
~/.tmux.conf.set -g @plugin 'o0th/tmux-nova' set -g @nova-nerdfonts true set -g @nova-nerdfonts-left set -g @nova-nerdfonts-right set -g @nova-segment-mode "#{?client_prefix,Ω,ω}" set -g @nova-segment-mode-colors "#50fa7b #282a36" set -g @nova-segment-whoami "#(whoami)@#h" set -g @nova-segment-whoami-colors "#50fa7b #282a36" set -g @nova-pane "#I#{?pane_in_mode, #{pane_mode},} #W" set -g @nova-rows 0 set -g @nova-segments-0-left "mode" set -g @nova-segments-0-right "whoami" # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g mouse on # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm'
-
Open tmux by typing
tmuxin a terminal. -
Enter command mode with
ctr+b. -
Install plugins with
shift+iwhile in command mode. -
Install a
patched fontfrom here and make it default in your terminal. I also recommend turning off theUse colors from system theme.
-
Install
catkin_tools.sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \ > /etc/apt/sources.list.d/ros-latest.list' wget http://packages.ros.org/ros.key -O - | sudo apt-key add - sudo apt update sudo apt install python3-catkin-tools
-
Install
gmapping,teb_local_planner, andpointcloud-to-laserscan.sudo apt install ros-noetic-gmapping sudo apt install ros-noetic-teb-local-planner sudo apt install ros-noetic-pointcloud-to-laserscan
-
Install
costmap_converterstandalone node, to do this create a folder in your workspace, clone its repository.mkdir -p ~/Documents/dev/CostmapConverterWorkspace/src cd ~/Documents/dev/CostmapConverterWorkspace/src git clone https://github.com/rst-tu-dortmund/costmap_converter.git && cd ..
-
Compile and source the workspace, extending the
rosas sourced in your.bashrcfile.catkin build && source devel/setup.bash
Ros Noetic has a well known bug, where repeated TF messages flood the terminal if they are detected. For some reason this may happen, specifically in bigger projects with many third party nodes. Unfortunately, even being a well known problem, there is no out-of-the-box solution, and this might prevent you from visualize what is going on in your terminal. To solve this issue you can clone the geometry2 package, commenting the line of code responsible for this and building it yourself.
-
Create a workspace for the
tfpackages and clone the project.cd && mkdir -p ~/Documents/dev/Geometry2Workspace/src cd ~/Documents/dev/Geometry2Workspace/src git clone https://github.com/ros/geometry2.git
-
Open the file
tf2/src/buffer_core.cpp. -
Comment the line
279save and close the file. The line you must comment looks like the following.CONSOLE_BRIDGE_logWarn((error_string+" for frame %s (parent %s) at time %lf according to authority %s").c_str(), stripped.child_frame_id.c_str(), stripped.header.frame_id.c_str(), stripped.header.stamp.toSec(), authority.c_str());
-
Compile and source the workspace, extending the
costmap_converterpreviously sourced.cd ~/Documents/dev/Geometry2Workspace catkin build && source devel/setup.bash
-
Clone the repository.
mkdir -p ~/Documents/dev && cd ~/Documents/dev git clone https://github.com/multirobotplayground/ROS-Noetic-Multi-robot-Sandbox.git
-
Compile and source the workspace, extending the
geometry2previously sourced.cd ROS-Noetic-Multi-robot-Sandbox catkin build && source devel/setup.bash
Now your environment should be ready to run the simulations from this repository and also to help you starting your journey. Click here for the next steps.