Config / Calibration / Maintenance
读取与设置配置、执行标定,以及管理重启和固件升级。
Config 适用于 21、16、13 DOF 产品。13/16 DOF 协议已实现但尚未完成真机验证。当前 V3.3 协议的所有布局均不提供速度限位寄存器,speed_limits_available 为 false。Calibration 和 Maintenance 对 13/16 DOF 仍为 NotVerified。
以下片段在已连接的 hand 上执行。Python 位于 async 函数内;C++ 需包含 revo3/revo3.hpp、iostream、vector、chrono 和 stdexcept,并在应用边界处理 SdkError。
config = await hand.config.snapshot()print(config.slave_id, config.speed_limits_available)runtime = hand.config.runtime_optionsprint(runtime.servo_command_timeout_ms)const auto config = hand.config().snapshot();const auto runtime = hand.config().runtime_options();std::cout << static_cast<int>(config.slave_id) << " " << runtime.servo_command_timeout.count() << "\n";更改从站地址(2.1.2)
Section titled “更改从站地址(2.1.2)”调用 set_slave_id() 前,在物理总线上隔离目标手,停止运动和 Servo。同地址调用不写入;实际写入成功、响应丢失或请求发出后取消,都会关闭原 Hand 并使传输会话失效。只调用 hand.close() 不够:必须关闭旧 Manager,新建 Manager,再按新地址重新发现并读取配置确认。响应丢失时先确认实际地址,不自动重试。
examples 仓库的 Python 和 C++ device_operations 演示完整的关闭、重建和验证流程。从仓库根目录执行下面命令,替换实际串口。默认只读;确认目标手已隔离后,添加 –run 才写入地址。
python python/revo3/device_operations.py --port /dev/ttyUSB0 --new-slave-id 2./c/build/demo/device_operations /dev/ttyUSB0 --new-slave-id 2参数与返回值
Section titled “参数与返回值”| 操作 | 参数 | 返回值 |
|---|---|---|
| Config.snapshot() | — | DeviceConfig;speed_limits_available 表示速度限位是否可用 |
Python: await hand.config.set_slave_id(new_id) / C++: hand.config().set_slave_id(new_id) |
设备地址 1–247 | None / void;实际写入后需重建 Manager |
Python: hand.maintenance.update_firmware(file_path, target=None, wait_secs=10, *, on_progress=None) |
固件路径;目标;就绪等待秒数;可选同步进度回调 | OperationHandle |
C++: hand.maintenance().update_firmware(file_path, wait_seconds) |
默认主控固件;wait_seconds 默认 10 秒 | OperationHandle |
C++: hand.maintenance().update_firmware(file_path, target, wait_seconds) |
显式 FirmwareTarget;wait_seconds 默认 10 秒 | OperationHandle |
Python: handle.progress / C++: handle.progress() |
升级传输比例 0..1;其他操作无进度 | float / None / std::optional |
按操作查阅完整签名、默认值、单位与 Python / C++ 差异:
- 4.6 Config 配置 API
- 4.7 Calibration 标定 API
- 4.8 Maintenance 维护 API
- 5.6 Touch、Config、Calibration 与 Maintenance
- 7. 等待、取消和运动冲突
设备配置由固件持久化;RuntimeOptions 仅影响当前进程。speed_limits_available=false 时不调用速度限位 setter。标定前必须保持 Motion 空闲,响应丢失时不能自动重发。