GitHub_Trending/om/OM1 Unitree Go2导航提供器:四足机器人路径规划
概述
Unitree Go2导航提供器是GitHub_Trending/om/OM1项目中实现四足机器人自主路径规划的核心组件。该模块通过结合激光雷达(LIDAR)传感器数据与核心大语言模型(LLM)的决策能力,使Unitree Go2机器人能够在复杂环境中实现安全、智能的自主导航。
工作原理
导航提供器通过Zenoh协议与ROS2导航栈通信,实现导航目标的发布与状态监控。系统采用了"传感器数据优先"的设计理念,确保在任何情况下机器人的安全移动。
硬件需求
自主探索能力需要在Go2头部安装激光雷达传感器。推荐使用RPLidar A1M8激光雷达。
核心功能实现
导航状态管理
导航提供器通过订阅ROS2导航状态话题,实时监控导航任务的执行情况:
# src/providers/unitree_go2_navigation_provider.py
status_map = {
0: "UNKNOWN",
1: "ACCEPTED",
2: "EXECUTING",
3: "CANCELING",
4: "SUCCEEDED", # Only this status re-enables AI mode
5: "CANCELED",
6: "ABORTED",
}
导航状态通过navigation_status_message_callback方法进行处理,该方法会根据接收到的状态码更新导航状态,并据此控制AI模式的开关。
导航目标发布与取消
导航提供器提供了发布导航目标和取消导航任务的功能:
# src/providers/unitree_go2_navigation_provider.py
def publish_goal_pose(self, pose: geometry_msgs.PoseStamped):
"""Publish a goal pose to the navigation topic."""
if self.session is None:
logging.error("Cannot publish goal pose; Zenoh session is not available.")
return
# Disable AI mode immediately when navigation goal is published
if not self._nav_in_progress:
self._publish_ai_status(enabled=False)
logging.info("Navigation goal published - AI mode disabled immediately")
self._nav_in_progress = True
payload = ZBytes(pose.serialize())
self.session.put(self.goal_pose_topic, payload)
logging.info("Published goal pose to topic: %s", self.goal_pose_topic)
取消导航任务的功能由clear_goal_pose方法实现,该方法会向Nav2发送取消请求。
AI模式自动控制
导航提供器实现了基于导航状态的AI模式自动控制逻辑:
# src/providers/unitree_go2_navigation_provider.py
if status_code in (1, 2): # ACCEPTED or EXECUTING
if not self._nav_in_progress:
self._nav_in_progress = True
self._publish_ai_status(enabled=False) # Disable AI during navigation
logging.info("Navigation started - AI mode disabled")
elif status_code == 4: # STATUS_SUCCEEDED
if self._nav_in_progress:
self._nav_in_progress = False
self._publish_ai_status(enabled=True) # Re-enable AI ONLY on success
logging.info("Navigation succeeded - AI mode re-enabled")
elif status_code in (5, 6): # CANCELED or ABORTED
if self._nav_in_progress:
self._nav_in_progress = False
# Do NOT re-enable AI mode on failure/cancellation
logging.warning("Navigation %s - AI mode remains disabled", self.navigation_status)
数据优先级与安全策略
正常情况
当激光雷达在1.1米范围内未检测到任何物体时,Go2将在核心LLM的控制下在房间内移动。
物体接近情况
当激光雷达检测到1.1米(或更近)范围内有物体时,会将这些信息告知核心LLM,以限制可能的移动方向。例如,激光雷达可能会告诉LLM:
Here is information about objects and walls around you. Use this information to plan your movements and avoid bumping into things: The safe movement choices are: You can turn left. You can turn right.
如果所有方向都被阻挡,激光雷达会告诉LLMs:
You are surrounded by objects and cannot safely move in any direction. DO NOT MOVE.
快速启动指南
要使用Unitree Go2导航提供器,首先需要启动OM1:
uv run src/run.py unitree_go2_autonomy
导航提供器的主要配置可以在config/unitree_go2_autonomy.json5文件中找到。
核心代码结构
导航提供器的核心代码位于src/providers/unitree_go2_navigation_provider.py,主要包含以下几个部分:
- 导航状态管理:监控导航任务的执行状态
- 目标发布与取消:处理导航目标的发布和取消请求
- AI模式控制:根据导航状态自动开关AI模式
- Zenoh通信:与ROS2导航栈进行通信
总结与展望
Unitree Go2导航提供器通过结合激光雷达传感器数据与LLM的决策能力,为四足机器人提供了强大的自主导航功能。未来,该模块将进一步优化路径规划算法,提高机器人在复杂环境中的导航能力。
更多详细信息,请参考:
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust0214
cann-learning-hubCANN 学习中心仓,支持在线互动运行、边学边练,提供教程、示例与优化方案,一站式助力昇腾开发者快速上手。Jupyter Notebook0138
uni-appA cross-platform framework using Vue.jsJavaScript08
GLM-5.2智谱开源 GLM-5.2,这是针对长文本任务的最新旗舰模型。相较于前代产品 GLM-5.1,它在长文本任务处理能力上实现了显著飞跃,并且首次在稳定的 100 万 token 上下文中提供这一能力。Jinja00
SwanLab⚡️SwanLab - an open-source, modern-design AI training tracking and visualization tool. Supports Cloud / Self-hosted use. Integrated with PyTorch / Transformers / LLaMA Factory / veRL/ Swift / Ultralytics / MMEngine / Keras etc.Python00
tiny-universe《大模型白盒子构建指南》:一个全手搓的Tiny-UniverseJupyter Notebook03
