A 12-DOF biped
you can print.

K2 is an open-source, 3D-printed bipedal robot built on twelve Feetech STS3215 serial-bus servos. A reinforcement-learning policy holds, marches, walks forward and backward, turns, and steps laterally. The same policy has been tested on the physical robot from a Raspberry Pi 5 and from a Seeed XIAO ESP32S3 running the network onboard.

Demonstrations

The robot, moving.

Capabilities

What the shipped policy actually does.

Hold tested

Learned standing hold. Releasing every control requests hold rather than latching the last motion.

March tested

Stepping in place at the policy's gait frequency, the entry point to every travelling gait.

Walk tested

Forward and backward, trained to ±0.05 m/s. Backward is a sign flip of the forward task.

Turn tested

Yaw on top of forward/backward travel, trained to ±0.30 rad/s.

Lateral tested

Side-stepping, trained to ±0.03 m/s, with leading-foot selection in the command profile.

Height & planted rotation not shipped

Body-height control and feet-planted rotation are not part of the released policy.

Acceleration is deliberate. Both the web and joystick paths keep the trained acceleration and jerk limits, so reaching maximum speed is gradual. Commands expire after 500 ms without a refresh, which requests a smooth stop rather than freezing the last command.

Interactive model

See which servo moves which joint.

The joint viewer loads K2's model in the browser and gives you a slider for each of the twelve joints. Every slider is labelled with the servo ID on the bus, its operational limit, and a plain-language description of what a positive command does to that leg.

The geometry is baked straight out of mjcf/k2_physics.xml — the model the policy actually trains on — and the limits from hardware/joint_limits.json, the ranges the robot actually runs. The browser's kinematics are checked against MuJoCo's own forward kinematics at build time, so what you drag is what the robot does.

K2 standing in its default stance

Build

Print eighteen parts, then populate them with servos.

Printed partQtySTL

Not yet a complete kit. There is no assembly guide, print-settings sheet, exploded view or wiring diagram in the repository yet, and no editable CAD (.f3d/.step) — only meshes. Treat these STLs as a working research release rather than a finished build package.

Bill of materials

ComponentQtyCost (USD)
Feetech STS3215 serial bus servo12$180
LSM6DS3 I²C IMU breakout1~$5
Waveshare serial bus servo driver (TTL UART)1~$10
12 V → 5 V DC/DC converter1~$3–4
12 V power supply1~$20
Wiringset~$6
Seeed XIAO ESP32S3 Sense or Raspberry Pi 51not included
Printed parts, fasteners, mechanical hardwaresetnot measured
Subtotal before controller, printing and shipping$224–225

These are the builder's estimates, not a complete retail BOM. A DFRobot listing checked on 8 September 2026 prices a 12 V ST3215 variant at $19.90, which raises the subtotal to about $283. Confirm the servo voltage and variant before ordering.

Wiring the ESP32-S3

PeripheralXIAO pin
LSM6DS3 SDAD4 / GPIO5
LSM6DS3 SCLD5 / GPIO6
Servo driver RXD6 / GPIO43 (ESP TX)
Servo driver TXD7 / GPIO44 (ESP RX)

Share ground. The Waveshare driver must be set to TTL, not USB. The servo UART runs at 1 Mbps. Full procedure in the ESP32-S3 README.

Software

Drive the digital twin without owning a robot.

The same controller code drives MuJoCo or the real servo chain — --bus is the only thing that changes. On a Linux desktop with a graphical session, no GPU training stack or physical hardware is needed:

git clone https://github.com/kapalikkhanal/K2.git && cd K2
python -m venv .venv && source .venv/bin/activate
pip install -r hardware/requirements-pi.txt

python keyboard.py --policy policies/last_policy.onnx

Focus the MuJoCo viewer to use the keys. --policy takes an ONNX file, not a training .pt checkpoint; omitting it selects the shipped policy.

±0.05 m/s

Trained forward / backward speed

±0.03 m/s

Trained lateral speed

±0.30 rad/s

Trained yaw rate

Policy network

50 observations → 256–128–64 → 12 actions, exported to ONNX. Channel 5 of the gait command is lateral velocity.

Onboard firmware

The C++ command profile mirrors the Python smooth_full_v1 profile, including deceleration, double-support stopping and lateral leading-foot selection.

Documentation

Everything is in the repository.

README

Hardware, BOM, every keyboard option and the simulator quick start.

robot.md

The robot's design and conventions in depth.

Training guide

The two-stage mjlab + PPO pipeline and ONNX export.

Transforms

Frames, joint conventions and the CAD-to-simulation path.

ESP32-S3

Wiring, phone control, Xbox BLE pairing and native verification.

Release audit

An honest list of what is missing before this is a reproducible kit.

Status

What is proven, and what is not.

Demonstrated

Maintainer-tested physical operation on both controllers, with the shipped policy, on the original robot. Launcher regression tests pass, and the ESP32 build is verified against the Python implementation on the host.

Not established

Rough-terrain reliability, endurance, and performance across independently built robots are not quantified. Host verification is not a physical test, and one robot is not a sample.

Safety. The ESP32 web interface runs an access point with a documented default password and unauthenticated local control endpoints. Use it on a trusted local network, change the password for public demonstrations, and never expose it to the internet. Support the robot before enabling torque.