Skip to content

Show RViz on the Mac through a virtual display and noVNC - #34

Merged
maxconwa merged 2 commits into
mainfrom
feat/mac-rviz
Nov 19, 2026
Merged

maxconwa merged 2 commits into
mainfrom
feat/mac-rviz

Conversation

@maxconwa

Copy link
Copy Markdown
Contributor

Show RViz on the Mac

The Mac bringups (h12_mac_sim, g1_mac_sim) ran without RViz. A Mac has no X server that a container can draw OpenGL through: XQuartz gives no OpenGL on Apple Silicon. This PR adds a virtual display to the Mac golem_ros image and turns RViz on by default.

How it works

  • Display: docker/mac/vnc_display.sh is the Mac golem_ros image's entrypoint. When the container starts, it starts Xvfb on :99 with Mesa's software OpenGL, x11vnc on port 5901, and noVNC on port 6080, then runs the container's command.
  • Wiring: docker-compose.mac.yml sets DISPLAY=:99, so RViz from the bringup or from any docker exec shell draws there.
  • Viewing: open http://localhost:6080/vnc.html in a browser, or vnc://localhost:5901 in Screen Sharing. OrbStack and Docker Desktop forward the VM's host-network ports to the Mac.
  • Defaults: h12_mac_sim and g1_mac_sim default use_rviz to true, and docker_stack.sh turns RViz on by default on the Mac.
  • Settings:
    • GOLEM_VNC=0 starts no display.
    • GOLEM_VNC_SIZE sets the screen size (default 1280x800).
    • LP_NUM_THREADS (default 1) is the number of software-rendering threads.

Measured (H1-2 Mac stack, MacBook Air M3, kitchen 9/9/42)

Software OpenGL threads RTF Worst /lowstate gap Nav2 goal ahead / back to start
all cores (Mesa default) 0.78-0.83 68 ms succeeded / succeeded
1 (this PR's default) 0.98-1.00 18 ms succeeded / succeeded

In both runs RViz reported OpenGL 4.5, noVNC answered from the Mac (HTTP 200), and there were no faults or estop latches.

x86

Unchanged. Only the Mac ros image, the Mac compose overlay, the Mac bringups, and the Mac branch of docker_stack.sh change.

Testing

  • golem_bringup tests: 90 pass. test_flake8 still fails on the two long lines in g1_sim and g1_real_robot that are already on main.
  • The Mac wrapper tests in tests/docker/test_workflows.py and tests/docker/test_source_pins.py pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_015EG7pDNJLWR31eQmyKaWhr

maxconwa and others added 2 commits November 19, 2026 14:57
A Mac has no X server a container can render OpenGL through (XQuartz gives
none on Apple Silicon), so the Mac golem_ros image starts Xvfb with Mesa's
software OpenGL at container start (docker/mac/vnc_display.sh, its
entrypoint), shown over x11vnc on port 5901 and noVNC on port 6080:
http://localhost:6080/vnc.html. docker-compose.mac.yml sets DISPLAY=:99 for
the ros service; GOLEM_VNC=0 starts no display.

h12_mac_sim and g1_mac_sim default use_rviz to true, and docker_stack.sh
starts RViz on the Mac by default. The x86 images and path are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EG7pDNJLWR31eQmyKaWhr
Mesa's software OpenGL on every core took about 1.5 cores for RViz and the
H1-2 stack fell to 0.78-0.83x; on one thread (LP_NUM_THREADS=1, the Mac
overlay's default) it holds 0.98-1.00x, both Nav2 goals reached. The virtual
display defaults to 1280x800 (GOLEM_VNC_SIZE). The Mac bringup tests compare
against the sim bringups with RViz on, which the Mac bringups now start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015EG7pDNJLWR31eQmyKaWhr
@maxconwa
maxconwa merged commit 53569d2 into main Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant