站立 姿态
set_stand_pose()
Python
set_stand_pose(delta_z: float, delta_pitch: float, delta_yaw: float)
调整机器人的站立姿态偏移量。仅在 PdStand 状态(2)下生效,在其他状态下调用无效果。
| 参数 | 类型 | 说明 |
|---|---|---|
delta_z | float | 高度偏移(m),负值降低重心 |
delta_pitch | float | 俯仰角偏移(rad),正值前倾 |
delta_yaw | float | 偏航角偏移(rad),正值左转 |
GR3 站姿范围(PdStand):delta_z ∈ [-0.20, 0.01],delta_pitch ∈ [-0.3, 0.6],delta_yaw ∈ [-0.3, 0.3]
示例
Python
client.set_fsm_state(2)
time.sleep(1.0)
client.set_stand_pose(-0.1, 0.0, 0.0) # 下蹲 0.1 米
time.sleep(2.0)
client.set_stand_pose(0.0, 0.0, 0.0) # 恢复默认姿态
get_stand_pose()
Python
get_stand_pose() -> list[float]
返回当前站立姿态数据,格式为 [delta_z, delta_pitch, delta_yaw, stable_level]。
| 索引 | 说明 |
|---|---|
[0] | 当前高度偏移 delta_z(m) |
[1] | 当前俯仰角偏移 delta_pitch(rad) |
[2] | 当前偏航角偏移 delta_yaw(rad) |
[3] | 稳定等级(见 get_stable_level()) |
get_stable_level()
Python
get_stable_level() -> int
读取机器人当前的稳定等级。PdStand 控制器以此值判断当前处于悬挂阶段还是站立阶段。
- 稳定等级 ≥ 100(仿真 ≥ 10):站立阶段,站姿控制和上身关节控制可用
- 稳定等级 < 100(仿真 < 10):悬挂阶段,关节缓慢回到默认位置