diff --git a/docker/docker_run.sh b/docker/docker_run.sh index 06a4975..974cecb 100755 --- a/docker/docker_run.sh +++ b/docker/docker_run.sh @@ -5,6 +5,7 @@ SCRIPTPATH=$(dirname "$SCRIPT") NO_GUI=false NVIDIA=false TMUX_LAYOUT=false +WAYLAND=false while [[ $# -gt 0 ]]; do case $1 in @@ -20,9 +21,13 @@ while [[ $# -gt 0 ]]; do TMUX_LAYOUT=true shift ;; + --wayland) + WAYLAND=true + shift + ;; *) echo "Unknown argument: $1" - echo "Usage: $0 [--no-gui] [--nvidia] [--tmux]" + echo "Usage: $0 [--no-gui] [--nvidia] [--tmux] [--wayland]" exit 1 ;; esac @@ -49,6 +54,12 @@ if [ "$NO_GUI" = false ]; then DOCKER_CMD="$DOCKER_CMD -v /tmp/.X11-unix:/tmp/.X11-unix:ro" DOCKER_CMD="$DOCKER_CMD -e DISPLAY=$DISPLAY" + # WAYLAND support through X11 Compatibility Layer + # We need it so QT can talk to the display for Gazebo + if [ $WAYLAND = true ]; then + DOCKER_CMD="$DOCKER_CMD -e QT_QPA_PLATFORM=xcb" + fi + # Always forward /dev/dri so Mesa has a working DRM path. The nvidia # runtime by itself only provides NVIDIA's GL stack; it does not expose # the integrated GPU. Without /dev/dri the iris/i915 Mesa driver fails diff --git a/docs/setup.md b/docs/setup.md index 0cbd066..b825ae8 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -95,6 +95,7 @@ You can use also use these options: This option also forwards port `18570` to allow external (Host) QGC connection. - `--nvidia` to run the container with the `nvidia` runtime (it requires the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) installed and registered with Docker on the host; see `nvidia-ctk runtime configure --runtime=docker` followed by `sudo systemctl restart docker`). - `--tmux` to drop straight into the preconfigured workshop `tmux` layout (see [Option C](simulation.md#option-c--the-preconfigured-workshop-layout-workshop-tmux)) instead of a plain shell. Detaching the session (`Ctrl+b d`) leaves you in a normal shell with the simulation still running; reattach with `workshop-tmux`. +- `--wayland` to use Wayland's X11 Compatibility layer so Gazebo can run on machines using Wayland as Window Manager, make sure to run `xhost +local:docker` on your host terminal first. When using this method you can attach new shell to your container by running