用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill behavior-tree-nav命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | behavior-tree-nav |
| description | 行为树导航技能 - BehaviorTree.CPP、Nav2 BT、自定义行为节点 |
| argument-hint | 行为树 OR BehaviorTree OR BT navigator OR nav2 BT |
| user-invocable | true |
Navigation2 行为树配置与自定义节点
当需要以下帮助时使用此技能:
# config/bt_navigator.yaml
bt_navigator:
ros__parameters:
bt_xml_filename: 'config/nav2_bt_nav.xml'
plugin_lib_names:
- nav2_compute_path_to_pose_action_bt_node
- nav2_follow_path_action_bt_node
- nav2_back_up_action_bt_node
- nav2_spin_action_bt_node
- nav2_wait_action_bt_node
- nav2_clear_costmap_service_bt_node
<?xml version="1.0"?>
<root BTCPP_format="4">
<BehaviorTree ID="MainTree">
<PipelineSequence name="Navigate">
<!-- 恢复 -->
<ReactiveFallback>
<GoalUpdated/>
<RecoveryNode name="Recovery">
<RoundRobin name="RecoveryActions">
<ClearEntireCostmap name="ClearCostmap"/>
<Spin spin_dist="1.57"/>
<Wait wait_duration="2"/>
</RoundRobin>
</RecoveryNode>
</ReactiveFallback>
<!-- 规划路径 -->
<ComputePathToPose goal="{goal}" path="{path}" error="{error}"/>
<!-- 跟随路径 -->
<FollowPath path="{path}" =/>
#include <behaviortree_cpp_v3/action_node.h>
#include <nav_msgs/msg/path.hpp>
class ComputePathToPoseAction : public BT::ActionNodeBase {
public:
ComputePathToPoseAction(const std::string& name,
const BT::NodeConfiguration& config)
: BT::ActionNodeBase(name, config) {}
void halt() override {}
BT::NodeStatus tick() override {
// 获取输入
auto goal = getInput<geometry_msgs::msg::PoseStamped>("goal");
// 调用规划服务
auto result = call_planner_service(goal.value());
if (result.success) {
setOutput("path", result.path);
return BT::NodeStatus::SUCCESS;
}
return BT::NodeStatus::FAILURE;
}
};
from behavior_tree_class import Action
class CustomCondition(Action):
def __init__(self, name, config):
super().__init__(name, config)
def tick(self):
# 检查条件
if self.check_condition():
return NodeStatus.SUCCESS
return NodeStatus.FAILURE
def check_condition(self):
# 自定义检查逻辑
return True