[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-fan-ziqi--rl_sar":3,"tool-fan-ziqi--rl_sar":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",157379,2,"2026-04-15T23:32:42",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":78,"owner_email":79,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":108,"forks":109,"last_commit_at":110,"license":111,"difficulty_score":112,"env_os":113,"env_gpu":114,"env_ram":115,"env_deps":116,"category_tags":127,"github_topics":80,"view_count":32,"oss_zip_url":80,"oss_zip_packed_at":80,"status":17,"created_at":129,"updated_at":130,"faqs":131,"releases":167},7970,"fan-ziqi\u002Frl_sar","rl_sar","Simulation verification and physical deployment of robot reinforcement learning algorithms, suitable for quadruped robots, wheeled robots, and humanoid robots. \"sar\" represents \"simulation and real\"","rl_sar 是一个专为机器人强化学习算法打造的“仿真到现实”全流程框架，旨在打通从虚拟训练到真机部署的最后一步。它有效解决了强化学习策略在仿真环境中表现良好，却难以平滑迁移至物理实机的痛点，支持四足、轮式及人形等多种形态的机器人。\n\n该工具特别适合机器人领域的研究人员与开发者使用，帮助他们高效验证运动控制（Locomotion）甚至舞蹈动作（Dance）等复杂策略。rl_sar 的核心亮点在于其极强的兼容性与灵活性：它不仅同时支持 IsaacGym 和 IsaacSim 两大主流仿真平台，还无缝衔接 ROS Noetic 与 ROS2 系统；在模型部署上，灵活适配 libtorch 与 onnxruntime 推理后端。此外，它打破了操作系统限制，既能在 Linux 上运行，也实验性支持 macOS（配合 MuJoCo 仿真）。\n\n目前，rl_sar 已预置了包括宇树（Unitree）A1、Go2、G1，以及智元（Agibot）D1 等多款热门机器人的训练策略与配置文件，用户可直接复用或基于此进行二次开发。无论是学术探索还是工程落地，rl_sar 都提供了一套标准化、低门槛的解决方案","rl_sar 是一个专为机器人强化学习算法打造的“仿真到现实”全流程框架，旨在打通从虚拟训练到真机部署的最后一步。它有效解决了强化学习策略在仿真环境中表现良好，却难以平滑迁移至物理实机的痛点，支持四足、轮式及人形等多种形态的机器人。\n\n该工具特别适合机器人领域的研究人员与开发者使用，帮助他们高效验证运动控制（Locomotion）甚至舞蹈动作（Dance）等复杂策略。rl_sar 的核心亮点在于其极强的兼容性与灵活性：它不仅同时支持 IsaacGym 和 IsaacSim 两大主流仿真平台，还无缝衔接 ROS Noetic 与 ROS2 系统；在模型部署上，灵活适配 libtorch 与 onnxruntime 推理后端。此外，它打破了操作系统限制，既能在 Linux 上运行，也实验性支持 macOS（配合 MuJoCo 仿真）。\n\n目前，rl_sar 已预置了包括宇树（Unitree）A1、Go2、G1，以及智元（Agibot）D1 等多款热门机器人的训练策略与配置文件，用户可直接复用或基于此进行二次开发。无论是学术探索还是工程落地，rl_sar 都提供了一套标准化、低门槛的解决方案，让机器人智能体的训练与部署变得更加简单可靠。","# rl_sar\n\n[![Ubuntu 20.04\u002F22.04](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FUbuntu-20.04\u002F22.04-blue.svg?logo=ubuntu)](https:\u002F\u002Fubuntu.com\u002F)\n[![macOS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FmacOS-Experimental-orange.svg?logo=apple)](https:\u002F\u002Fwww.apple.com\u002Fmacos\u002F)\n[![ROS Noetic](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fros-noetic-brightgreen.svg?logo=ros)](https:\u002F\u002Fwiki.ros.org\u002Fnoetic)\n[![ROS2 Foxy\u002FHumble](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fros2-foxy\u002Fhumble-brightgreen.svg?logo=ros)](https:\u002F\u002Fwiki.ros.org\u002Ffoxy)\n[![Gazebo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGazebo-Classic-lightgrey.svg?logo=gazebo)](http:\u002F\u002Fgazebosim.org\u002F)\n[![MuJoCo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMuJoCo-3.2.7-orange.svg?logo=mujoco)](https:\u002F\u002Fmujoco.org\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache2.0-yellow.svg?logo=apache)](https:\u002F\u002Fopensource.org\u002Flicense\u002Fapache-2-0)\n\n[中文文档](README_CN.md)\n\nThis repository provides a framework for simulation verification and physical deployment of robot reinforcement learning algorithms, suitable for quadruped robots, wheeled robots, and humanoid robots. \"sar\" stands for \"simulation and real\"\n\n> Supports both **IsaacGym** and **IsaacSim**\n>\n> Supports both **ROS-Noetic** and **ROS2-Foxy\u002FHumble**\n>\n> Supports both **libtorch** and **onnxruntime**\n>\n> Supports both **Linux** and **macOS**(Only support Mujoco simulation)\n>\n> Supports both **Gazebo** and **Mujoco**(Partial support)\n>\n> Supports both **Locomotion** and **Dance**\n\nSupport List:\n\n|Robot Name (rname:=)|Pre-Trained Policy|Gazebo|Mujoco|Real|\n|-|-|-|-|-|\n|Unitree-A1 (a1)|legged_gym (IsaacGym)|✅|❌|✅|\n|Unitree-Go2 (go2)|himloco (IsaacGym)\u003C\u002Fbr>robot_lab (IsaacSim)|✅|✅|✅\u003C\u002Fbr>✅|\n|Unitree-Go2W (go2w)|robot_lab (IsaacSim)|✅|✅|✅|\n|Unitree-B2 (b2)|robot_lab (IsaacSim)|✅|✅|⚪|\n|Unitree-B2W (b2w)|robot_lab (IsaacSim)|✅|✅|⚪|\n|Unitree-G1 (g1)|robomimic\u002Flocomotion (IsaacGym)\u003C\u002Fbr>robomimic\u002Fcharleston (IsaacGym)\u003C\u002Fbr>whole_body_tracking\u002Fdance_102 (IsaacSim)\u003C\u002Fbr>whole_body_tracking\u002Fgangnam_style (IsaacSim)|✅|✅|✅|\n|FFTAI-GR1T1 (gr1t1)\u003C\u002Fbr>(Only available on Ubuntu20.04)|legged_gym (IsaacGym)|✅|❌|⚪|\n|FFTAI-GR1T2 (gr1t2)\u003C\u002Fbr>(Only available on Ubuntu20.04)|legged_gym (IsaacGym)|✅|❌|⚪|\n|zhinao-L4W4 (l4w4)|legged_gym (IsaacGym)|✅|❌|✅|\n|Deeprobotics-Lite3 (lite3)|himloco (IsaacGym)|✅|❌|✅|\n|Agibot-D1 (d1)|robot_lab (IsaacSim)|✅|✅|✅|\n|DDTRobot-Tita (tita)|robot_lab (IsaacSim)|✅|❌|⚪|\n\n> [!IMPORTANT]\n> Python version temporarily suspended maintenance, please use [v2.3](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Freleases\u002Ftag\u002Fv2.3) if necessary, may be re-released in the future.\n\n> [!NOTE]\n> If you want to train policy using IsaacLab(IsaacSim), please use [robot_lab](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frobot_lab) project.\n>\n> The order of joints in robot_lab cfg file `joint_names` is the same as that defined in `xxx\u002Frobot_lab\u002Fconfig.yaml` in this project.\n>\n> Discuss in [Github Discussion](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fdiscussions) or [Discord](http:\u002F\u002Fwww.robotsfan.com\u002Fdc_rl_sar).\n\n> [!CAUTION]\n> **Disclaimer: User acknowledges that all risks and consequences arising from using this code shall be solely borne by the user, the author assumes no liability for any direct or indirect damages, and proper safety measures must be implemented prior to operation.**\n\n## Preparation\n\nClone the repository\n\n```bash\ngit clone --recursive --depth 1 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar.git\n```\n\nTo update\n\n```bash\ngit pull\ngit submodule update --init --recursive --recommend-shallow --progress\n```\n\n## Dependency\n\nInstall the required packages:\n\n```bash\n# Ubuntu\nsudo apt install cmake g++ build-essential libyaml-cpp-dev libeigen3-dev libboost-all-dev libspdlog-dev libfmt-dev libtbb-dev liblcm-dev\n\n# macOS\nbrew install boost lcm yaml-cpp tbb libomp pkg-config glfw\n```\n\nIf you need to use ROS, install the following dependency packages:\n\n```bash\n# ros-noetic (Ubuntu20.04)\nsudo apt install ros-noetic-teleop-twist-keyboard ros-noetic-controller-interface ros-noetic-gazebo-ros-control ros-noetic-joint-state-controller ros-noetic-effort-controllers ros-noetic-joint-trajectory-controller ros-noetic-joy ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-controller-manager\n\n# ros2-foxy (Ubuntu20.04) \u002F ros2-humble (Ubuntu22.04)\nsudo apt install ros-$ROS_DISTRO-teleop-twist-keyboard ros-$ROS_DISTRO-ros2-control ros-$ROS_DISTRO-ros2-controllers ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-joint-state-publisher-gui ros-$ROS_DISTRO-gazebo-ros2-control ros-$ROS_DISTRO-gazebo-ros-pkgs ros-$ROS_DISTRO-xacro\n```\n\n## Compilation\n\nExecute the following script in the project root directory to compile the entire project:\n\n```bash\n.\u002Fbuild.sh\n```\n\nTo compile specific packages individually, you can append the package names:\n\n```bash\n.\u002Fbuild.sh package1 package2\n```\n\nTo clean the build, use the following command. This will remove all compiled outputs and created symbolic links:\n\n```bash\n.\u002Fbuild.sh -c  # or .\u002Fbuild.sh --clean\n```\n\nIf simulation is not needed and you only want to run on the robot, you can compile using CMake while disabling ROS (the compiled executables will be in `cmake_build\u002Fbin` and libraries in `cmake_build\u002Flib`):\n\n```bash\n.\u002Fbuild.sh -m  # or .\u002Fbuild.sh --cmake\n```\n\nTo use the Mujoco simulator\n\n```bash\n.\u002Fbuild.sh -mj  # or .\u002Fbuild.sh --mujoco\n```\n\nFor detailed usage instructions, you can check them via `.\u002Fbuild.sh -h`:\n\n```bash\nUsage: .\u002Fbuild.sh [OPTIONS] [PACKAGE_NAMES...]\n\nOptions:\n  -c, --clean    Clean workspace (remove symlinks and build artifacts)\n  -m, --cmake    Build using CMake (for hardware deployment only)\n  -mj,--mujoco   Build with MuJoCo simulator support (CMake only)\"\n  -h, --help     Show this help message\n\nExamples:\n  .\u002Fbuild.sh                    # Build all ROS packages\n  .\u002Fbuild.sh package1 package2  # Build specific ROS packages\n  .\u002Fbuild.sh -c                 # Clean all symlinks and build artifacts\n  .\u002Fbuild.sh --clean package1   # Clean specific package and build artifacts\n  .\u002Fbuild.sh -m                 # Build with CMake for hardware deployment\n  .\u002Fbuild.sh -mj                # Build with CMake and MuJoCo simulator support\n```\n\n> [!TIP]\n> If catkin build report errors: `Unable to find either executable 'empy' or Python module 'em'`, run `catkin config -DPYTHON_EXECUTABLE=\u002Fusr\u002Fbin\u002Fpython3` before `catkin build`\n\n## Running\n\nIn the following text, **\\\u003CROBOT\\>\u002F\\\u003CCONFIG\\>** is used to represent different environments, such as `go2\u002Fhimloco` and `go2w\u002Frobot_lab`.\n\nBefore running, copy the trained pt model file to `rl_sar\u002Fsrc\u002Frl_sar\u002Fpolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>`, and configure the parameters in `\u003CROBOT>\u002F\u003CCONFIG>\u002Fconfig.yaml` and `\u003CROBOT>\u002Fbase.yaml`.\n\n### Simulation\n\n#### Gazebo\n\nOpen a terminal, launch the gazebo simulation environment\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nroslaunch rl_sar gazebo.launch rname:=\u003CROBOT>\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 launch rl_sar gazebo.launch.py rname:=\u003CROBOT>\n```\n\nOpen a new terminal, launch the control program\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_sim\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_sim\n```\n\n> [!TIP]\n> **IMPORTANT:** After launching Gazebo, you must launch `rl_sim` in a separate terminal to control the robot. Without `rl_sim`, the robot will not be controlled and may fall over.\n>\n> If you cannot see the robot after launching Gazebo in Ubuntu 22.04, it means the robot was initialized outside the field of view. The robot's position will be automatically reset after launching rl_sim. If the robot falls over during the standing process, use the keyboard `R` or the gamepad `RB+Y` to reset the robot.\n\nIf Gazebo cannot be opened when you start it for the first time, you need to download the model package\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fosrf\u002Fgazebo_models.git ~\u002F.gazebo\u002Fmodels\n```\n\n#### Mujoco\n\n```bash\n.\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco \u003CROBOT> \u003CSCENE>\n# Example: .\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco g1 scene_29dof\n```\n\n#### Docker\n\nDocker support is available for simulation and deployment. See [docker\u002FREADME.md](docker\u002FREADME.md) for details.\n\n```bash\n# Start container\nxhost +local:docker  # Enable X11 on host\ncd docker && docker compose up -d\ndocker compose exec rl_sar bash\n\n# Inside container - MuJoCo\n.\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco g1 scene_29dof\n\n# Inside container - Gazebo\nros2 launch rl_sar gazebo.launch.py rname:=go2\n# (new terminal) ros2 run rl_sar rl_sim\n\n# Inside container - Real robot\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CNETWORK_INTERFACE>\n```\n\n### Control with Mobile Web (Experimental)\n\nInstall dependencies\n\n```bash\nsudo apt install ros-${ROS_DISTRO}-rosbridge-suite\nsudo apt install ros-${ROS_DISTRO}-web-video-server\n\n# If you are using a ROS2 version other than Humble, Jazz, and Rolling, you need to build `web_video_server` from source\ncd \u003Cyour_ros2_workspace>\u002Fsrc\ngit clone https:\u002F\u002Fgithub.com\u002FRobotWebTools\u002Fweb_video_server.git\ncd \u003Cyour_ros2_workspace>\ncolcon build --packages-select web_video_server\n```\n\nRun rosbridge and web_video_server in robot\n\n```bash\n# ROS1\nroslaunch rosbridge_server rosbridge_websocket.launch\nrosrun web_video_server web_video_server\n\n# ROS2\nros2 launch rosbridge_server rosbridge_websocket_launch.xml\nros2 run web_video_server web_video_server\n```\n\nVisit [http:\u002F\u002Frobot.robotsfan.com\u002F](http:\u002F\u002Frobot.robotsfan.com\u002F), fill in the IP address and port, check the settings page in the upper right corner, then connect to the robot. After entering the control page, turn the screen horizontally and click the full screen button in the upper left corner, Then you can control the robot using your phone's browser!\n\n### Control with Gamepad or Keyboard\n\n|Gamepad Control|Keyboard Control|Description|\n|---|---|---|\n|**Basic**|||\n|A|Num0|Move the robot from its initial program pose to the `default_dof_pos` defined in `base.yaml` using position control interpolation|\n|B|Num9|Move the robot from its current position to the initial program pose using position control interpolation|\n|X|N|Toggle navigation mode (disables velocity commands, receives `cmd_vel` topic)|\n|Y|N\u002FA|N\u002FA|\n|**Simulation**|||\n|RB+Y|R|Reset Gazebo environment (stand up fallen robot)|\n|RB+X|Enter|Toggle Gazebo run\u002Fstop (default: running state)|\n|**Motor**|||\n|LB+A|M|N\u002FA (Recommended for motor enable)|\n|LB+B|K|N\u002FA (Recommended for motor disable)|\n|LB+X|P|N\u002FA Motor passive mode (`kp=0, kd=8`)|\n|LB+RB|N\u002FA|N\u002FA (Recommended for emergency stop)|\n|**Skill**|||\n|RB+DPadUp|Num1|Basic Locomotion|\n|RB+DPadDown|Num2|Skill 2|\n|RB+DPadLeft|Num3|Skill 3|\n|RB+DPadRight|Num4|Skill 4|\n|LB+DPadUp|Num5|Skill 5|\n|LB+DPadDown|Num6|Skill 6|\n|LB+DPadLeft|Num7|Skill 7|\n|LB+DPadRight|Num8|Skill 8|\n|**Movement**|||\n|LY Axis|W\u002FS|Forward\u002FBackward movement (X-axis)|\n|LX Axis|A\u002FD|Left\u002FRight movement (Y-axis)|\n|RX Axis|Q\u002FE|Yaw rotation|\n|N\u002FA (Release joystick)|Space|Reset all control commands to zero|\n\n### Real Robots\n\n\u003Cdetails>\n\n\u003Csummary>Unitree A1 (Click to expand)\u003C\u002Fsummary>\n\nUnitree A1 can be connected using both wireless and wired methods:\n\n- Wireless: Connect to the Unitree starting with WIFI broadcasted by the robot **(Note: Wireless connection may lead to packet loss, disconnection, or even loss of control, please ensure safety)**\n- Wired: Use an Ethernet cable to connect any port on the computer and the robot, configure the computer IP as 192.168.123.162, and the netmask as 255.255.255.0\n\nOpen a new terminal and start the control program\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_a1\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_a1\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_a1\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Unitree Go2\u002FGo2W\u002FG1(29dofs) (Click to expand)\u003C\u002Fsummary>\n\n#### Ethernet Connection\n\nConnect one end of the Ethernet cable to the Go2\u002FGo2W\u002FG1(29dofs) robot and the other end to your computer. Then, enable USB Ethernet on the computer and configure it. The IP address of the onboard computer on the Go2 robot is `192.168.123.161`, so the computer's USB Ethernet address should be set to the same network segment as the robot. For example, enter `192.168.123.222` in the \"Address\" field (you can replace `222` with another number).\n\nUse the `ifconfig` command to find the name of the network interface for the 123 network segment, such as `enxf8e43b808e06`. In the following steps, replace `\u003CYOUR_NETWORK_INTERFACE>` with the actual network interface name.\n\nGo2:\n\nOpen a new terminal and start the control program. If you are controlling Go2W, you need to add `wheel` after the command, otherwise leave it blank.\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n```\n\nG1(29dofs):\n\nTurn on the robot and lift it up, press L2+R2 to enter the debugging mode, then open a new terminal and start the control program.\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n```\n\n#### Deploying on the Onboard Jetson\n\nConnect your computer to the robot using the Ethernet cable and log into the Jetson onboard computer. The default password is `123`:\n\n```bash\nssh unitree@192.168.123.18\n```\n\nConnect the phone to the USB of the robot, enable USB network sharing on the phone, pull the code and compile it using `.\u002Fbuild.sh -m`. After successful compilation, run:\n\n```bash\n# Go2:\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# G1(29dofs):\n.\u002Fcmake_build\u002Fbin\u002Frl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n```\n\nThen you can unplug the phone and network cable, and control the robot using the remote controller.\n\n#### Auto-Start on Boot\n\nIf you need to set up auto-start on boot, you can follow this process:\n\nCreate a service file\n\n```bash\nsudo touch \u002Fetc\u002Fsystemd\u002Fsystem\u002Frl_sar.service\n```\n\nWrite the following content, assuming the rl_sar project is in the `~\u002Frl_sar` directory\n\n```\n[Unit]\nDescription=RL SAR Service\nAfter=network.target\n\n[Service]\nType=simple\nUser=unitree\nWorkingDirectory=\u002Fhome\u002Funitree\u002Frl_sar\nExecStart=\u002Fhome\u002Funitree\u002Frl_sar\u002Fcmake_build\u002Fbin\u002Frl_real_go2 eth0 wheel\nRestart=on-failure\nRestartSec=5\nStandardOutput=journal\nStandardError=journal\n\n[Install]\nWantedBy=multi-user.target\n```\n\nReload the systemd configuration:\n\n```bash\nsudo systemctl daemon-reload\n```\n\nEnable auto-start on boot:\n\n```bash\nsudo systemctl enable rl_sar.service\n```\n\nDisable auto-start on boot:\n\n```bash\nsudo systemctl disable rl_sar.service\n```\n\nStart the service:\n\n```bash\nsudo systemctl start rl_sar.service\n```\n\nStop the service:\n\n```bash\nsudo systemctl stop rl_sar.service\n```\n\nRestart the service:\n\n```bash\nsudo systemctl restart rl_sar.service\n```\n\nView service logs:\n\n```bash\nsudo journalctl -u rl_sar.service -f\n```\n\nAfter reboot, the robot will first run the built-in standing program. After the rl_sar service starts, it will automatically dampen down, and then can be controlled normally using the remote controller.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Deeprobotics Lite3 (Click to expand)\u003C\u002Fsummary>\n\nDeeprobotics Lite3 can be connected using wireless method.\n(Wired not tested. For some versions of Lite3, the wired Ethernet port may requires additional installation.)\n\n- Connect to the Lite3 starting with WIFI broadcasted by the robot. We strongly recommand testing the communication the Lite3 using [Lite3_Motion_SDK](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002FLite3_MotionSDK) before use.\n **(Note: Wireless connection may lead to packet loss, disconnection, or even loss of control, please ensure safety)**\n\n- Determine the IP address and port number of Lite3, and modify **line 46-48 in rl_sar\u002Fsrc\u002Frl_real_lite3.cpp**.\n- Then Update **jy_exe\u002Fconf\u002Fnetwork.toml** on the Lite3 motion host to set the IP and port to that of the local machine running ROS2, enabling communication.\n\n> [!CAUTION]\n> **Recheck joint mapping parameters!\u003Cbr>Recheck rl_sar\u002Fpolicy\u002Fhimloco\u002Fconfig.yaml. The default joint mapping in Sim2Sim configuration differs from that used in real. If not updated accordingly, this mismatch may lead to incorrect robot behavior and potential safety hazards**\n\nLite3 also support control using Deeprobotics Retroid gamepad, refer to [Deeprobotics Gamepad](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002Fgamepad)\n\nOpen a new terminal and start the control program\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_lite3\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_lite3\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_lite3\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Agibot D1 (Click to expand)\u003C\u002Fsummary>\n\nD1 can be connected using wireless network.\n\n- Connect to D1's WiFi (default SSID and password are on the label on the side of the robot)\n- Robot default IP: `192.168.234.1` (WiFi) or `192.168.168.168` (Ethernet)\n- You need to configure `\u002Fopt\u002Fexport\u002Fconfig\u002Fsdk_config.yaml` on the robot side, set `target_ip` to your PC's IP\n\n**Network Configuration Steps:**\n\n1. SSH into the robot:\n```bash\nssh firefly@192.168.234.1  # Password: firefly\n```\n\n2. Modify SDK configuration file:\n```bash\nvim \u002Fopt\u002Fexport\u002Fconfig\u002Fsdk_config.yaml\n```\nChange `target_ip` to your PC's IP address (e.g., `192.168.234.2`)\n\n3. Reboot the robot for the configuration to take effect\n\n**Run the control program:**\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_d1 [local_ip] [robot_ip]\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_d1 [local_ip] [robot_ip]\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_d1 [local_ip] [robot_ip]\n\n# Example (using default IP)\n.\u002Fcmake_build\u002Fbin\u002Frl_real_d1 192.168.234.2 192.168.234.1\n```\n\n\u003C\u002Fdetails>\n\n### Train the actuator network\n\nTake A1 as an example below\n\n1. Uncomment `#define CSV_LOGGER` in the top of `rl_real_a1.hpp`. You can also modify the corresponding part in the simulation program to collect simulation data for testing the training process.\n2. Run the control program, and the program will log all data in `src\u002Frl_sar\u002Fpolicy\u002F\u003CROBOT>\u002Fmotor.csv`.\n3. Stop the control program and start training the actuator network. Note that `rl_sar\u002Fsrc\u002Frl_sar\u002Fpolicy\u002F` is omitted before the following paths.\n    ```bash\n    rosrun rl_sar actuator_net.py --mode train --data a1\u002Fmotor.csv --output a1\u002Fmotor.pt\n    ```\n4. Verify the trained actuator network.\n    ```bash\n    rosrun rl_sar actuator_net.py --mode play --data a1\u002Fmotor.csv --output a1\u002Fmotor.pt\n    ```\n\n## Add Your Robot\n\nThe following uses **\\\u003CROBOT\\>\u002F\\\u003CCONFIG\\>** to represent your robot environment. You only need to create or modify the following files, and the names must exactly match those shown below. (You can refer to the corresponding files in go2w as examples.)\n\n```yaml\n# your robot description\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002FCMakeLists.txt\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fpackage.ros1.xml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fpackage.ros2.xml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fxacro\u002Frobot.xacro\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fxacro\u002Fgazebo.xacro\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fconfig\u002Frobot_control.yaml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fconfig\u002Frobot_control_ros2.yaml\n\n# your policy\npolicy\u002F\u003CROBOT>\u002Fbase.yaml  # This file must follow the physical robot's joint order\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002Fconfig.yaml\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002F\u003CPOLICY>.pt  # for libtorch, note that exporting JIT is required\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002F\u003CPOLICY>.onnx  # for onnxruntime\n\n# fsm for robot\nsrc\u002Frl_sar\u002Ffsm_robot\u002Ffsm_\u003CROBOT>.hpp\nsrc\u002Frl_sar\u002Ffsm_robot\u002Ffsm_all.hpp\n\n# your real robot code\nrl_sar\u002Fsrc\u002Frl_sar\u002Fsrc\u002Frl_real_\u003CROBOT>.cpp  # You can customize the forward() function as needed to adapt to your policy\n```\n\n## Contributing\n\nWholeheartedly welcome contributions from the community to make this framework mature and useful for everyone. These may happen as bug reports, feature requests, or code contributions.\n\n[List of contributors](CONTRIBUTORS.md)\n\n## Citation\n\nPlease cite the following if you use this code or parts of it:\n\n```\n@software{fan-ziqi2024rl_sar,\n  author = {fan-ziqi},\n  title = {rl_sar: Simulation Verification and Physical Deployment of Robot Reinforcement Learning Algorithm.},\n  url = {https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar},\n  year = {2024}\n}\n```\n\n## Acknowledgements\n\nThe project uses some code from the following open-source code repositories:\n\n- [unitreerobotics\u002Funitree_sdk2-2.0.0](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_sdk2\u002Ftree\u002F2.0.0)\n- [unitreerobotics\u002Funitree_legged_sdk-v3.2](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_legged_sdk\u002Ftree\u002Fv3.2)\n- [unitreerobotics\u002Funitree_guide](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_guide)\n- [unitreerobotics\u002Funitree_mujoco](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_mujoco)\n- [google-deepmind\u002Fmujoco-3.2.7](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fmujoco)\n- [mertgungor\u002Funitree_model_control](https:\u002F\u002Fgithub.com\u002Fmertgungor\u002Funitree_model_control)\n- [Improbable-AI\u002Fwalk-these-ways](https:\u002F\u002Fgithub.com\u002FImprobable-AI\u002Fwalk-these-ways)\n- [ccrpRepo\u002FRoboMimic_Deploy](https:\u002F\u002Fgithub.com\u002FccrpRepo\u002FRoboMimic_Deploy)\n- [Deeprobotics\u002FLite3_Motion_SDK](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002FLite3_MotionSDK)\n- [chengyangkj\u002FROS_Flutter_Gui_App](https:\u002F\u002Fgithub.com\u002Fchengyangkj\u002FROS_Flutter_Gui_App)\n","# rl_sar\n\n[![Ubuntu 20.04\u002F22.04](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FUbuntu-20.04\u002F22.04-blue.svg?logo=ubuntu)](https:\u002F\u002Fubuntu.com\u002F)\n[![macOS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FmacOS-Experimental-orange.svg?logo=apple)](https:\u002F\u002Fwww.apple.com\u002Fmacos\u002F)\n[![ROS Noetic](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fros-noetic-brightgreen.svg?logo=ros)](https:\u002F\u002Fwiki.ros.org\u002Fnoetic)\n[![ROS2 Foxy\u002FHumble](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fros2-foxy\u002Fhumble-brightgreen.svg?logo=ros)](https:\u002F\u002Fwiki.ros.org\u002Ffoxy)\n[![Gazebo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGazebo-Classic-lightgrey.svg?logo=gazebo)](http:\u002F\u002Fgazebosim.org\u002F)\n[![MuJoCo](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMuJoCo-3.2.7-orange.svg?logo=mujoco)](https:\u002F\u002Fmujoco.org\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache2.0-yellow.svg?logo=apache)](https:\u002F\u002Fopensource.org\u002Flicense\u002Fapache-2-0)\n\n[中文文档](README_CN.md)\n\n本仓库提供了一个用于机器人强化学习算法的仿真验证与物理部署框架，适用于四足机器人、轮式机器人和人形机器人。“sar”代表“simulation and real”。\n\n> 同时支持 **IsaacGym** 和 **IsaacSim**\n>\n> 同时支持 **ROS-Noetic** 和 **ROS2-Foxy\u002FHumble**\n>\n> 同时支持 **libtorch** 和 **onnxruntime**\n>\n> 同时支持 **Linux** 和 **macOS**（仅支持MuJoCo仿真）\n>\n> 同时支持 **Gazebo** 和 **Mujoco**（部分支持）\n>\n> 同时支持 **运动** 和 **舞蹈**\n\n支持列表：\n\n|机器人名称 (rname:=)|预训练策略|Gazebo|Mujoco|真实|\n|-|-|-|-|-|\n|Unitree-A1 (a1)|legged_gym (IsaacGym)|✅|❌|✅|\n|Unitree-Go2 (go2)|himloco (IsaacGym)\u003C\u002Fbr>robot_lab (IsaacSim)|✅|✅|✅\u003C\u002Fbr>✅|\n|Unitree-Go2W (go2w)|robot_lab (IsaacSim)|✅|✅|✅|\n|Unitree-B2 (b2)|robot_lab (IsaacSim)|✅|✅|⚪|\n|Unitree-B2W (b2w)|robot_lab (IsaacSim)|✅|✅|⚪|\n|Unitree-G1 (g1)|robomimic\u002Flocomotion (IsaacGym)\u003C\u002Fbr>robomimic\u002Fcharleston (IsaacGym)\u003C\u002Fbr>whole_body_tracking\u002Fdance_102 (IsaacSim)\u003C\u002Fbr>whole_body_tracking\u002Fgangnam_style (IsaacSim)|✅|✅|✅|\n|FFTAI-GR1T1 (gr1t1)\u003C\u002Fbr>(仅在Ubuntu20.04上可用)|legged_gym (IsaacGym)|✅|❌|⚪|\n|FFTAI-GR1T2 (gr1t2)\u003C\u002Fbr>(仅在Ubuntu20.04上可用)|legged_gym (IsaacGym)|✅|❌|⚪|\n|zhinao-L4W4 (l4w4)|legged_gym (IsaacGym)|✅|❌|✅|\n|Deeprobotics-Lite3 (lite3)|himloco (IsaacGym)|✅|❌|✅|\n|Agibot-D1 (d1)|robot_lab (IsaacSim)|✅|✅|✅|\n|DDTRobot-Tita (tita)|robot_lab (IsaacSim)|✅|❌|⚪|\n\n> [!IMPORTANT]\n> Python版本暂时停止维护，如有需要请使用[v2.3](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Freleases\u002Ftag\u002Fv2.3)，未来可能会重新发布。\n\n> [!NOTE]\n> 如果您想使用IsaacLab(IsaacSim)训练策略，请使用[robot_lab](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frobot_lab)项目。\n>\n> robot_lab配置文件`joint_names`中关节的顺序与本项目中`xxx\u002Frobot_lab\u002Fconfig.yaml`中定义的顺序一致。\n>\n> 欢迎在[Github Discussion](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fdiscussions)或[Discord](http:\u002F\u002Fwww.robotsfan.com\u002Fdc_rl_sar)中讨论。\n\n> [!CAUTION]\n> **免责声明：用户承认，因使用本代码而产生的所有风险及后果均由用户自行承担，作者对任何直接或间接损害不承担任何责任，在操作前必须采取适当的安全措施。**\n\n## 准备工作\n\n克隆仓库\n\n```bash\ngit clone --recursive --depth 1 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar.git\n```\n\n更新时\n\n```bash\ngit pull\ngit submodule update --init --recursive --recommend-shallow --progress\n```\n\n## 依赖项\n\n安装所需软件包：\n\n```bash\n# Ubuntu\nsudo apt install cmake g++ build-essential libyaml-cpp-dev libeigen3-dev libboost-all-dev libspdlog-dev libfmt-dev libtbb-dev liblcm-dev\n\n# macOS\nbrew install boost lcm yaml-cpp tbb libomp pkg-config glfw\n```\n\n如果需要使用ROS，请安装以下依赖包：\n\n```bash\n# ros-noetic (Ubuntu20.04)\nsudo apt install ros-noetic-teleop-twist-keyboard ros-noetic-controller-interface ros-noetic-gazebo-ros-control ros-noetic-joint-state-controller ros-noetic-effort-controllers ros-noetic-joint-trajectory-controller ros-noetic-joy ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-controller-manager\n\n# ros2-foxy (Ubuntu20.04) \u002F ros2-humble (Ubuntu22.04)\nsudo apt install ros-$ROS_DISTRO-teleop-twist-keyboard ros-$ROS_DISTRO-ros2-control ros-$ROS_DISTRO-ros2-controllers ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-joint-state-publisher-gui ros-$ROS_DISTRO-gazebo-ros2-control ros-$ROS_DISTRO-gazebo-ros-pkgs ros-$ROS_DISTRO-xacro\n```\n\n## 编译\n\n在项目根目录下执行以下脚本以编译整个项目：\n\n```bash\n.\u002Fbuild.sh\n```\n\n若需单独编译特定包，可追加包名：\n\n```bash\n.\u002Fbuild.sh package1 package2\n```\n\n清理编译结果时，可使用以下命令。这将移除所有已编译的输出文件及创建的符号链接：\n\n```bash\n.\u002Fbuild.sh -c  # 或 .\u002Fbuild.sh --clean\n```\n\n如无需仿真，仅在机器人上运行，可使用CMake进行编译，并禁用ROS（编译后的可执行文件位于`cmake_build\u002Fbin`，库文件位于`cmake_build\u002Flib`）：\n\n```bash\n.\u002Fbuild.sh -m  # 或 .\u002Fbuild.sh --cmake\n```\n\n如需使用Mujoco模拟器：\n\n```bash\n.\u002Fbuild.sh -mj  # 或 .\u002Fbuild.sh --mujoco\n```\n\n有关详细使用说明，可通过`.\u002Fbuild.sh -h`查看：\n\n```bash\n用法：.\u002Fbuild.sh [选项] [包名...]\n\n选项：\n  -c, --clean    清理工作区（移除符号链接和构建产物）\n  -m, --cmake    使用CMake构建（仅用于硬件部署）\n  -mj,--mujoco   支持MuJoCo模拟器的构建（仅限CMake）\n  -h, --help     显示此帮助信息\n\n示例：\n  .\u002Fbuild.sh                    # 构建所有ROS包\n  .\u002Fbuild.sh package1 package2  # 构建特定ROS包\n  .\u002Fbuild.sh -c                 # 清理所有符号链接和构建产物\n  .\u002Fbuild.sh --clean package1   # 清理特定包及其构建产物\n  .\u002Fbuild.sh -m                 # 使用CMake构建，用于硬件部署\n  .\u002Fbuild.sh -mj                # 使用CMake构建，并支持MuJoCo模拟器\n```\n\n> [!TIP]\n> 若catkin构建报错：“无法找到可执行文件‘empy’或Python模块‘em’”，请在`catkin build`之前运行`catkin config -DPYTHON_EXECUTABLE=\u002Fusr\u002Fbin\u002Fpython3`。\n\n## 运行\n\n在下文中，**\\\u003CROBOT\\>\u002F\\\u003CCONFIG\\>**用于表示不同环境，例如`go2\u002Fhimloco`和`go2w\u002Frobot_lab`。\n\n运行前，请将训练好的pt模型文件复制到`rl_sar\u002Fsrc\u002Frl_sar\u002Fpolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>`，并配置`\u003CROBOT>\u002F\u003CCONFIG>\u002Fconfig.yaml`和`\u003CROBOT>\u002Fbase.yaml`中的参数。\n\n### 仿真\n\n#### Gazebo\n\n打开终端，启动Gazebo仿真环境：\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nroslaunch rl_sar gazebo.launch rname:=\u003CROBOT>\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 launch rl_sar gazebo.launch.py rname:=\u003CROBOT>\n```\n\n再打开一个新终端，启动控制程序：\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_sim\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_sim\n```\n\n> [!TIP]\n> **重要提示：** 启动 Gazebo 后，必须在另一个终端中启动 `rl_sim` 才能控制机器人。如果没有 `rl_sim`，机器人将无法被控制，并可能倒下。\n>\n> 如果在 Ubuntu 22.04 中启动 Gazebo 后看不到机器人，则说明机器人是在视野之外初始化的。启动 `rl_sim` 后，机器人的位置会自动重置。如果机器人在站立过程中倒下，可以使用键盘上的 `R` 键或游戏手柄上的 `RB+Y` 组合键来重置机器人。\n\n如果首次启动 Gazebo 时无法打开，需要下载模型包：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fosrf\u002Fgazebo_models.git ~\u002F.gazebo\u002Fmodels\n```\n\n#### Mujoco\n\n```bash\n.\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco \u003CROBOT> \u003CSCENE>\n# 示例：.\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco g1 scene_29dof\n```\n\n#### Docker\n\nDocker 支持用于仿真和部署。详情请参阅 [docker\u002FREADME.md](docker\u002FREADME.md)。\n\n```bash\n# 启动容器\nxhost +local:docker  # 在主机上启用 X11\ncd docker && docker compose up -d\ndocker compose exec rl_sar bash\n\n# 容器内 - MuJoCo\n.\u002Fcmake_build\u002Fbin\u002Frl_sim_mujoco g1 scene_29dof\n\n# 容器内 - Gazebo\nros2 launch rl_sar gazebo.launch.py rname:=go2\n# （新终端）ros2 run rl_sar rl_sim\n\n# 容器内 - 实际机器人\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CNETWORK_INTERFACE>\n```\n\n### 使用手机网页控制（实验性）\n\n安装依赖项：\n\n```bash\nsudo apt install ros-${ROS_DISTRO}-rosbridge-suite\nsudo apt install ros-${ROS_DISTRO}-web-video-server\n\n# 如果您使用的不是 Humble、Jazz 和 Rolling 版本的 ROS2，需要从源代码构建 `web_video_server`\ncd \u003Cyour_ros2_workspace>\u002Fsrc\ngit clone https:\u002F\u002Fgithub.com\u002FRobotWebTools\u002Fweb_video_server.git\ncd \u003Cyour_ros2_workspace>\ncolcon build --packages-select web_video_server\n```\n\n在机器人上运行 rosbridge 和 web_video_server：\n\n```bash\n# ROS1\nroslaunch rosbridge_server rosbridge_websocket.launch\nrosrun web_video_server web_video_server\n\n# ROS2\nros2 launch rosbridge_server rosbridge_websocket_launch.xml\nros2 run web_video_server web_video_server\n```\n\n访问 [http:\u002F\u002Frobot.robotsfan.com\u002F](http:\u002F\u002Frobot.robotsfan.com\u002F)，填写 IP 地址和端口，检查右上角的设置页面，然后连接到机器人。进入控制页面后，将屏幕横过来并点击左上角的全屏按钮，即可通过手机浏览器控制机器人！\n\n### 使用游戏手柄或键盘控制\n\n|游戏手柄控制|键盘控制|说明|\n|---|---|---|\n|**基本操作**|||\n|A|Num0|使用位置控制插值将机器人从初始程序姿态移动到 `base.yaml` 中定义的 `default_dof_pos`|\n|B|Num9|使用位置控制插值将机器人从当前姿态移动到初始程序姿态|\n|X|N|切换导航模式（禁用速度指令，接收 `cmd_vel` 主题）|\n|Y|无|无|\n|**仿真模式**|||\n|RB+Y|R|重置 Gazebo 环境（扶起倒下的机器人）|\n|RB+X|Enter|切换 Gazebo 的运行\u002F停止状态（默认为运行状态）|\n|**电机控制**|||\n|LB+A|M|无（建议用于电机启用）|\n|LB+B|K|无（建议用于电机关闭）|\n|LB+X|P|无 电机被动模式（`kp=0, kd=8`）|\n|LB+RB|无|无（建议用于紧急停止）|\n|**技能**|||\n|RB+DPadUp|Num1|基础行走|\n|RB+DPadDown|Num2|技能 2|\n|RB+DPadLeft|Num3|技能 3|\n|RB+DPadRight|Num4|技能 4|\n|LB+DPadUp|Num5|技能 5|\n|LB+DPadDown|Num6|技能 6|\n|LB+DPadLeft|Num7|技能 7|\n|LB+DPadRight|Num8|技能 8|\n|**运动**|||\n|LY 轴|W\u002FS|前后移动（X 轴）|\n|LX 轴|A\u002FD|左右移动（Y 轴）|\n|RX 轴|Q\u002FE|偏航旋转|\n|无（松开摇杆）|空格|将所有控制指令重置为零|\n\n### 实际机器人\n\n\u003Cdetails>\n\n\u003Csummary>Unitree A1（点击展开）\u003C\u002Fsummary>\n\nUnitree A1 可以通过无线和有线两种方式连接：\n\n- 无线：连接到由机器人广播的 WIFI 开头的 Unitree 网络 **（注意：无线连接可能导致数据包丢失、断开连接，甚至失去控制，请确保安全）**\n- 有线：使用以太网线连接电脑和机器人任意端口，将电脑 IP 配置为 192.168.123.162，子网掩码为 255.255.255.0。\n\n打开一个新的终端并启动控制程序：\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_a1\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_a1\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_a1\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Unitree Go2\u002FGo2W\u002FG1(29dofs)（点击展开）\u003C\u002Fsummary>\n\n#### 以太网连接\n\n将以太网线的一端连接到 Go2\u002FGo2W\u002FG1(29dofs) 机器人，另一端连接到您的电脑。然后，在电脑上启用 USB 以太网并进行配置。Go2 机器人板载计算机的 IP 地址是 `192.168.123.161`，因此电脑的 USB 以太网地址应设置为与机器人同一网段。例如，在“地址”字段输入 `192.168.123.222`（您可以将 `222` 替换为其他数字）。\n\n使用 `ifconfig` 命令查找 123 网段的网络接口名称，例如 `enxf8e43b808e06`。在后续步骤中，将 `\u003CYOUR_NETWORK_INTERFACE>` 替换为实际的网络接口名称。\n\nGo2：\n\n打开一个新的终端并启动控制程序。如果您控制的是 Go2W，需要在命令后添加 `wheel`，否则保持空白。\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n```\n\nG1(29dofs)：\n\n打开机器人并将其抬起，按下 L2+R2 进入调试模式，然后打开一个新的终端并启动控制程序。\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_g1 \u003CYOUR_NETWORK_INTERFACE>\n```\n\n#### 在板载 Jetson 上部署\n\n使用以太网线将您的电脑连接到机器人，并登录到 Jetson 板载计算机。默认密码是 `123`：\n\n```bash\nssh unitree@192.168.123.18\n```\n\n将手机连接到机器人的 USB 接口，在手机上启用 USB 网络共享，拉取代码并使用 `.\u002Fbuild.sh -m` 编译。编译成功后，运行：\n\n```bash\n# Go2：\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003CYOUR_NETWORK_INTERFACE> [wheel]\n\n# G1(29个自由度)：\n.\u002Fcmake_build\u002Fbin\u002Frl_real_g1 \u003C你的网络接口>\n```\n\n然后你可以拔掉手机和网线，使用遥控器控制机器人。\n\n#### 开机自启动\n\n如果需要设置开机自启动，可以按照以下步骤操作：\n\n创建服务文件\n\n```bash\nsudo touch \u002Fetc\u002Fsystemd\u002Fsystem\u002Frl_sar.service\n```\n\n写入以下内容，假设 rl_sar 项目位于 `~\u002Frl_sar` 目录下\n\n```\n[Unit]\nDescription=RL SAR Service\nAfter=network.target\n\n[Service]\nType=simple\nUser=unitree\nWorkingDirectory=\u002Fhome\u002Funitree\u002Frl_sar\nExecStart=\u002Fhome\u002Funitree\u002Frl_sar\u002Fcmake_build\u002Fbin\u002Frl_real_go2 eth0 wheel\nRestart=on-failure\nRestartSec=5\nStandardOutput=journal\nStandardError=journal\n\n[Install]\nWantedBy=multi-user.target\n```\n\n重新加载 systemd 配置：\n\n```bash\nsudo systemctl daemon-reload\n```\n\n启用开机自启动：\n\n```bash\nsudo systemctl enable rl_sar.service\n```\n\n禁用开机自启动：\n\n```bash\nsudo systemctl disable rl_sar.service\n```\n\n启动服务：\n\n```bash\nsudo systemctl start rl_sar.service\n```\n\n停止服务：\n\n```bash\nsudo systemctl stop rl_sar.service\n```\n\n重启服务：\n\n```bash\nsudo systemctl restart rl_sar.service\n```\n\n查看服务日志：\n\n```bash\nsudo journalctl -u rl_sar.service -f\n```\n\n重启后，机器人会先运行内置的站立程序。rl_sar 服务启动后，机器人会自动降噪，随后就可以通过遥控器正常控制了。\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Deeprobotics Lite3（点击展开）\u003C\u002Fsummary>\n\nDeeprobotics Lite3 可以通过无线方式连接。\n（有线方式尚未测试。对于某些版本的 Lite3，有线以太网端口可能需要额外安装驱动。）\n\n- 首先连接到由机器人广播的 WIFI。强烈建议在使用前先使用 [Lite3_Motion_SDK](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002FLite3_MotionSDK) 测试与 Lite3 的通信。\n **（注意：无线连接可能导致丢包、断开甚至失去控制，请务必确保安全）**\n\n- 确定 Lite3 的 IP 地址和端口号，并修改 **rl_sar\u002Fsrc\u002Frl_real_lite3.cpp 中的第 46–48 行**。\n- 然后在 Lite3 运动主机上更新 **jy_exe\u002Fconf\u002Fnetwork.toml**，将 IP 和端口设置为运行 ROS2 的本地机器的 IP，从而实现通信。\n\n> [!CAUTION]\n> **请再次检查关节映射参数！\u003Cbr>请再次检查 rl_sar\u002Fpolicy\u002Fhimloco\u002Fconfig.yaml。Sim2Sim 配置中的默认关节映射与实际使用的不同。如果不相应更新，这种不匹配可能导致机器人行为异常，甚至引发安全隐患。**\n\nLite3 还支持使用 Deeprobotics Retroid 游戏手柄进行控制，详情请参阅 [Deeprobotics Gamepad](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002Fgamepad)。\n\n打开一个新的终端并启动控制程序：\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_lite3\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_lite3\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_lite3\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\n\u003Csummary>Agibot D1（点击展开）\u003C\u002Fsummary>\n\nD1 可以通过无线网络连接。\n\n- 连接到 D1 的 WiFi（默认 SSID 和密码在机器人侧面的标签上）\n- 机器人默认 IP：`192.168.234.1`（WiFi）或 `192.168.168.168`（以太网）\n- 你需要在机器人端配置 `\u002Fopt\u002Fexport\u002Fconfig\u002Fsdk_config.yaml`，将 `target_ip` 设置为你的电脑的 IP。\n\n**网络配置步骤：**\n\n1. 通过 SSH 登录到机器人：\n```bash\nssh firefly@192.168.234.1  # 密码：firefly\n```\n\n2. 修改 SDK 配置文件：\n```bash\nvim \u002Fopt\u002Fexport\u002Fconfig\u002Fsdk_config.yaml\n```\n将 `target_ip` 改为你电脑的 IP 地址（例如 `192.168.234.2`）。\n\n3. 重启机器人使配置生效。\n\n**运行控制程序：**\n\n```bash\n# ROS1\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_real_d1 [本地IP] [机器人IP]\n\n# ROS2\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_d1 [本地IP] [机器人IP]\n\n# CMake\n.\u002Fcmake_build\u002Fbin\u002Frl_real_d1 [本地IP] [机器人IP]\n\n# 示例（使用默认IP）\n.\u002Fcmake_build\u002Fbin\u002Frl_real_d1 192.168.234.2 192.168.234.1\n```\n\n\u003C\u002Fdetails>\n\n### 训练执行器网络\n\n以下以 A1 为例\n\n1. 在 `rl_real_a1.hpp` 的顶部取消注释 `#define CSV_LOGGER`。你也可以修改仿真程序中的相应部分，收集仿真数据用于测试训练过程。\n2. 运行控制程序，程序会将所有数据记录到 `src\u002Frl_sar\u002Fpolicy\u002F\u003CROBOT>\u002Fmotor.csv`。\n3. 停止控制程序，开始训练执行器网络。请注意，以下路径中省略了 `rl_sar\u002Fsrc\u002Frl_sar\u002Fpolicy\u002F`。\n    ```bash\n    rosrun rl_sar actuator_net.py --mode train --data a1\u002Fmotor.csv --output a1\u002Fmotor.pt\n    ```\n4. 验证训练好的执行器网络。\n    ```bash\n    rosrun rl_sar actuator_net.py --mode play --data a1\u002Fmotor.csv --output a1\u002Fmotor.pt\n    ```\n\n## 添加你的机器人\n\n以下使用 **\\\u003CROBOT\\>\u002F\\\u003CCONFIG\\>** 来表示你的机器人环境。你只需创建或修改以下文件，且文件名必须与所示完全一致。（可以参考 go2w 中的对应文件作为示例。）\n\n```yaml\n# 你的机器人描述\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002FCMakeLists.txt\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fpackage.ros1.xml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fpackage.ros2.xml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fxacro\u002Frobot.xacro\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fxacro\u002Fgazebo.xacro\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fconfig\u002Frobot_control.yaml\nrl_sar\u002Fsrc\u002Frl_sar_zoo\u002F\u003CROBOT>_description\u002Fconfig\u002Frobot_control_ros2.yaml\n\n# 你的策略\npolicy\u002F\u003CROBOT>\u002Fbase.yaml  # 此文件必须按照物理机器人的关节顺序编写\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002Fconfig.yaml\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002F\u003CPOLICY>.pt  # 适用于 libtorch，注意需要导出 JIT 格式\npolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>\u002F\u003CPOLICY>.onnx  # 适用于 onnxruntime\n\n# 机器人状态机\nsrc\u002Frl_sar\u002Ffsm_robot\u002Ffsm_\u003CROBOT>.hpp\nsrc\u002Frl_sar\u002Ffsm_robot\u002Ffsm_all.hpp\n\n# 你的真实机器人代码\nrl_sar\u002Fsrc\u002Frl_sar\u002Fsrc\u002Frl_real_\u003CROBOT>.cpp  # 你可以根据需要自定义 forward() 函数，以适配你的策略\n```\n\n## 贡献\n我们诚挚欢迎社区的贡献，以使这个框架更加成熟并惠及所有人。这些贡献可以是 bug 报告、功能请求或代码提交。\n\n[贡献者列表](CONTRIBUTORS.md)\n\n## 引用\n如果你使用了本代码或其中的部分内容，请引用以下信息：\n\n```\n@software{fan-ziqi2024rl_sar,\n  author = {fan-ziqi},\n  title = {rl_sar：机器人强化学习算法的仿真验证与物理部署},\n  url = {https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar},\n  year = {2024}\n}\n```\n\n## 致谢\n\n本项目使用了以下开源代码仓库中的部分代码：\n\n- [unitreerobotics\u002Funitree_sdk2-2.0.0](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_sdk2\u002Ftree\u002F2.0.0)\n- [unitreerobotics\u002Funitree_legged_sdk-v3.2](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_legged_sdk\u002Ftree\u002Fv3.2)\n- [unitreerobotics\u002Funitree_guide](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_guide)\n- [unitreerobotics\u002Funitree_mujoco](https:\u002F\u002Fgithub.com\u002Funitreerobotics\u002Funitree_mujoco)\n- [google-deepmind\u002Fmujoco-3.2.7](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fmujoco)\n- [mertgungor\u002Funitree_model_control](https:\u002F\u002Fgithub.com\u002Fmertgungor\u002Funitree_model_control)\n- [Improbable-AI\u002Fwalk-these-ways](https:\u002F\u002Fgithub.com\u002FImprobable-AI\u002Fwalk-these-ways)\n- [ccrpRepo\u002FRoboMimic_Deploy](https:\u002F\u002Fgithub.com\u002FccrpRepo\u002FRoboMimic_Deploy)\n- [Deeprobotics\u002FLite3_Motion_SDK](https:\u002F\u002Fgithub.com\u002FDeepRoboticsLab\u002FLite3_MotionSDK)\n- [chengyangkj\u002FROS_Flutter_Gui_App](https:\u002F\u002Fgithub.com\u002Fchengyangkj\u002FROS_Flutter_Gui_App)","# rl_sar 快速上手指南\n\nrl_sar 是一个用于机器人强化学习算法仿真验证与真机部署的框架，支持四足、轮式及人形机器人。\"sar\"代表 \"simulation and real\"（仿真与真机）。\n\n## 1. 环境准备\n\n### 系统要求\n- **推荐系统**: Ubuntu 20.04 \u002F 22.04\n- **实验性支持**: macOS (仅支持 MuJoCo 仿真)\n- **ROS 版本**: ROS Noetic 或 ROS2 Foxy\u002FHumble\n- **仿真器**: Gazebo Classic 或 MuJoCo (3.2.7+)\n- **注意**: Python 版本目前暂停维护，如需使用请参考 v2.3 版本。\n\n### 安装前置依赖\n\n**Ubuntu 用户:**\n```bash\nsudo apt update\nsudo apt install cmake g++ build-essential libyaml-cpp-dev libeigen3-dev libboost-all-dev libspdlog-dev libfmt-dev libtbb-dev liblcm-dev\n```\n\n**macOS 用户:**\n```bash\nbrew install boost lcm yaml-cpp tbb libomp pkg-config glfw\n```\n\n**ROS 相关依赖 (根据选择的 ROS 版本执行):**\n\n*ROS1 Noetic (Ubuntu 20.04):*\n```bash\nsudo apt install ros-noetic-teleop-twist-keyboard ros-noetic-controller-interface ros-noetic-gazebo-ros-control ros-noetic-joint-state-controller ros-noetic-effort-controllers ros-noetic-joint-trajectory-controller ros-noetic-joy ros-noetic-ros-control ros-noetic-ros-controllers ros-noetic-controller-manager\n```\n\n*ROS2 Foxy\u002FHumble:*\n```bash\n# 请确保已设置 $ROS_DISTRO 环境变量 (foxy 或 humble)\nsudo apt install ros-$ROS_DISTRO-teleop-twist-keyboard ros-$ROS_DISTRO-ros2-control ros-$ROS_DISTRO-ros2-controllers ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-robot-state-publisher ros-$ROS_DISTRO-joint-state-publisher-gui ros-$ROS_DISTRO-gazebo-ros2-control ros-$ROS_DISTRO-gazebo-ros-pkgs ros-$ROS_DISTRO-xacro\n```\n\n## 2. 安装步骤\n\n### 克隆项目\n建议使用递归克隆以获取子模块：\n```bash\ngit clone --recursive --depth 1 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar.git\ncd rl_sar\n```\n\n若后续需要更新代码：\n```bash\ngit pull\ngit submodule update --init --recursive --recommend-shallow --progress\n```\n\n### 编译项目\n在项目根目录执行编译脚本：\n\n**全量编译 (默认 ROS 模式):**\n```bash\n.\u002Fbuild.sh\n```\n\n**仅编译特定包:**\n```bash\n.\u002Fbuild.sh package1 package2\n```\n\n**仅用于真机部署 (禁用 ROS，使用 CMake):**\n```bash\n.\u002Fbuild.sh -m\n```\n\n**启用 MuJoCo 仿真支持:**\n```bash\n.\u002Fbuild.sh -mj\n```\n\n> **提示**: 如果 `catkin build` 报错 `Unable to find either executable 'empy' or Python module 'em'`，请先运行 `catkin config -DPYTHON_EXECUTABLE=\u002Fusr\u002Fbin\u002Fpython3`。\n\n## 3. 基本使用\n\n在使用前，请将训练好的 `.pt` 模型文件复制到对应目录：\n`rl_sar\u002Fsrc\u002Frl_sar\u002Fpolicy\u002F\u003CROBOT>\u002F\u003CCONFIG>`\n并配置 `\u003CROBOT>\u002F\u003CCONFIG>\u002Fconfig.yaml` 和 `\u003CROBOT>\u002Fbase.yaml` 中的参数。\n\n以下以 **Unitree Go2** 机器人配合 **Gazebo** 仿真为例：\n\n### 步骤一：启动仿真环境\n打开终端，加载环境并启动 Gazebo：\n\n*ROS1:*\n```bash\nsource devel\u002Fsetup.bash\nroslaunch rl_sar gazebo.launch rname:=go2\n```\n\n*ROS2:*\n```bash\nsource install\u002Fsetup.bash\nros2 launch rl_sar gazebo.launch.py rname:=go2\n```\n\n### 步骤二：启动控制节点\n**重要**：必须在新开的终端中启动控制程序，否则机器人无法保持平衡。\n\n*ROS1:*\n```bash\nsource devel\u002Fsetup.bash\nrosrun rl_sar rl_sim\n```\n\n*ROS2:*\n```bash\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_sim\n```\n\n启动后，机器人将自动复位。若机器人摔倒，可按键盘 `R` 或手柄 `RB+Y` 重置。\n\n### 简易控制方式\n- **键盘控制**:\n    - `W\u002FS`: 前进\u002F后退\n    - `A\u002FD`: 左移\u002F右移\n    - `Q\u002FE`: 旋转\n    - `Num1-8`: 切换不同技能策略 (如基础行走、舞蹈等)\n    - `Space`: 停止所有运动指令\n- **手柄控制**: 支持 Xbox\u002FPS 系列手柄，映射关系详见项目文档。\n\n### 真机部署简述\n对于真机（如 Unitree A1\u002FGo2），确保电脑与机器人通过网线或 WiFi 连接在同一网段，然后运行对应的可执行文件：\n\n```bash\n# ROS2 示例\nsource install\u002Fsetup.bash\nros2 run rl_sar rl_real_go2 \u003C网络接口名>\n\n# 或 CMake 编译后的直接运行\n.\u002Fcmake_build\u002Fbin\u002Frl_real_go2 \u003C网络接口名>\n```\n\n> **安全警告**: 真机操作存在风险，请务必在开阔安全区域测试，并做好急停准备。作者不对因使用代码造成的任何损坏负责。","某机器人实验室团队正致力于将基于强化学习的步态控制算法从仿真环境迁移到真实的 Unitree Go2 四足机器人上，以实现在复杂地形中的稳定行走。\n\n### 没有 rl_sar 时\n- **仿真与真机割裂**：研究人员需在 IsaacGym 中训练策略，再手动重写代码适配 ROS 和真机驱动，接口不一致导致大量调试时间浪费在环境配置而非算法优化上。\n- **部署风险高昂**：缺乏统一的验证框架，未经充分仿真验证的策略直接上机测试，极易因“现实差距”导致机器人摔倒甚至硬件损坏。\n- **多平台适配困难**：若需切换仿真器（如从 Gazebo 换到 MuJoCo）或升级 ROS 版本（ROS1 转 ROS2），往往需要重构底层通信逻辑，维护成本极高。\n- **预训练模型复用率低**：社区优秀的预训练策略（如 himloco）因缺乏标准加载接口，难以直接应用于自有硬件，重复造轮子现象严重。\n\n### 使用 rl_sar 后\n- **无缝仿真到真机**：rl_sar 提供统一的\"SAR\"框架，支持同一套策略代码在 IsaacGym\u002FMuJoCo 仿真与真实机器人间一键切换，极大缩短了 Sim-to-Real 的验证周期。\n- **安全可靠的验证流程**：利用内置的 Gazebo 和 MuJoCo 高保真仿真进行充分回归测试，确认策略稳定性后再部署至真机，显著降低了设备损坏风险。\n- **灵活的技术栈兼容**：原生支持 ROS\u002FROS2 双版本及 LibTorch\u002FONNX 多种推理后端，团队可自由选择合适的仿真器和部署环境，无需修改核心逻辑。\n- **开箱即用的生态支持**：直接调用针对 Go2 等机型优化的预训练策略（如 robot_lab 成果），快速搭建基准系统，让研发重心回归到上层任务创新。\n\nrl_sar 通过打通仿真验证与物理部署的全链路，让机器人强化学习算法的开发从“手工定制”迈向“标准化流水线”，大幅提升了研发效率与安全性。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffan-ziqi_rl_sar_a1ae1779.png","fan-ziqi","Ziqi Fan","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ffan-ziqi_5f2f2cd9.jpg","应无所住 而生其心","ZSTU & NJUST","Nanjing","fanziqi614@gmail.com",null,"www.robotsfan.com","https:\u002F\u002Fgithub.com\u002Ffan-ziqi",[84,88,92,96,100,104],{"name":85,"color":86,"percentage":87},"C++","#f34b7d",81.8,{"name":89,"color":90,"percentage":91},"Shell","#89e051",8.6,{"name":93,"color":94,"percentage":95},"CMake","#DA3434",4.8,{"name":97,"color":98,"percentage":99},"Python","#3572A5",4.2,{"name":101,"color":102,"percentage":103},"Dockerfile","#384d54",0.4,{"name":105,"color":106,"percentage":107},"C","#555555",0.2,1252,159,"2026-04-15T06:25:27","Apache-2.0",4,"Linux (Ubuntu 20.04\u002F22.04), macOS (实验性支持，仅限 MuJoCo 仿真)","未说明 (项目依赖 IsaacGym\u002FIsaacSim\u002FMuJoCo，通常 Isaac 系列需要 NVIDIA GPU，但 README 未明确具体型号和显存要求)","未说明",{"notes":117,"python":118,"dependencies":119},"1. macOS 仅支持 MuJoCo 仿真，不支持 Gazebo 和真机部署。\n2. Python 接口当前暂停维护，主要推荐使用 C++ 编译运行。\n3. 若使用 IsaacLab (IsaacSim) 训练策略，需配合独立的 robot_lab 项目。\n4. 首次运行 Gazebo 需手动下载模型包 (~\u002F.gazebo\u002Fmodels)。\n5. 真机部署前务必实施安全措施，作者不对操作风险负责。\n6. 部分人形机器人模型 (GR1T1\u002FGR1T2) 仅在 Ubuntu 20.04 上可用。","未说明 (README 提示 Python 版本暂时停止维护，建议如需使用参考 v2.3 版本)",[120,121,122,123,124,125,126],"ROS Noetic (Ubuntu 20.04) 或 ROS2 Foxy\u002FHumble","Gazebo Classic","MuJoCo 3.2.7","libtorch 或 onnxruntime","cmake, g++, build-essential","libyaml-cpp-dev, libeigen3-dev, libboost-all-dev","libspdlog-dev, libfmt-dev, libtbb-dev, liblcm-dev",[14,128],"其他","2026-03-27T02:49:30.150509","2026-04-16T08:15:23.981394",[132,137,142,147,152,157,162],{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},35680,"在 Mujoco v4.0.0 中，G1 机器人的腰部自由度被锁定（不再是 3 个自由度），这是预期行为吗？如何适配？","该问题已在 rl_sar v4.1.0 版本中修复。如果您遇到腰部被锁定的情况，请升级代码到 v4.1.0 或更高版本即可恢复正常功能。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F147",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},35681,"在 Isaac Sim 框架下运行策略时，机器人关节出现剧烈抖动（Shaking）怎么办？","这通常是由于 PD 控制参数或关节映射不匹配导致的。您可以尝试应用社区提供的修复补丁（参考 PR #51 中的提交 d5f04d3）。值得注意的是，在 Sim2Real（仿真到真机）部署时，通常不需要更改 PD 参数，可以直接使用作者提供的默认 PD 配置。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F63",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},35682,"自定义训练的策略在 Lab 环境中表现良好，但迁移到 Gazebo 后机器人无法站立或失败，可能的原因是什么？","最常见的原因是关节映射顺序（Joint mapping sequence）不匹配。该问题已在 v3.1.0 版本中修复，请更新代码。此外，如果您使用的是 UNITREE_RL_GYM 训练且未在配置中包含历史观测（observations_history），请检查 config.yaml，尝试删除或调整 observations_history 的配置（例如删除 `[5,4,3,2,1,0]` 相关设置）以匹配仿真环境的需求。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F73",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},35683,"如何在 Go2 机器人上部署外部训练的 .pt 模型（如 LocomotionWithNP3O）？config.yaml 该如何配置？","部署外部模型时，关键在于确保 config.yaml 中的观测空间（observation space）、动作空间（action space）以及关节顺序与训练时的环境完全一致。如果加载失败，请仔细核对模型输入维度是否与当前环境配置匹配。许多用户在确认配置文件与训练源一致后成功解决了加载问题。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F42",{"id":153,"question_zh":154,"answer_zh":155,"source_url":156},35684,"实机部署 Go2 时，当旋转角度超过 180 度控制器会崩溃，如何解决？","这是由于坐标系判定和四元数转换逻辑在不同环境下的差异导致的。解决方案是：在仿真环境中需要添加 `QuatRotateInverse` 操作来修正方向，但在实机部署时则不需要此操作。请根据运行环境（仿真或真机）条件判断是否应用该逆旋转逻辑。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F26",{"id":158,"question_zh":159,"answer_zh":160,"source_url":161},35685,"在 Mujoco 中运行 G1 机器人仿真时，机器人直接摔倒在地无法站立，如何解决？","这是因为仿真启动后默认处于空闲或初始化状态，需要手动触发站立动作。请在运行仿真终端中按下键盘上的 `0` 键，机器人即可执行站立（GetUp）动作并保持平衡。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F154",{"id":163,"question_zh":164,"answer_zh":165,"source_url":166},35686,"在 ROS1 环境下使用键盘控制 Go2 机器人时，按键无反应或控制失效怎么办？","这可能是由于手柄（Joystick）和键盘（Keyboard）的控制优先级冲突导致的 Bug。在 v3.0.1 版本中已支持键盘控制，如果遇到失效问题，建议检查代码中关于输入优先级的逻辑，或者确认使用的 URDF 文件版本是否与代码版本匹配（最新版 URDF 行数约为 1217 行）。","https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fissues\u002F113",[168,173,178,183,188,193,198,203,208,213,218,223,228,233,238],{"id":169,"version":170,"summary_zh":171,"released_at":172},280888,"v4.1.0","## 变更内容\n* PR：@SenSen77 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F176 中将 SetCommand 统一为“每次写入时都使用新命令”的编码规范。\n* 功能：@MiaoDX 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F171 中添加了对仿真和部署的 Docker 支持。\n\n## 新贡献者\n* @SenSen77 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F176 中完成了首次贡献。\n* @MiaoDX 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F171 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv4.0.0...v4.1.0","2026-03-19T11:06:36",{"id":174,"version":175,"summary_zh":176,"released_at":177},280889,"v4.0.0","## ✨ 新功能与重大改进\n*   **BeyondMimic 舞蹈仿真与部署**：新增对 BeyondMimic 舞蹈的仿真与部署支持。\n*   **官方 MuJoCo 支持**：正式支持 MuJoCo 仿真。项目依赖会自动配置，无需在系统级别进行安装。\n*   **macOS 支持（实验性）**：新增对 macOS 的支持。目前支持 MuJoCo 仿真。\n*   **Web 控制界面**：引入跨平台兼容的 Web 控制界面（如手机、平板等），可实现状态机切换、导航地图查看以及实时视频流传输。\n*   **推理中间层**：新增推理中间层，同时支持 libtorch 和 onnxruntime。编译时会自动下载依赖，无需手动配置，并可自动检测模型后缀（`.pt`\u002F`.onnx`）。\n*   **位置插值与状态机封装**：添加位置插值功能，便于在任意位置复用；将强化学习实现封装至状态机内，简化调用流程。\n*   **进度条**：在日志模块中新增进度条功能。\n\n## 🔧 重构与项目结构优化\n*   **SDK 及描述文件采用 Git 子模块**：将机器人 SDK 和机器人描述文件转换为 Git 子模块，以减小仓库体积。\n*   **统一数据类型**：所有数据结构统一使用 `float` 类型。\n*   **目录重组**：将机器人策略和 YAML 文件移至根目录，实现数据与代码的解耦；将机器人状态机头文件重命名为 `fsm_\u003Crobot>.hpp`。\n*   **日志模块化**：日志模块现独立为一个单独的模块。\n\n## 🐞 修复与优化\n*   **恢复互斥锁**：恢复用于线程同步的互斥锁，但潜在的长时间运行稳定性问题仍在排查中。\n*   **降低 CPU 使用率**：减少了 libtorch 推理过程中的 CPU 占用。\n*   **优化键盘逻辑**：改进了键盘逻辑，新增对 macOS 键盘的支持。\n*   **Git 浅克隆**：Git 现默认使用浅克隆，使终端设备的克隆体积缩减至原来的十分之一。\n*   **增强状态管理**：改进了有限状态机（FSM）中的状态变更请求校验机制，状态机现支持从任意状态直接跳转到任何其他状态。\n\n**完整更新日志**：https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv3.2.0...v4.0.0","2025-10-29T15:53:53",{"id":179,"version":180,"summary_zh":181,"released_at":182},280890,"v3.2.0","## 变更内容\n* 新增 Deeprobotics Retroid 游戏手柄支持，由 @XuaaanQWQ 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F84 中实现。\n* 修复：增强状态机和日志系统，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002Fa7793fdcad20d44bdafbd8e4d56f91a9daa1ced2 中完成。\n* 文档：添加对 motor.csv 路径的说明，由 @fan-ziqi 在 88bdc6ede599752959c678f0c1e94493e095b418 中完成。\n* 修复：将 #define 移至 hpp 文件，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002F4102a07c5bf32402b98a99a1c30be802fa97e0cb 中完成。\n* GitHub：使用新的问题模板，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002F63d524ee5dc527e81d09c90243a38ec89f9fcf84 中完成。\n* 修复：更新 Lite3 URDF 文件以与官方版本保持一致，由 @XuaaanQWQ 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F86 中完成。\n* 修复：优化 Lite3-SDK 库路径处理以支持不同架构，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002Fe5c2f41f786f3a051e5d0a6269eae19b28c68aac 中完成。\n* 功能：为 ObservationBuffer 添加“time”或“term”优先级，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002Fe373b94cc12e78f03d155f32ce42db7e7836accc 中实现。\n* 新增 robot tita，由 @cmjang 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F114 中完成。\n* 修复：添加 BOOST_BIND_GLOBAL_PLACEHOLDERS 以抑制 Boost 弃用警告，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002F0503f4e3101fbdb98f6a42de4793ed6e5a2b53f5 中完成。\n* 修复：调整 tau_est robot_joint_controller ROS2 版本中的索引，由 @fan-ziqi 在 4c9b9b0bf5897954e9f33c1dfddf4f56c384695c 中完成。\n* 修复 FSM 在 RLFSMStateGetDown 和 RLFSMStateGetUp 之间反复切换的问题，由 @1170632760 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F124 中完成。\n* 修复：在 AttitudeProtect 函数中启用姿态保护功能，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002Fffeff67358b4ddf8f7fa53a99fb94e17bfd99cc9 中完成。\n* 修复：在导航切换时使游戏手柄状态与键盘同步，由 @fan-ziqi 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcommit\u002F25aef463dec5e471af0d3e4b7c822cdd40bb2437 中完成。\n\n## 新贡献者\n* @cmjang 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F114 中完成了首次贡献。\n* @1170632760 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F124 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv3.1.0...v3.2.0","2025-09-19T13:09:19",{"id":184,"version":185,"summary_zh":186,"released_at":187},280891,"v3.1.0","## 变更内容\n* 修复：在 g1 实机代码中删除 CRC，由 @fan-ziqi 在 476dd08 中完成\n* 修复：移除 `config.yaml` 中的 `joint_name` 和 `joint_controller_name`，由 @fan-ziqi 在 c4440e7 中完成\n* 修复：在 cout 中添加 `\\033[K`，由 @fan-ziqi 在 29d762 中完成\n* **新增功能：添加 Deeprobotics Lite3 模拟与实机支持**，由 @XuaaanQWQ 在 https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F83 中完成\n\n## 新贡献者\n* Deeprobotics（http:\u002F\u002Fwww.deeprobotics.cn\u002Fen）\n* 李洪毅\n* 李培卓\n* 马宇轩\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv3.0.1...v3.1.0","2025-07-10T13:16:47",{"id":189,"version":190,"summary_zh":191,"released_at":192},280892,"v3.0.1","# 发布说明\n\n修复了一些 bug\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv3.0.0...v3.0.1","2025-07-05T10:25:09",{"id":194,"version":195,"summary_zh":196,"released_at":197},280893,"v3.0.0","# 发布说明\n\n## 🚀 新特性\n\n### ROS 与 ROS2 的合并\n\n- 添加了一键构建脚本 `build.sh`，该脚本会自动检测系统架构和 ROS 版本，以选择合适的编译器。如果存在不同版本的构建产物，脚本会提示用户是否自动清理。\n\n  ````bash\n  使用方法：.\u002Fbuild.sh [选项] [包名...]\n  \n  选项：\n    -c, --clean    清理工作空间（移除符号链接和构建产物）\n    -m, --cmake    使用 CMake 构建（仅用于硬件部署）\n    -h, --help     显示帮助信息\n  \n  示例：\n    .\u002Fbuild.sh                    # 构建所有 ROS 包\n    .\u002Fbuild.sh package1 package2  # 构建指定的 ROS 包\n    .\u002Fbuild.sh -c                 # 清理所有符号链接和构建产物\n    .\u002Fbuild.sh --clean package1   # 清理特定包及其构建产物\n    .\u002Fbuild.sh -m                 # 使用 CMake 构建以进行硬件部署\n  ````\n\n- 每个包同时包含 `package.ros1.xml` 和 `package.ros2.xml` 文件。构建脚本会自动链接相应版本进行编译。\n\n- ROS 版本通过环境变量传递到 `CMakeLists.txt` 中，并在代码中使用宏进行条件编译。\n\n- 统一了 `gazebo.launch` 和 `gazebo.launch.py` 文件。只需传入 `rname` 参数即可启动任意机器人，并删除了 C++ 代码中的 `default_rl_config` 以及 launch 配置文件中的 `cfg`。\n\n  ```bash\n  # ROS1\n  source devel\u002Fsetup.bash\n  roslaunch rl_sar gazebo.launch rname:=\u003CROBOT>\n  \n  # ROS2\n  source install\u002Fsetup.bash\n  ros2 launch rl_sar gazebo.launch.py rname:=\u003CROBOT>\n  ```\n\n- launch 文件中不再包含 `controller_manager` 的启动，而是由代码动态启动为一个进程。对于 ROS2，`joint_names` 将从 `config.yaml` 中读取以确定关节顺序，并写入临时文件供 `robot_joint_controller` 使用。\n\n### FSM 重构\n\n- 将 `rl_sdk` 与 FSM 解耦，并新增了 `FSMFactory`。每个机器人现在在其 `policy` 文件夹内维护独立的 `fsm.hpp` 文件，拥有唯一的命名空间和 `RLFSMState`。在命名空间之外，继承 `FSMFactory`，并通过 `REGISTER_FSM_FACTORY` 自动将所有 `RLFSMState` 注册到 `FSMManager` 中。在 `rl_sim\u002Fresl.cpp` 中，向 `FSMManager` 传入机器人名称即可返回对应的 FSM。\n\n- 新增了一个用于切换状态的接口 `RequestStateChange(state_name)`，可供上层调用。\n\n- 导航模式不再需要单独的 FSM 或固定策略，现在可以在任何模式下通过遥控或键盘进行切换。\n\n## 🔧 控制\n\n- 将 `RLFSMStateWaiting` 替换为 `RLFSMStatePassive`，并将默认的 kp 设置为 0，kd 设置为 8。\n\n- 统一了键盘和操纵杆控制：\n\n  |游戏手柄控制|键盘控制|描述|\n  |---|---|---|\n  |**基础**|||\n  |A|Num0|将机器人从其初始程序位姿移动到 `base.yaml` 中定义的 `default_dof_pos`，使用位置","2025-06-28T15:09:48",{"id":199,"version":200,"summary_zh":201,"released_at":202},280894,"v2.5","# 发布说明\n这是 v2 版本的最后一个版本，修复了 v2.4 中的 Unitree G1 URDF 文件。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.4...v2.5","2025-06-23T12:34:08",{"id":204,"version":205,"summary_zh":206,"released_at":207},280895,"v2.4","# 发布说明\n\n## 新功能与改进\n\n### 🚀 有限状态机（FSM）支持\n- 添加了 FSM 框架，以更好地管理状态和控制工作流  \n\n### 🤖 更多机器人支持\n- 增加了对 **Unitree Go2W 机器人** 的支持  \n- 增加了对 **`广州智脑IBOT` 四足机器人（l4w4）** 的支持  \n\n### 📦 CMake 构建系统\n- 重新组织了 `CMakeLists` 文件，以提高模块化程度  \n- 改进了跨平台编译支持  \n\n### 🔗 ROS 集成\n- 作为可选组件，继续保持与 ROS 的兼容性  \n\n### 🖥️ Jetson 本地部署\n- 支持在 Go2 和 Go2W 上进行 **Jetson 本地编译**  \n- 更新至 **最新的 Unitree SDK2 版本**  \n- 增加了 Jetson 本地部署的相关文档  \n\n### 🧠 观测系统\n- 在观测系统中新增了 **相位** 参数  \n\n## Bug 修复与优化\n- 更新了库文件目录名称，以提升兼容性  \n- 通过克隆 `actions_scaled` 张量来进行输出计算，修复了张量操作问题  \n- 修正了 `GetState()` 函数，交换了 `lx` 和 `rx` 的值  \n- 增强了 `InitRL()` 的异常处理，提供了更详细的错误信息  \n- 更新了 A1 的 `default_rl_config` 配置  \n- 添加了 **Unitree G1 的描述**  \n- 实现了 **地球世界** 环境  \n\n## 已弃用内容\n\n### ⚠️ Python 和 ROS2 版本已弃用\n- Python 和 ROS2 版本将不再进行主动维护  \n- 欢迎社区为这些版本提供贡献  \n\n**感谢您的支持！** 🚀  \n\n**完整变更日志**: [https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.3...v2.4](https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.3...v2.4)","2025-06-14T14:36:49",{"id":209,"version":210,"summary_zh":211,"released_at":212},280896,"v2.3","## 变更内容\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.2...v2.3\n\n1. 修复了 `observations_history` 的顺序，以确保数据处理的一致性。  \n2. 移除了 `config.yaml` 中的行列依赖，并显式指定了关节顺序。  \n3. 简化了启动文件：现在可以通过 `cfg:=` 指定参数来启动单机器人模型的不同配置。示例：  \n   ```bash\n   roslaunch rl_sar gazebo_go2.launch cfg:=himloco\n   ```  \n4. 将 `command_mapping` 和 `state_mapping` 从 *.hpp 文件移至 `config.yaml`，以便更好地管理配置。  \n5. 为 `GoldenRetriever-l4w4` 机器人新增了仿真和部署 SDK。  \n6. 增加了对 `go2`、`go2w`、`b2`、`b2w`、`a1` 预训练模型的支持。  \n7. 重新组织了项目结构：  \n   - 将 SDK 移至 `thirdparty\u002F` 目录。  \n   - 将核心库移至 `core\u002F` 目录。  \n8. 修复了 hpp 文件中重复的 `#ifndef` 问题。\n","2025-03-13T11:09:39",{"id":214,"version":215,"summary_zh":216,"released_at":217},280897,"v2.2","**完整更新日志**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.1...v2.2","2025-01-11T14:21:53",{"id":219,"version":220,"summary_zh":221,"released_at":222},280898,"v2.1","## What's Changed\r\n* feat: unitree go2 sim and real support by @zma69650 in https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F27\r\n\r\n## New Contributors\r\n* @zma69650 made their first contribution in https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F27\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv2.0...v2.1","2024-10-15T02:57:54",{"id":224,"version":225,"summary_zh":226,"released_at":227},280899,"v2.0","[Breaking change] split config.yaml into separate model folders\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv1.2...v2.0","2024-08-15T15:19:25",{"id":229,"version":230,"summary_zh":231,"released_at":232},280900,"v1.2","## What's Changed\r\n* feat: isaaclab framework support by @fan-ziqi in https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F10\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv1.1...v1.2","2024-08-09T12:27:12",{"id":234,"version":235,"summary_zh":236,"released_at":237},280901,"v1.1","## What's Changed\r\n* NEW VERSION by @fan-ziqi in https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F5\r\n* feat: [Destructive Update] NEW VERSION by @fan-ziqi in https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fpull\u002F6\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Ffan-ziqi\u002Frl_sar\u002Fcompare\u002Fv1.0...v1.1","2024-08-09T12:25:51",{"id":239,"version":240,"summary_zh":80,"released_at":241},280902,"v1.0","2024-05-24T08:25:43"]