Lerobot 目前的机器人硬件以舵机类型为主,并未配置机器人正逆运动学及运动学,遥操作映射以舵机关节角度为主
因此,需要在使用前需要对舵机各项参数及初始位置进行配置
目录
[1 Mobile ALOHA 配置](#1 Mobile ALOHA 配置)
[2 Dynamixel 配置](#2 Dynamixel 配置)
[2.1 配置软件](#2.1 配置软件)
[2.2 SDK](#2.2 SDK)
[3 Lerobot 配置](#3 Lerobot 配置)
1 Mobile ALOHA 配置
对于 Mobile ALOHA 的配置,可以参考 Aloha and Aloha 2 stationary,其中分为了两个版本:
Github:Trossen Robotics Github
软硬件配置均有详细说明:

四个臂配置:

2 Dynamixel 配置
ALOHA 采用的是 Dynamixel 舵机,这个舵机算是老朋友了,Dexcap灵巧手用的也是它,性能真的挺好,价格真的挺贵
舵机配置有两种方法:
- Dynamixel 官方配置软件
- Dynamixel SDK
2.1 配置软件
详细资料及教程可以参考 DYNAMIXEL Wizard 2.0,其支持的 os:
- Windows 7 / 8.1 / 10 (32 bit and 64 bit)
- Linux
- Ubuntu 18.04 (64 bit)
- Ubuntu 16.04 (64 bit)
- MacOS 10.12 / 10.13 / 10.14 (64bit)
配置软件下载:网址

配置过程直接参考教程就可以了,界面如下:

2.2 SDK
详细资料及教程可以参考 get_started_with_real_robot
使用 DynamixelMotorsBus 通过对应的 USB 总线以链式方式与舵机通信
此类封装了 Python 版 Dynamixel SDK,方便对舵机的读写操作
首次配置舵机需要拔下每个舵机电源,然后运行命令识别。舵机会将自己的 ID 保存在内部,所以每个舵机只需配置一次
先配置 Leader 臂,插入第 1 个舵机,运行 configure_motor.py:
python
python lerobot/scripts/configure_motor.py \
--port /dev/tty.usbmodem58760432961 \
--brand dynamixel \
--model xl330-m288 \
--baudrate 1000000 \
--ID 1
然后拔下第 1 个舵机,插入第 2 个,运行相同命令,只需修改舵机型号和 ID
依次类推,直到为 Leader 臂的所有 6 个舵机设置好
再配置 Follower 臂,舵机型号包括 xl430-w250 和 xl330-m288 等
3 Lerobot 配置
对于 Aloha bimanual robot,使用 AlohaRobotConfig 来设置不同的设置,例如阴影关节(肩部、肘部为两个电机)的辅助 ID

Lerobot 新版本在架构上进行了很大的更改,配置文件也全部变成了.py 和 .json
LeRobot 针对 Aloha 机器人的默认校准文件为.cache/calibration/aloha_default。假设电机已正确组装,则 Aloha 机器人无需手动校准步骤

简单记一下:
homing_offset:归零位置
drive_mode:驱动模式
start_pos:初始位置
end_pos:结束位置
calib_mode:标定模式
motor_names:舵机命名
因为第9个舵机为线性,因此配置时计算方式为(end_pos-start_pos)%
如果安装前没有将舵机归零,需要标定后修改 start_pos 和 end_pos 参数,否则会报错超限:
Wrong motor position detected for gripper. Expected to be in nominal range of [0,100]%(a full linear translation), with a maximum range range of[-10,110]% to account for some imprecision during calibration,present value is -145.748291015625 %, This might be due to a cable connection issue creating an artificial jump in motor values. You need to recalibrate by running'python lerobot/scripts/control robot.py calibrate'
