跳转到内容
English

Motion 运动控制

执行单次位置/电流/MIT 下发、目标轨迹、实时 Servo、托管拖拽、示教与回放。

21、16、13 DOF 产品均使用 JointLayout.joint_count 作为整手数组长度。PB1、PT1、DB1、DT1 的整手和单关节协议路径已实现,但尚未完成真机验证;按手指和拇指控制仅适用于 21 关节布局。

查看产品支持矩阵

以下片段在已连接的 hand 上执行。Python 位于 async 函数内;C++ 需包含 revo3/revo3.hpp、iostream、vector、chrono 和 stdexcept,并在应用边界处理 SdkError。

state = await hand.state.snapshot()
target = list(state.positions_deg)
handle = await hand.motion.move_to(target, duration=1.0)
result = await handle.wait(timeout=3.0)
print(result)
const auto state = hand.state().snapshot();
const auto layout = hand.joint_layout();
if (!layout) throw std::runtime_error("Joint layout is unavailable");
std::vector<float> target(
state.motors.positions_deg,
state.motors.positions_deg + layout->joint_count);
auto handle = hand.motion().move_to(target, std::chrono::seconds(1));
const auto result = handle.wait(std::chrono::seconds(3));
操作 参数 返回值
Motion.move_to(target, duration) 目标角度数组(degree);时长(Python 秒 / C++ duration) OperationHandle
Motion.set_position(position_deg) joint_count 个目标角度(degree);单次下发 无返回值
Motion.set_current(current_ma) joint_count 个目标电流(mA);单次下发 无返回值
Motion.set_mit(position_deg, velocity_rpm, kp, kd, feedforward_current_ma) 五组长度为 joint_count 的数组;单次下发 无返回值
OperationHandle.wait(timeout) 等待上限(Python 秒 / C++ duration) OperationState

按操作查阅完整签名、默认值、单位与 Python / C++ 差异:

目标轨迹与 ServoSession 不能并行控制同一只 Hand,冲突返回 ControlConflict。SDK 不按内置默认限位截断目标,固件当前配置是位置限位的事实来源。等待超时或 Indeterminate 不证明运动停止;读取实际状态后再决定恢复操作。

错误、超时与重试 · 语言绑定差异