交通控制
掌握DAMP →PREP →WALK序列,速度指令,侧移动,旋转和安全关闭.
五个单位中的第二个 · 交通控制 · ~ 3小时
了解模式序列
通过一个特定的序列,K1必须通过模式过渡.跳过步骤会导致下降.
关闭时,总是逆转回来:
步行 → 预备 →
步骤1:控制的预备过渡
from booster_robotics_sdk import BoosterRobot, RobotMode
import time
robot = BoosterRobot(ip="192.168.10.102")
robot.connect()
# Start from DAMP (should already be in DAMP after Unit 1)
state = robot.get_state()
assert state.mode == RobotMode.DAMP, "Must start from DAMP"
print("Entering PREP — robot will stand up slowly")
robot.set_mode(RobotMode.PREP)
# Wait for PREP to stabilize — this is mandatory
print("Waiting 5 seconds for PREP stabilization...")
time.sleep(5)
state = robot.get_state()
print(f"Mode confirmed: {state.mode}")
print(f"IMU pitch (should be near 0): {state.imu_euler[1]:.2f} deg")
步骤2: 输入WALK,然后先发送速度命令
from booster_robotics_sdk import LocomotionCommand
print("Entering WALK mode — spotter ready?")
robot.set_mode(RobotMode.WALK)
time.sleep(2) # Stabilize in WALK
# Walk forward at 0.2 m/s for 3 seconds
print("Walking forward...")
cmd = LocomotionCommand(vx=0.2, vy=0.0, vyaw=0.0)
robot.send_locomotion_command(cmd)
time.sleep(3)
# Stop
robot.send_locomotion_command(LocomotionCommand(vx=0, vy=0, vyaw=0))
time.sleep(1)
第三步:侧面运动和
# Step sideways (right)
cmd = LocomotionCommand(vx=0.0, vy=-0.2, vyaw=0.0)
robot.send_locomotion_command(cmd)
time.sleep(2)
robot.send_locomotion_command(LocomotionCommand(vx=0, vy=0, vyaw=0))
time.sleep(1)
# Rotate in place (yaw)
cmd = LocomotionCommand(vx=0.0, vy=0.0, vyaw=0.3)
robot.send_locomotion_command(cmd)
time.sleep(3)
robot.send_locomotion_command(LocomotionCommand(vx=0, vy=0, vyaw=0))
time.sleep(1)
步骤4:安全关闭序列
# Always return to PREP before DAMP
print("Shutting down — entering PREP...")
robot.set_mode(RobotMode.PREP)
time.sleep(3)
print("Entering DAMP...")
robot.set_mode(RobotMode.DAMP)
time.sleep(1)
robot.disconnect()
print("Done — robot is in DAMP (safe to handle)")
速度限制参考
| Parameter | Min | Max | Unit |
|---|---|---|---|
| vx (forward/back) | -0.5 | 0.5 | m/s |
| vy (lateral) | -0.3 | 0.3 | m/s |
| vyaw (rotation) | -1.0 | 1.0 | rad/s |
开始使用保守值 (50%最大) 在你的第一次会议.K1的平衡控制器处理稳定性,但在极限附近的突然命令变化可能导致机器人跌倒.
单元2完成,当...
您已经成功地前进,后退和侧面走过K1. Yaw转换工作.您至少完成了安全关闭序列 (WALK → PREP → DAMP).没有发生意外跌倒.在继续到单元之前记录您的会议记录.
[← 回到路径概述]







