How i2rt-robotics/i2rt works
Purpose and Entry Points
I2RT is a Python hardware/control SDK for YAM robot arms, grippers, and Flow Base mobile platforms. It supports real CAN-connected deployment, teleoperation, recording/replay, and MuJoCo/Viser simulation-control workflows. Primary entry points are the arm factory at i2rt/robots/get_robot.py, the arm CLI in i2rt/robots/motor_chain_robot.py, and Flow Base controller/client paths i2rt/flow_base/flow_base_controller.py and i2rt/flow_base/flow_base_client.py.
Motor and CAN Boundary
The hardware boundary is Linux SocketCAN (can0, etc.) communicating with DM-series motors. i2rt/motor_drivers/can_interface.py owns CAN transport, while i2rt/motor_drivers/dm_driver.py implements motor protocol/control operations. Robot and configuration layers should depend on these drivers rather than directly forming CAN traffic. Provisioning/reset scripts and device rules under devices/ support the host-side CAN/USB environment.
Configured Robot Assembly
Robot variants are declaratively selected from arm/gripper YAML definitions in i2rt/robots/config/yam_v1.yml, i2rt/robots/config/yam_ultra_v2.yml, and i2rt/robots/config/linear_4310.yml. i2rt/robots/get_robot.py resolves those selections into assembled robot instances. This separates product variants, motor-chain topology, and model selection from reusable runtime control code.
Arm Runtime and Control Contract
i2rt/robots/robot.py defines the high-level robot-facing interface: read joint state and issue commands. i2rt/robots/motor_chain_robot.py adapts that interface to a physical chained set of CAN motors, including arm/gripper control behavior and safety-sensitive real-time command flow. i2rt/robots/kinematics.py provides kinematic calculations used by robot control, while i2rt/robots/sim_robot.py provides a simulation-oriented implementation behind the same conceptual contract.
Simulation, Dynamics, and Operator Interfaces
MuJoCo support bridges robot state/control with physical models through i2rt/utils/mujoco_control_interface.py and i2rt/utils/mujoco_utils.py; it is used for visualization, simulation, and gravity-compensation-related workflows. Browser/operator interaction is a separate adapter in i2rt/utils/viser_control_interface.py. Examples such as examples/control_with_mujoco/control_with_mujoco.py and examples/control_with_viser/control_with_viser.py demonstrate these external runtime integrations without becoming core dependencies of motor control.
Robot Model Assets
Versioned URDF and MJCF/XML models define arm, gripper, and station geometry/dynamics and are coupled to configuration-selected variants. Key model sources include i2rt/robot_models/arm/yam/v1/yam.urdf, i2rt/robot_models/arm/yam/v1/yam.xml, and i2rt/robot_models/station/yam_station_linear_4310_d405/yam_station_linear_4310_d405.xml. Mesh assets live adjacent to models. Agent skills under .agents/skills/align-urdf-mjcf/ and .agents/skills/transform-onshape-urdf/ support maintaining alignment between imported URDFs and MJCF assets.
Flow Base Subsystem
Flow Base is a parallel subsystem rather than an arm extension. i2rt/flow_base/flow_base_client.py exposes network client control to a base host, while i2rt/flow_base/flow_base_controller.py is the local control/joystick runtime. i2rt/flow_base/linear_rail_controller.py covers rail-specific actuation, and i2rt/flow_base/caster_steering_check.py handles steering-state validation. Its external boundary is network/device control, distinct from arm motor-chain CAN control.
Data Capture and Deployment Workflows
Trajectory/state data is captured and replayed through i2rt/utils/recording.py, consumed by workflows such as examples/record_replay_trajectory/record_replay_trajectory.py. Teleoperation composes two robot instances and their command/state streams, as in examples/minimum_gello/minimum_gello.py and examples/bimanual_lead_follower/bimanual_lead_follower.py. Motor maintenance is intentionally isolated in i2rt/motor_config_tool/, including register access via i2rt/motor_config_tool/dm_motor_registers.py, because persistent controller changes are operationally and safety critical.
Main entry points: robot.py Robot contract · get_robot.py Robot factory · motor_chain_robot.py Motor-chain robot · flow_base_controller.py Flow Base controller
Components 22
Arm runtime
- Robot factory · Resolves configured arm and gripper variants.
i2rt/robots/get_robot.py - Variant YAML
i2rt/robots/config/yam_v1.yml - Robot contract · Joint-state and command interface.
i2rt/robots/robot.py - Motor-chain robot · Safety-sensitive chained arm and gripper control.
i2rt/robots/motor_chain_robot.py - Kinematics
i2rt/robots/kinematics.py - SocketCAN transport
i2rt/motor_drivers/can_interface.py - DM motor driver
i2rt/motor_drivers/dm_driver.py - Linux SocketCAN / motors · CAN interfaces connect to DM-series motors.
Simulation & workflows
- Sim robot
i2rt/robots/sim_robot.py - MuJoCo control bridge
i2rt/utils/mujoco_control_interface.py - MuJoCo utilities
i2rt/utils/mujoco_utils.py - Viser control
i2rt/utils/viser_control_interface.py - Recording & replay
i2rt/utils/recording.py - Teleoperation workflows · Composes robot state and command streams.
examples/minimum_gello/minimum_gello.py
Flow Base
Independent mobile-platform subsystem.
- Flow Base client · Remote control of a base host.
i2rt/flow_base/flow_base_client.py - Flow Base controller · Local joystick and device-control runtime.
i2rt/flow_base/flow_base_controller.py - Linear rail control
i2rt/flow_base/linear_rail_controller.py - Caster steering validation
i2rt/flow_base/caster_steering_check.py - Base network / devices
Models & deployment
- Robot model assets · Geometry and dynamics selected by robot variants.
i2rt/robot_models/arm/yam/v1/yam.urdf - Motor configuration tool · Isolates persistent controller register changes.
i2rt/motor_config_tool/dm_motor_registers.py - Host device setup · CAN/USB provisioning, reset scripts, and rules.
Connections 23
- Variant YAML → Robot factory: selects variant
- Robot factory → Robot contract: assembles implementations
- Robot factory → Motor-chain robot: creates hardware robot
- Robot factory → Sim robot: creates simulation robot
- Variant YAML → Robot model assets: couples variant to model
- Motor-chain robot → Robot contract: implements
- Sim robot → Robot contract: implements
- Motor-chain robot → Kinematics: uses
- Motor-chain robot → DM motor driver: commands motors through
- DM motor driver → SocketCAN transport: uses
- SocketCAN transport → Linux SocketCAN / motors: CAN traffic
- Host device setup → Linux SocketCAN / motors: provisions host access
- Motor configuration tool → DM motor driver: maintains registers
- Sim robot → MuJoCo control bridge: simulation control
- MuJoCo control bridge → MuJoCo utilities: uses
- MuJoCo control bridge → Robot model assets: loads dynamics model
- Viser control → Robot contract: operator commands and state
- Recording & replay → Robot contract: captures and replays streams
- Teleoperation workflows → Robot contract: coordinates robot instances
- Flow Base client → Base network / devices: network control
- Flow Base controller → Base network / devices: local device control
- Flow Base controller → Linear rail control: actuates
- Flow Base controller → Caster steering validation: validates steering