行为树XML节点
nav2_behavior_tree 包提供了几个导航特定的节点,这些节点是预先注册的,可以包含在行为树中。 [校准@小鱼]
查看此 introduction ,了解行为树是如何工作的,以及行为、条件、控制和装饰器之间的区别。 [待校准@2566]
注意: 以下未列出 SingleTrigger
BT节点,因为它不包含任何参数。 [待校准@2567]
考虑查看使用Groot可视化和修改行为树的 Groot与行为树互动 [待校准@1432] 教程。 [待校准@2531]
Action插件
- Wait [待校准@2347]
- Spin [待校准@2331]
- BackUp
- ComputePathToPose [待校准@2269]
- FollowPath [待校准@2283]
- NavigateToPose [待校准@2300]
- ClearEntireCostmap [待校准@2253]
- ClearCostmapExceptRegion [待校准@2250]
- ClearCostmapAroundRobot [待校准@2243]
- ReinitializeGlobalLocalization [待校准@2312]
- TruncatePath [待校准@2336]
- PlannerSelector [待校准@2304]
- ControllerSelector [待校准@2273]
- GoalCheckerSelector [待校准@2290]
- NavigateThroughPoses [待校准@2298]
- ComputePathThroughPoses [待校准@2255]
- RemovePassedGoals [待校准@2316]
- CancelControl
条件插件 [待校准@2569]
控制插件
装饰插件
Example
此行为树定期以1Hz重新规划全局路径,并且它还具有恢复操作。 [待校准@2572]
<root main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<RecoveryNode number_of_retries="6" name="NavigateRecovery">
<PipelineSequence name="NavigateWithReplanning">
<RateController hz="1.0">
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
<ComputePathToPose goal="{goal}" path="{path}" planner_id="GridBased"/>
<ReactiveFallback name="ComputePathToPoseRecoveryFallback">
<GoalUpdated/>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</ReactiveFallback>
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="FollowPath">
<FollowPath path="{path}" controller_id="FollowPath"/>
<ReactiveFallback name="FollowPathRecoveryFallback">
<GoalUpdated/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
</ReactiveFallback>
</RecoveryNode>
</PipelineSequence>
<ReactiveFallback name="RecoveryFallback">
<GoalUpdated/>
<RoundRobin name="RecoveryActions">
<Sequence name="ClearingActions">
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
</Sequence>
<Spin spin_dist="1.57"/>
<Wait wait_duration="5"/>
<BackUp backup_dist="0.15" backup_speed="0.025"/>
</RoundRobin>
</ReactiveFallback>
</RecoveryNode>
</BehaviorTree>
</root>