PROJECT 04 / ROBOTICS / DIGITAL DOUBLE

Arm
Lab.

A digital double of the SO101 desktop robot arm, built in WebXR from the robot's own part files and joint table. Around it, the information a person would want while using the arm to pick something up: every joint's angle and how close it is to its limit, the gripper's opening in centimetres, and the distance from the gripper to a target you can place anywhere. Joints are selected by pointing a controller beam at them and turned with the thumbstick, or dragged on a teach pendant panel beside the robot.

How the scene works

  1. The arm's whole state is six joint angles. Keys, thumbsticks and the beam only ever change one of those numbers.
  2. Each joint is a scene node hanging from its parent; its matrix is the joint's fixed placement plus its angle. The engine multiplies the chain and places every part.
  3. The annotations read back from that: angles and limits from the six numbers, positions and distances from the multiplied matrices, converted to the real robot's centimetres.

INTERACTIVE STUDY

Interactive study

01—08How the robot arm is built, in eight levels

A step-by-step course that runs the scene's own code in the browser: six numbers, frames and matrices, the parts, two coordinate systems, the annotations, driving the arm with a controller, and a teach pendant panel drawn on a 2D canvas.

01A robot is six numbers↗

Six motors, six angles, six ranges. The joint table from the robot's URDF file, and why everything else is derived from these numbers.

02Frames and the chain↗

A 4×4 matrix as a joint's identity card; parent × child down the chain; where the engine's getGlobalMatrix comes from.

03The parts↗

A real STL file opened with the scene's own loader: triangles, normals, and how a mesh hangs on its link with xyz and rpy.

04Robot coordinates, VR coordinates↗

z up versus y up, metres versus a doubled model, the base matrix that translates between them, and the one trap it sets.

05Annotation: angles and limits↗

The label beside every joint, the limit fraction behind its colour, and the gripper's label in centimetres of jaw opening.

06Annotation: a target and its distance↗

The tool centre point, a line to a target, real centimetres from a doubled model, and what GRAB means.

07Driving it↗

Keys, thumbsticks and a beam all do the same thing: write one of the six numbers. Hit-testing joint rings and dragging the target along the beam.

08The teach pendant↗

A 2D canvas textured onto a square: a dial and a slider for every motor, drawn with the course's G2 library, and how a beam hit becomes a drag.

The code on these pages is a snapshot of the scene, copied into /source/. The robot's tables come from the course's SO101.js, which took them from the SO101's URDF file.