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.
The robot, moving.
What the shipped policy actually does.
Learned standing hold. Releasing every control requests hold rather than latching the last motion.
Stepping in place at the policy's gait frequency, the entry point to every travelling gait.
Forward and backward, trained to ±0.05 m/s. Backward is a sign flip of the forward task.
Yaw on top of forward/backward travel, trained to ±0.30 rad/s.
Side-stepping, trained to ±0.03 m/s, with leading-foot selection in the command profile.
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.
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.
Print eighteen parts, then populate them with servos.
| Printed part | Qty | STL |
|---|
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.
| Component | Qty | Cost (USD) |
|---|---|---|
| Feetech STS3215 serial bus servo | 12 | $180 |
| LSM6DS3 I²C IMU breakout | 1 | ~$5 |
| Waveshare serial bus servo driver (TTL UART) | 1 | ~$10 |
| 12 V ā 5 V DC/DC converter | 1 | ~$3ā4 |
| 12 V power supply | 1 | ~$20 |
| Wiring | set | ~$6 |
| Seeed XIAO ESP32S3 Sense or Raspberry Pi 5 | 1 | not included |
| Printed parts, fasteners, mechanical hardware | set | not 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.
| Peripheral | XIAO pin |
|---|---|
| LSM6DS3 SDA | D4 / GPIO5 |
| LSM6DS3 SCL | D5 / GPIO6 |
| Servo driver RX | D6 / GPIO43 (ESP TX) |
| Servo driver TX | D7 / 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.
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.
Trained forward / backward speed
Trained lateral speed
Trained yaw rate
50 observations ā 256ā128ā64 ā 12 actions, exported to ONNX. Channel 5 of the gait command is lateral velocity.
The C++ command profile mirrors the Python smooth_full_v1 profile, including deceleration, double-support stopping and lateral leading-foot selection.
Everything is in the repository.
Hardware, BOM, every keyboard option and the simulator quick start.
The robot's design and conventions in depth.
The two-stage mjlab + PPO pipeline and ONNX export.
Frames, joint conventions and the CAD-to-simulation path.
Wiring, phone control, Xbox BLE pairing and native verification.
An honest list of what is missing before this is a reproducible kit.
What is proven, and what is not.
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.
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.