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.
make drive keysIn this lesson
- Open Inspect, then tf.
- Press ready, and read the translation. About (0.279, 0, 0.095) m.
- Predict which way
ygoes, then swingshoulder_panpositive until the translation'syis below -0.1 m. - Press
f(or Frames) to draw each joint's own frame. In Foxglove these come from/tf, not from a framebuffer.
Joints · SO-101 follower
1–5 joint · , . jog · [ ] jaw · - + step · h home · f frames
the keys of make drive
The buttons do what the keys do: hold one to repeat.
Limits from the description; speed capped at 1.7434 rad/s, the servo's datasheet derated. Poses from the profile.
Inspector
Code
The repository's own code behind what you do here appears once you move the arm.
Do it
With
make playrunning, use the browser view first.Expect: Usable, possibly laggy.
Open the same desktop in the native viewer. The password is
threevn.make vncExpect: The same RViz, noticeably smoother.
Optional, if you are willing to install Foxglove: restart the simulation without RViz, and follow what
make foxgloveprints.make stop make play RVIZ=0 make foxgloveExpect: The arm drawn on your own machine, from messages, with no framebuffer at all.
A fourth way, for any robot that is already running: RViz attached to it, rather than started with it. With
make simormake mockrunning in one terminal, start it in another.make watchExpect: The same picture at port 8106, whichever backend is publishing.
make watchstarts no robot of its own, so it is one view across the mock, Gazebo and, later, the real servos.
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.