Docker hacks for quick and easy access to ROS2 (foxy, humble) and ROS1 (melodic, noetic) along with their GUI applications like Gazebo and rViz without the need for a local installation
dockerLinux(not necessarily Debian-based)dialog(optionally for interactive terminal UI)
- Make sure your system satisfies all the requirements. The installer script tries to remain distro-agnostic, thus does not install anything.
- Run the
installer.bashscript with a single argument with the rosez version you need to install. e.g../installer.bash ros2ez. You can also run it interactively with no arguments. For ros-ez versions <1.7.0, you must use one of theros_*installer.bashscripts. There are multiple, one for each supported ROS distribution. - Run
. ~/.bashrcor open a new terminal. - Run
ros2ezfor ROS2 Humble,ros2ezffor ROS2 Foxy orrosezfor ROS1 Noetic androsezmfor ROS1 Melodic followed by the command you want to run else. If no command is provided you will be thrown in a shell inside the image (useful when autocomplete is required).
ros2ez ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=racer_01/cmd_vel
or
rosez rosrun rviz rviz
NVIDIAusers should install the nvidia-container-toolkit that massively boosts performance inside docker containers.- If you encounter errors regarding your graphics card while trying to run the
rosezorros2ezscript, try adding thefiorforce-integratedflag, which will force usage of the integrated graphics card of your computer. This is, of course, not optimal, so update your drivers and try running the script again. Make sure that the flag is the first argument of your command. If this fails too, open an issue. For instance, the examples above can be executed with the integrated graphics card by runningros2ez fi ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=racer_01/cmd_velandrosez fi rosrun rviz rvizrespectively. - You can change or add default workspaces by editing the
includes/ros*_ws.txtfile. One directory per line.
TODO
- EndeavourOS
- Fedora 35, 36, 39, 40, 41
- Ubuntu 22.04
- MX Linux 19.1
- Windows through WSL2 (experimental)
- X11
- Wayland
- Migrating from
v1.0.0to newer versions will most probably introduce some permission issues, since newer versions try to stay inside the user's permissions instead of root. A chown of your workspace(s) to your user should fix the problem. - [For versions >=
v1.1.0] User configurable and system files have been separated, so you (most probably) should not mess with theinternalsfolder. - [For versions <=
v1.1.0] Running multipleros*ezcommands concurrently (in separate terminals) can introduce race conditions, especially in workspace building (colcon (ROS2) or catkin (ROS1)). Refrain from runningros*ezcommands concurrently, but wait for build commands to finish. - [For versions >=
v1.2.0] The new concurrency handling system allows for execution of multipleros*ezcommands concurrently (in separate terminals). The system uses lock files and tries to handle them effectively to avoid dangling ones. In the (rare?) case of a dangling lock file (essentially eternally waiting for a lock file to unlock), you should do one of the following solutions: The first one is to reboot your machine. The next time you boot up, your lock file will be older than your system's uptime, and be automatically removed. The second one is to use theclear-locksorclflag duringros*ezexecution. Keep in mind that if you generally use theforce-integratedorfiflag, you willneed it here too. For instance, the next commands will remove ALL locks and then run the specified commandros2ez fi cl ros2 run teleop_twist_keyboard teleop_twist_keyboard cmd_vel:=racer_01/cmd_velor for ros1rosez cl fi rosrun rviz rviz. Note that the order of the flags is not important, but have to be placed before the required ros command. - [For versions >=
v1.2.1] Users are now able to use their local git configuration (ssh keys etc) and bloom release, from within the ros*ez environment. - [For versions >=
v1.2.2] There was a problem that was introduced inv1.2.1regarding volumes and permissions for user configuration files in ssh, git and bloom. It is now fixed. - [For versions >=
v1.2.3] The installer script now checks if the user is in the docker group, and if not adds them and prompts for reboot at the end of the installation. - [For versions >=
v1.3.0] A ROS Melodic version is now available (with therosezmcommand) and a much more robust locking mechanism is now in effect. If you experienced frequent lockouts or race conditions, this version should be more stable. - [For versions >=
v1.4.0] All supported ROS versions (melodic/noetic/humble) now work on a completely persistent filesystem to save apt, library and other installations + all other user-defined changes on the container. Additionally, this version also supports audio, enabling users to play sounds through therosezcontainers. - [For versions >=
v1.5.0] Thescorskip-compilationflag is now supported, which completely bypasses rosdep and catkin/colcon builds for faster startup. - [For versions >=
v1.6.0] A ROS2 Foxy version is now available (with theros2ezfcommand). Its image comes with built-inros1_bridgesupport for ez ROS1-ROS2 integration. - [For versions >=
v1.6.1] A deletion script has been included inside theinternal/deeper/folder. It takes the version-to-delete as an argument. For example,bash delete_version.bash ros2ezfdeletes the Foxy version for rosez. - [For versions >=
v1.7.0] A new script to easily create systemd services was added. It can be used interactively usingdialogor non-interactively by passing it 9 arguments. Running thecreate_rosez_systemd_service.bashwith less than 9 args (but more than 0) will trigger a help message. Additionally the installation scripts have been merged into one,installer.bash. You can now use it interactively, or pass a single argument with the rosez version you need to install. e.g../installer.bash ros2ez - [For versions >=
v2.0.0] Docker devices like sound and graphics are now manually handled. This version is NOT the same as the previous ones. This is a pretty substantial change, thus getting a major release. Externally nothing should change for the end user, but internally a lot has changed. OSRF'srockeris no longer utilized, making docker handling more versatile (but also fragile). - [For versions >=
v2.0.1] Sound integration is now working normally. The bug was introduced inv2.0.0. - [For versions >=
v2.0.2] Simplification of the systemd service generation. - [For versions >=
v2.1.0] First attempt to use (runtime) host folders instead of saving them on volumes (for /mnt, /run, /sys). - [For versions >=
v2.2.0] Fixed a bug that surfaced on newer kernels running old distros regarding soft and hard nofile (ulimit). - [For versions >=
v2.3.0]:- The
rosez*containers are now handled in a more optimised way. This is achieved by running the container once and then using exec to access a shell. This should solve (most of?) the conflicts in packages install/not found on different shells. - Introduced a the
kill-containerorkcflag to forcefully kill therosez*container. - Now sharing
/mediabetween host and container. - Fixed a bug that occured when the output of the build command was too long.
- Accidentally, a new bug for ROS1 was introduced in this release. It is fixed in
v2.5.0.
- The
- [For versions >=
v2.4.0] Added support for ROS2 Jazzy. NOTE: Theros2ezcommand has now been disabled, since currently two ROS2 LTS versions are supported. ROS2 Humble can now been used with theros2ezhcommand, following the typicalrosez*/ros2ez*scheme. WARNING: This versions breaks humble installations. In order to migrate, your best bet is to renameros2ez-volume*volumes to their equivalentros2ezh-volume*. Accidentally, a new bug for ROS1 was introduced in this release. It is fixed inv2.5.0. - [For versions >=
v2.5.0] Added rust support for all ROS distributions. Also, fixed bug #79 that was introduced inv2.3.0. - [For versions >=
v2.5.1] Now deleting all problematic locks instead of just the oldest and fixed #85 (exec locks daemon bug). - [For versions >=
v2.5.2] Fixed a bug that was introduced inv2.4.0whererosezandrosezmcould get mixed up when used simultaneously (issue #88). - [For versions >=
v2.5.3] Added the ability to distinguish betweencatkin_makeandcatkin buildworkspaces in ROS1. Also, now using theRelWithDebInfoflag for all build commands.
