Theme
Stage 3 · lesson 2 of 7 · 25 min

Three ways to watch, and what crosses the wire

You will: Pick the right view of a remote robot by understanding what each one transmits.

Builds on A simulator that runs in CI.

Also touches on Security.

There is no GPU in the container and no X server on macOS, so every view of the robot is a remote view. They are not equivalent, and the difference is what crosses the boundary:

open with what is transmitted
browser (noVNC) port 8106 a framebuffer, decoded in JavaScript
native VNC make vnc the same framebuffer, decoded natively
Foxglove make foxglove messages only — your machine draws the robot

The browser is the right first look, because it needs nothing installed. It is also the slowest: RViz renders in software inside the container, the frame is encoded, shipped, and decoded in a browser tab. Three layers of CPU rasterisation stacked on each other.

Foxglove changes the question entirely. It subscribes to the robot's topics over a WebSocket and draws the robot on your own GPU from its description and its transforms. No pixels cross the wire, so the view is as smooth as your machine, however slow the simulation is.

Two lessons came out of setting these up, and both generalise.

Probe the protocol, not the socket. macOS's built-in VNC client kept reporting "Connection failed". The first diagnosis read an established TCP connection as a working one. Probing the actual handshake showed the server offering only one authentication type — "None" — which native clients refuse. The fix was a second VNC server with a password. The password protects nothing (the port is bound to 127.0.0.1) and exists only because clients will not finish a handshake without one.

Version mismatches can fail silently. The bridge here speaks a newer WebSocket subprotocol. An older Foxglove asks for the old one, gets HTTP 400, and reports only a failed connection.

In the simulation

What Foxglove receives instead of pixels: transforms. The inspector's tf view prints the one transform from base_link to the gripper, a handful of numbers that are enough to draw it on your own machine.

Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.

The SO-101 loads as you reach it.

In this lesson

  1. Open Inspect, then tf.
  2. Press ready, and read the translation. About (0.279, 0, 0.095) m.
  3. Predict which way y goes, then swing shoulder_pan positive until the translation's y is below -0.1 m.
  4. Press f (or Frames) to draw each joint's own frame. In Foxglove these come from /tf, not from a framebuffer.

Do it

  1. With make play running, use the browser view first.

    Expect: Usable, possibly laggy.

  2. Open the same desktop in the native viewer. The password is threevn.

    make vnc
    

    Expect: The same RViz, noticeably smoother.

  3. Optional, if you are willing to install Foxglove: restart the simulation without RViz, and follow what make foxglove prints.

    make stop
    make play RVIZ=0
    make foxglove
    

    Expect: The arm drawn on your own machine, from messages, with no framebuffer at all.

  4. A fourth way, for any robot that is already running: RViz attached to it, rather than started with it. With make sim or make mock running in one terminal, start it in another.

    make watch
    

    Expect: The same picture at port 8106, whichever backend is publishing. make watch starts no robot of its own, so it is one view across the mock, Gazebo and, later, the real servos.

You will know it worked when: You have viewed the running robot at least two ways, and can say what each one sends over the wire.

When it goes wrong

macOS Screen Sharing says "Connection failed".

Why: It reached the password-less server, which offers only the "None" security type that native clients refuse.

Fix: Use make vnc, which opens port 5906 — the server that asks for a password.

Your browser asks "Open Screen Sharing?" when you paste a vnc:// address.

Why: The browser's ordinary hand-off for a non-web URL scheme. Nothing is asking for access to your screen; the VNC server is inside the container and can only see its own virtual display.

Fix: Allow it, or use make vnc, which skips the browser.

Foxglove will not connect, and the launch log says "Address already in use" on 8765.

Why: A bridge from a previous run is still holding the port.

Fix: make stop && make play.

Foxglove still will not connect, with no error you can see.

Why: An older Foxglove requesting the old WebSocket subprotocol, rejected with HTTP 400.

Fix: Update Foxglove before debugging anything else.

Terms

Framebuffer streaming
Sending rendered pixels to a viewer, as VNC does. Cost grows with screen size and frame rate, and rendering happens remotely.
Message-level visualisation
Sending the robot's data rather than its pixels, and rendering locally — Foxglove's approach.

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

The simulation is slow either way. Why is Foxglove smooth when the browser view lags?

Foxglove renders on your own GPU from messages, so the view's frame rate is independent of the container's CPU-bound rendering. The browser view can be no smoother than frames rendered in software and shipped as pixels.

Why is it safe for one VNC server to run with no password at all?

It listens on localhost inside the container and is only reachable through websockify for the browser. The published port goes to the other server, bound to 127.0.0.1 on the host.

Stretch

Shrink the virtual desktop with THREEVN_SCREEN=1280x720 make down up, relaunch, and compare the browser view. Estimate how much less data each frame carries, and whether the improvement you see is about that much.

Going deeper