How rhoban/microban works
Purpose and deliverables
Microban is an open hardware/software platform for a ~30 cm, 19-DOF humanoid built around Dynamixel XL330 servos, a Raspberry Pi Zero 2W, and a Robot Hat. The repository combines printable mechanical design, assembly/deployment documentation, robot-control software, and simulation assets.
• Printable production models: cad/stl/, cad/step/
• Build, operation, and deployment procedures: docs/assembly.md, docs/deployment.md, docs/usage.md
Runtime entry points
The physical-robot application starts in src/main.py; its orchestration is divided among src/controller.py, src/robot_controller.py, and src/scheduler.py. A separate gamepad process is provided by src/gamepad_daemon.py and deployable as a system service through systemd/microban-gamepad.service.
Simulation has distinct entry points in src/sim/sim_main.py and src/sim/viewer_main.py.
Input-to-command boundary
Operator input is abstracted behind the input package, allowing keyboard and gamepad implementations to feed the same control layer.
• Input contract and implementations: src/input/input_source.py, src/input/keyboard_input.py, src/input/gamepad_input.py
• Gamepad service boundary: src/gamepad_daemon.py, systemd/microban-gamepad.service
The input layer should remain independent of servo transport and individual motions; it expresses user intent for the controller/scheduler.
Motion and behavior layer
Reusable robot actions are organized as move implementations, including head rotation, squatting, and walking. The walking stack includes a packaged ONNX model, making learned inference a material runtime dependency/data artifact.
• Move abstraction and behaviors: src/moves/move.py, src/moves/walk.py, src/moves/squat.py
• Learned walking asset: src/agents/walk.onnx
Control flow is expected to be: input event → controller/scheduler selection or update of a move → joint-level robot command. Stop handling is explicitly separated in src/stop.py.
Hardware-control and sensing boundary
Physical actuation is isolated in the robot controller path, while IMU and voltage modules provide hardware observations. This is the principal boundary between high-level behavior and the Raspberry Pi/Robot Hat/Dynamixel-connected robot.
• Hardware command path: src/robot_controller.py, src/controller.py
• IMU acquisition/interface: src/imu.py, src/imu_reader.py
• Power monitoring: src/voltage.py
• Shared robot constants: src/constants.py
The observer component (src/observer.py) is the likely aggregation point for state/feedback used by control behavior.
Simulation and model boundary
MuJoCo-facing adapters mirror portions of the physical control and input paths, enabling behaviors to run against a simulated robot rather than hardware. The canonical simulation geometry/kinematics are represented in MJCF, with a parallel URDF model.
• Simulation adapters: src/sim/mujoco_controller.py, src/sim/mujoco_input.py, src/sim/placo_controller.py
• MuJoCo model and scene: src/model/mjcf/robot.xml, src/model/mjcf/scene.xml
• Alternate robot description: src/model/urdf/robot.urdf
This separation permits controller and move logic to be exercised with simulated interfaces, while model assets remain distinct from printable manufacturing CAD.
Mechanical design and deployment infrastructure
Manufacturing files are STEP/STL assets; MJCF assets are simulation-specific representations and should not be conflated with print artifacts.
• Manufacturing design: cad/step/, cad/stl/
• Simulation mesh assets: src/model/mjcf/assets/
• Raspberry Pi setup and SD configuration: docs/dev/setup_rasp.md, docs/dev/clone_sd.md, docs/dev/config.txt
• Service installation: systemd/install-gamepad-daemon.sh
Main entry points: controller.py Control orchestration · move.py Robot moves · mujoco_controller.py MuJoCo control adapters · scheduler.py Move scheduler
Components 19
Physical robot runtime
- Robot application
src/main.py - Operator input · Keyboard and gamepad implementations express control intent.
src/input/input_source.py - Gamepad daemon
src/gamepad_daemon.py - Control orchestration
src/controller.py - Move scheduler
src/scheduler.py - Robot moves · Reusable walking and squat actions implement the move abstraction.
src/moves/move.py - Stop handling
src/stop.py - Robot controller · Translates joint commands for the Robot Hat and Dynamixel robot.
src/robot_controller.py - Robot observer
src/observer.py - IMU and power sensing
src/imu.py - Physical humanoid
Simulation
- Simulation runner
src/sim/sim_main.py - MuJoCo control adapters · Mirrors control and input paths for simulated execution.
src/sim/mujoco_controller.py - MuJoCo robot scene
src/model/mjcf/scene.xml - Alternate robot model
src/model/urdf/robot.urdf
Assets and deployment
- Gamepad system service
systemd/microban-gamepad.service - Walking policy
src/agents/walk.onnx - Printable mechanical design
- Build and deployment docs · Assembly, operation, Pi setup, and service installation instructions.
docs/assembly.md
Connections 20
- Robot application → Operator input: reads intent
- Robot application → Control orchestration: starts
- Control orchestration → Move scheduler: selects and updates moves
- Move scheduler → Robot moves: runs
- Robot moves → Walking policy: uses for walking
- Robot moves → Robot controller: joint commands
- Stop handling → Move scheduler: stops active move
- Control orchestration → Robot controller: coordinates commands
- Robot controller → Physical humanoid: actuates
- Physical humanoid → IMU and power sensing: provides IMU and voltage
- IMU and power sensing → Robot observer: observations
- Robot observer → Control orchestration: feedback
- Gamepad system service → Gamepad daemon: launches
- Gamepad daemon → Operator input: feeds gamepad intent
- Simulation runner → MuJoCo control adapters: runs with
- MuJoCo control adapters → Robot moves: executes shared behaviors
- MuJoCo control adapters → MuJoCo robot scene: controls simulated model
- MuJoCo robot scene → Alternate robot model: parallel robot descriptions
- Printable mechanical design → MuJoCo robot scene: separate from simulation assets
- Build and deployment docs → Gamepad system service: installation procedure