-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_robotics_3d.sh
More file actions
executable file
·41 lines (35 loc) · 1.23 KB
/
run_robotics_3d.sh
File metadata and controls
executable file
·41 lines (35 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Helper script to run the 3D robotics simulation with proper OpenGL setup
echo "=== Robotics Lab 3D - OpenGL Simulation ==="
echo ""
# Check if DISPLAY is set
if [ -z "$DISPLAY" ]; then
echo "⚠ No DISPLAY environment variable found!"
echo ""
echo "Attempting to use virtual display (Xvfb)..."
# Check if Xvfb is installed
if command -v Xvfb &> /dev/null; then
echo "✓ Xvfb found, starting virtual display..."
xvfb-run -s "-screen 0 1920x1080x24" python3 robotics_lab_3d.py
else
echo "✗ Xvfb not installed!"
echo ""
echo "Please install Xvfb:"
echo " sudo apt-get update"
echo " sudo apt-get install xvfb"
echo ""
echo "Or run from a system with a display."
exit 1
fi
else
echo "✓ Display found: $DISPLAY"
echo ""
# Set OpenGL environment variables for better compatibility
export SDL_VIDEO_X11_FORCE_EGL=0
export PYOPENGL_PLATFORM=glx
# Optional: Use software rendering if hardware acceleration fails
# Uncomment the line below if you have issues
# export LIBGL_ALWAYS_SOFTWARE=1
echo "Starting simulation..."
python3 robotics_lab_3d.py
fi