Camera and windows #
RuntimeError: Failed to open camera at index 0
#
- Something else holds the webcam — the standalone script, a previous container, a browser tab.
Run
docker compose downand close video apps. A camera opens in one process at a time. - The camera is another node.
ls /dev/video*, then map that device and setCAMERA_INDEX(many webcams expose/dev/video0for frames and/dev/video1for metadata — use the first). - The device isn’t mapped. Check with
docker compose config | grep video.
Windows don’t open — cannot connect to X server, could not connect to display
#
- Run
./setup_host.sh(it runsxhost +local:root). The permission resets when you log out. - Make sure
echo $DISPLAYon the host prints:0, or exportDISPLAYbeforedocker compose up. - On Wayland, confirm XWayland is running:
ls /tmp/.X11-unix/should listX0.
Black, blank or garbled OpenCV window #
QT_X11_NO_MITSHM=1 must reach the container. It’s in the shared Compose environment — if a service
defines its own environment:, it must merge the shared anchor with <<: *ros-env rather than
replace it (Part 16).
The MuJoCo viewer crawls #
The GPU isn’t reaching the container and Mesa fell back to software rendering. Check /dev/dri is
mapped; on NVIDIA use the NVIDIA Container Toolkit
(Part 18).
ROS 2 communication #
Landmarks are drawn, but the twin doesn’t move #
docker compose exec mujoco_twin bash -c 'source /opt/ros/jazzy/setup.bash && ros2 topic hz /hand/target_flexions'- No rate is printed — discovery failed. Both services need the same
ROS_DOMAIN_IDandnetwork_mode: host. - A rate is printed — messages arrive; inspect values with
ros2 topic echo. Flexions under 0.5 keep a finger open by design (Part 11); if your fist doesn’t reach ~0.6, recalibrate (Part 9).
Another computer can’t see /hand/target_flexions
#
Same ROS_DOMAIN_ID=42, same subnet, host firewall open for UDP 17900–17930, and no Wi-Fi
client isolation or multicast filtering. Details in
Part 17.
Python environment #
ModuleNotFoundError: No module named 'mujoco' (or mediapipe) in a working venv
#
A sourced ROS installation prepends its own Python paths through PYTHONPATH, shadowing the venv.
Run with env -u PYTHONPATH venv/bin/python ….
AttributeError: module 'mediapipe' has no attribute 'solutions'
#
You installed a MediaPipe release without the legacy API this project uses. Pin
mediapipe==0.10.14 (container, Python 3.12) or 0.10.11 (standalone, Python 3.10).
MuJoCo model #
Nan, Inf or huge value in QACC at DOF … The simulation is unstable.
#
Almost always a re-exported robot.xml that lost the joint defaults — damping, armature,
frictionloss. Phalanges here weigh 1.8–5.4 g; without them, a 50 N tendon makes the integrator
explode. Re-apply them (Part 13).
Error: site 'palm_in_flex_index' not found in wrap 1
#
A CAD reference frame was renamed or removed, and tendons.xml threads tendons through sites by
name. Restore the name in Onshape or update tendons.xml.
A finger moves the wrong way — or the wrong finger moves #
An actuator was renamed. mj_name2id returned -1, and data.ctrl[-1] wrote to the last
actuator instead of failing. Check the names are pull_{thumb,index,middle,ring,pinky}.
Harmless log noise #
| Message | From | Action |
|---|---|---|
QFontDatabase: Cannot find font directory …/cv2/qt/fonts |
OpenCV’s bundled Qt | ignore |
SymbolDatabase.GetPrototype() is deprecated |
protobuf inside MediaPipe 0.10.14 | ignore |
Created TensorFlow Lite XNNPACK delegate for CPU |
MediaPipe | ignore |
GLFWError: (65548) Wayland: The platform does not provide the window position |
GLFW on a native Wayland host | ignore |
Failed to load plugin 'libdecor-gtk.so' |
GLFW decorations on Wayland | ignore |