movebase底盘运动模块
- move(vx, vy, w)
设置底盘运动速度
车头方向为x正方向,右侧为y正方向,z轴角速度顺时针为正
- 参数:
vx (float) -- X方向平移速度
vy (float) -- Y方向平移速度
w (float) -- Z轴旋转角速度
- async move_straight(distance, vel=30)
直行距离
- 参数:
vel (float) -- 直行速度. 建议值20-60.
distance (float) -- 直行距离,前进为正后退为负,单位cm.
- async move_side(distance, vel=30)
平移距离
- 参数:
vel (float) -- 直行速度. 建议值20-60.
distance (float) -- 直径距离,单位cm.
- async turn(angle, vel=80)
转弯角度. 默认启用陀螺仪控制转角.
- 参数:
angle (float) -- 转弯角度. 左负右正.
- heading(yaw)
转向到朝向指定角度.以陀螺仪角度为基准
- 参数:
yaw (float) -- 目标角度
- heading_to_axis()
转向到指定坐标 自动判断最近的坐标轴方向(0,90,180,270),并转到该坐标轴
- async moveto(x, y, t)
移动到指定坐标
- 参数:
x (float) -- 目标X坐标
y (float) -- 目标Y坐标
t (float) -- 移动时间
- async track_line_async(speed=80, end='cross', over=500)
自动巡线函数
- 参数:
speed (int, optional) -- 巡线速度. 默认为80. 建议巡线速度80~100.
end (str, optional) -- 巡线终点类型. 默认为'cross'. 可选的终点类型有: cross: 十字路口 right: 右路口 left: 左路口 s: 巡线时间
over (int, optional) -- 过线时间.默认为500ms
- process_serial_command()
处理串口命令
- async communication_loop()
通信主循环