Xarm-DataCollection/config/pika/pika_record_config.yaml
Vinman bdc8ef05ab refactor: 插件化重构 — 重命名包、draccus 配置迁移、上下文注册、Pika 复用
1. 重命名 ufactory_lerobot → lerobot_robot_ufactory
   以独立插件包形式支持 lerobot 加载,pyproject.toml 同步更新

2. 配置文件迁移至 draccus 格式
   所有 YAML config 从 _target_ 格式迁移至 ChoiceRegistry type 格式
   dict 值类型从具体类改为抽象基类(RobotConfig/TeleoperatorConfig)
   确保嵌套 dict 中的 type 选择器能被 draccus 正确解析

3. teleop 上下文注册替代属性注入
   新增 context.py(contextvars 实现),支持多 teleop 按 id 存取
   UFBaseTeleop.connect/disconnect 自动注册/注销活跃 teleop
   UFMockRobot.get_observation 从上下文获取 teleop action
   移除 record() 对 cfg.robot.teleop 的注入

4. 部分导入延迟加载
   pika_device: serial/list_ports 延迟导入
   gello_teleop: gello 依赖延迟导入
   umi_teleop/camera_umi: XVLib 延迟导入
   space_mouse: spnav 延迟导入

5. Pika 设备实例复用
   PIKA_DEVICE_MAP 共享已连接的 Sense/Gripper,防止多实例化抢占端口
   修复 pika_gripper 属性误用 _pika_sense_port 的 bug

6. 修复 multiple_uf_mock_robot
   robots 从 list 改为 dict[str, UFMockRobot],移除 keys 列表
   send_action 改用 dict items 遍历
   新增 MultipleUFMockRobot.cameras 聚合属性
2026-06-30 15:07:39 +08:00

35 lines
1016 B
YAML

robot:
type: uf::mock_robot
id: "uf_mock_robot"
control_space: "cartesian"
gripper_type: 2
state_offset_action: 3
teleop_id: "pika_xxxx"
cameras:
fisheye:
type: opencv
index_or_path: "/dev/v4l/by-id/usb-DECXIN_CAMERA_DECXIN_CAMERA_01.00.00-video-index0"
width: 640
height: 480
fps: 30
fourcc: "MJPG"
# make sure to edit with your correct configurations!
teleop:
type: uf::pika_teleop
id: "pika_xxxx"
# port: "/dev/ttyUSB0"
scale_xyz: 1.5
tracker_to_robot_eef: [0, 0, 0, 180, -90, 0]
robot_base_pose: [400, 0, 400, 180, 0, 0]
dataset:
# root of local repo: /home/<user_name>/.cache/huggingface/lerobot (default)
root: "/home/uf/Data/lerobot_datas/record/ufactory/pika_datas"
repo_id: "ufactory/pika_datas"
single_task: "Pick up the purple grape and drop into the box on the left."
fps: 30
episode_time_s: 60 # max duration for one episode
reset_time_s: 20 # (invalid) time for resetting env between episodes
push_to_hub: False