Files
craic/tools
FallenSigh 87c8b909e9 Add per-joint limits, joint-space interpolation, grip/release, --up/--down
- Add per-joint angle limits (J2=-110..115, J3=-120..145, J4=-90..130)
  with CLI overrides and validation
- Replace Cartesian interpolation with joint-space interpolation in
  pose mode to guarantee intermediate steps stay within joint limits
- Add --up/--down mutually exclusive groups to both joints and pose
  modes; pose mode auto-detects from z when neither is specified
- Add --grip/--release for J6 control (GRIP/RELEASE_ANGLE placeholders)
- Update cached state to match latest run
2026-06-15 22:18:02 +08:00
..
2026-05-27 02:20:09 +08:00

tools — 调试 & 测试工具

文件

文件 说明
udp_server.py UDP 回显服务器,监听 0.0.0.0:8888,用于测试 UDP 通讯协议

使用

UDP 回显服务器

启动服务器,接收来自 ESP32 或 ROS 2 键盘遥控节点的 UDP 指令并打印:

python tools/udp_server.py

发送测试指令验证协议格式:

# 底盘指令
echo 'XYW:100:0:0:XZHY' | nc -u 127.0.0.1 8888

# 机械臂指令
echo 'JXB:-10:90:0:0:45:0:0:0:EZHY' | nc -u 127.0.0.1 8888

# 激光指令
echo 'LASERON' | nc -u 127.0.0.1 8888

协议测试流程

  1. 启动 python tools/udp_server.py
  2. 修改 ROS 2 节点参数指向本机:udp_ip:=127.0.0.1
  3. 运行 ROS 2 键盘遥控节点,观察服务器收到的指令
  4. 确认协议格式正确后,将目标 IP 改为实际设备地址
# 示例ROS 2 键盘遥控 → 本地回显
ros2 run udp_teleop keyboard_control \
    --ros-args -p udp_ip:=127.0.0.1 -p udp_port:=8888