Gazebo Script Fixes

This commit is contained in:
2026-02-09 04:00:11 +00:00
parent 21b298faa2
commit e70d4a8fcd
3 changed files with 159 additions and 65 deletions

34
wsl_env.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
# WSL Environment Setup for UAV-UGV Simulation
# This file is sourced automatically when running the simulation in WSL
# DISPLAY configuration
if [ -d "/mnt/wslg" ]; then
# WSLg (Windows 11) - native Wayland/X support
export DISPLAY=:0
export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}"
else
# X server (Windows 10) - connect to VcXsrv or similar
export DISPLAY=$(cat /etc/resolv.conf 2>/dev/null | grep nameserver | awk '{print $2}'):0
fi
# OpenGL settings for better compatibility
export LIBGL_ALWAYS_INDIRECT=0
# Mesa driver overrides (helps with version requirements)
export MESA_GL_VERSION_OVERRIDE=3.3
export MESA_GLSL_VERSION_OVERRIDE=330
# Gazebo specific settings
export OGRE_RTT_MODE=Copy
# Source Gazebo setup for proper resource paths
if [ -f /usr/share/gazebo/setup.bash ]; then
source /usr/share/gazebo/setup.bash
elif [ -f /usr/share/gazebo-11/setup.bash ]; then
source /usr/share/gazebo-11/setup.bash
fi
# Uncomment the following line to force software rendering
# This is more stable but slower - use if you see rendering errors
# export LIBGL_ALWAYS_SOFTWARE=1