Research: LeRobot Integration
Investigation of ycheng517/lerobot-ros and huggingface/lerobot for the AR4 Physical-AI platform. Conducted 2026-03-09 as part of ar4-jjz.7.
Key Decision
Adopt lerobot-ros as the primary bridge between AR4 and LeRobot, replacing the originally planned ar4_policy_server and ar4_episodes packages.
Rationale: The same author (ycheng517) who maintains ar4_ros_driver has built lerobot-ros — a pip-installable plugin that makes any ros2_control arm appear as a native LeRobot robot. It already includes an AnninAR4 class with AR4-specific configuration. Building our own policy server and episode recorder would duplicate what LeRobot already provides.
lerobot-ros (ycheng517)
160 stars, 21 forks. Two pip packages — no colcon build needed.
What it provides
| Component | Description |
|---|---|
lerobot_robot_ros | LeRobot Robot plugin for any ros2_control arm |
lerobot_teleoperator_devices | Keyboard and 6-DOF gamepad teleoperators |
AnninAR4 class | AR4-specific config, registered as annin_ar4_mk1 |
AR4 configuration (built-in)
- Action type: Cartesian velocity via MoveIt Servo (
ActionType.CARTESIAN_VELOCITY) - Gripper:
gripper_jaw1_joint, open=0.014, close=0.0,GripperActionType.ACTION - Joint limits: AR4 MK1 specific (J1: +/-2.9671 rad, etc.)
- ROS topics used:
/joint_states(sub),/servo_node/delta_twist_cmds(pub),/gripper_controller/gripper_cmd(action client)
How it works
Known limitations
JOINT_TRAJECTORYmode publishes to a topic rather than usingFollowJointTrajectoryaction client — no execution feedback (Issue #3)- Requires LeRobot >= 0.4.0, < 0.5.0
- Requires MoveIt Servo for Cartesian velocity control
huggingface/lerobot
Dataset format (v3.0)
LeRobot datasets use a standardized structure:
For AR4, the features would be:
| Feature | Type | Shape | Description |
|---|---|---|---|
observation.state | float32 | (7,) | 6 joint positions + gripper |
action | float32 | (7,) | 6 joint goals + gripper goal |
observation.images.front | video | (480, 640, 3) | Overview camera |
observation.images.gripper | video | (480, 640, 3) | Gripper camera (optional) |
Policy architectures available
| Policy | Type | Best for |
|---|---|---|
| ACT | Imitation learning | 6-DOF manipulation, our primary target |
| Diffusion Policy | Imitation learning | Complex multi-modal tasks |
| VQ-BeT | Imitation learning | Discrete action spaces |
| Pi0 / Pi0Fast | VLA | Zero-shot generalization |
| SmolVLA | VLA | Lightweight VLA inference |
| GR00T N1.5 | VLA | NVIDIA foundation model |
Robot integration pattern
Adding a new robot to LeRobot requires:
- Subclass
RobotConfig, register with@RobotConfig.register_subclass("name") - Subclass
Robot, implementget_observation()andsend_action() - Define
observation_featuresandaction_featuresproperties - Package as pip plugin (
lerobot_robot_*)
lerobot-ros already does all of this for AR4 via the AnninAR4 class.
Workflow
Simulation gap analysis
Neither lerobot-ros nor LeRobot provide simulation environments for the AR4. The upstream ar4_ros_driver Gazebo setup is kinematic-only (zero gravity, empty world). This is the primary gap we must fill.
What must be built (our packages)
| Gap | Solution | Package |
|---|---|---|
| No gravity | New world file with <gravity>0 0 -9.8</gravity> | ar4_skills |
| No ground plane or objects | SDF world with table + cube | ar4_skills |
| Undefined effort limits | URDF overlay xacro with proper torque values | ar4_skills |
| No joint damping/friction | Add <dynamics> to joint definitions | ar4_skills |
| PID gains tuned for 0g | New controller config for gravity | ar4_skills |
| No collision surface properties | Add <surface> with mu/mu2 to gripper links | ar4_skills |
What we get for free (from lerobot-ros + LeRobot)
| Capability | Source |
|---|---|
| Episode recording | lerobot-record via ROS2Robot |
| Dataset export (v3.0) | LeRobot LeRobotDataset |
| Policy training (ACT, etc.) | lerobot-train |
| Policy inference | lerobot-evaluate via ROS2Robot |
| Teleop (keyboard + gamepad) | lerobot_teleoperator_devices |
| AR4 robot config | AnninAR4 in lerobot_robot_ros |
| HF Hub push/pull | LeRobot push_to_hub() |
Impact on project architecture
This research leads to a significant simplification:
ar4_policy_server— no longer needed as originally designed. LeRobot policies run throughlerobot-rosdirectly. May be repurposed for custom policy wrappers if needed.ar4_episodes— no longer needed.lerobot-recordhandles recording and export natively.ar4_skills— was the primary focus for simulation; now removed. Simulation runs directly viaannin_ar4_gazebofrom the vendor submodule.ar4_msgs— may be simplified. Standard ROS 2 interfaces used by lerobot-ros may suffice.
References
- ycheng517/lerobot-ros — ROS 2 bridge for LeRobot
- huggingface/lerobot — LeRobot framework
- Annin-Robotics/ar4_ros_driver — upstream AR4 driver
- ycheng517/tabletop-handybot — voice-controlled pick-and-place (real hardware)