Project 03 / kinematics + FSM

Robot FK

URDF becomes a live transform tree: load a robot, drive its joints with a finite-state choreography, and draw every link as an external client.

C++URDFForward kinematicsFSM choreography

Robot + choreography

This page documents my custom four-legged jumping robot with a movable tail performing a repeating FSM choreography: home, scan left, scan right, then return home. The FSM publishes target joint states; the runtime computes each link's world transform from the URDF tree.

How the viewer draws it

The custom viewer is an external client. It subscribes to /xform_world, fetches geometry, and reads each 4×4 matrix in column-major order—the layout that three.js Matrix4.fromArray expects.

  1. Poll transform snapshots.
  2. Transform local vertices into world coordinates.
  3. Project to canvas and draw shapes, axes, labels, and parent-child edges.

Demo recipe

make demo · load your jumping robot URDF + your FSM choreography · open viewer → /xform_world · record: center → left → right → center

The standalone viewer is at p3/viewer/index.html; it keeps rendering outside the runtime.

FSM choreography

My custom state machine controls a four-legged jumping robot with a movable tail. It has three states: home, where all joints return to neutral; scan_left, where the legs and tail turn left; and scan_right, where the legs and tail move in the opposite direction. The FSM transitions from home to scan_left, then scan_right, and finally back to home, continuously repeating the cycle. Each state defines target joint positions, and the choreography publisher sends those positions to the runtime through /joint_states.

General constant-motion demo

FSM choreography demo

← Back to portfolio