Skip to content

Commit f1eb642

Browse files
committed
refactor: change parameter naming style
Signed-off-by: AJedancov <andrei.jedancov@gmail.com>
1 parent 22e48bc commit f1eb642

60 files changed

Lines changed: 258 additions & 240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-535 KB
Loading
60.9 KB
Loading
15.1 KB
Loading
102 KB
Loading
-718 KB
Loading
100 KB
Loading
21.2 KB
Loading

behavior_trees/overview/detailed_behavior_tree_walkthrough.rst

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ BTs are primarily defined in XML. The tree shown above is represented in XML as
4747

4848
.. code-block:: xml
4949
50-
<root BTCPP_format="4" main_tree_to_execute="MainTree">
51-
<BehaviorTree ID="MainTree">
50+
<root BTCPP_format="4" main_tree_to_execute="NavigateToPoseWReplanningAndRecovery">
51+
<BehaviorTree ID="NavigateToPoseWReplanningAndRecovery">
5252
<RecoveryNode number_of_retries="6" name="NavigateRecovery">
5353
<PipelineSequence name="NavigateWithReplanning">
54-
<ControllerSelector selected_controller="{selected_controller}" default_controller="FollowPath" topic_name="controller_selector"/>
55-
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
54+
<ProgressCheckerSelector selected_progress_checker="{selected_progress_checker}" default_progress_checker="progress_checker" topic_name="progress_checker_selector"/>
55+
<GoalCheckerSelector selected_goal_checker="{selected_goal_checker}" default_goal_checker="general_goal_checker" topic_name="goal_checker_selector"/>
56+
<PathHandlerSelector selected_path_handler="{selected_path_handler}" default_path_handler="path_handler" topic_name="path_handler_selector"/>
57+
<ControllerSelector selected_controller="{selected_controller}" default_controller="follow_path" topic_name="controller_selector"/>
58+
<PlannerSelector selected_planner="{selected_planner}" default_planner="grid_based" topic_name="planner_selector"/>
5659
<RateController hz="1.0">
5760
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
5861
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
@@ -79,8 +82,8 @@ BTs are primarily defined in XML. The tree shown above is represented in XML as
7982
<GoalUpdated/>
8083
<RoundRobin name="RecoveryActions">
8184
<Sequence name="ClearingActions">
82-
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
83-
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
85+
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
86+
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
8487
</Sequence>
8588
<Spin spin_dist="1.57" error_code_id="{spin_error_code}" error_msg="{spin_error_msg}"/>
8689
<Wait wait_duration="5.0" error_code_id="{wait_error_code}" error_msg="{wait_error_msg}"/>
@@ -129,7 +132,7 @@ This happens until the ``number_of_retries`` for the parent ``RecoveryNode`` is
129132
Navigation Subtree
130133
======================
131134

132-
Now that we have gone over the control flow between the ``Navigation`` subtree and the ``Recovery`` subtree, let's focus on the Navigation subtree.
135+
Now that we have gone over the control flow between the ``Navigation`` subtree and the ``Recovery`` subtree, let's focus on the ``Navigation`` subtree.
133136

134137
|
135138
@@ -142,26 +145,33 @@ The XML of this subtree is as follows:
142145

143146
.. code-block:: xml
144147
145-
<PipelineSequence name="NavigateWithReplanning">
146-
<ControllerSelector selected_controller="{selected_controller}" default_controller="FollowPath" topic_name="controller_selector"/>
147-
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
148-
<RateController hz="1.0">
149-
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
150-
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
151-
<Sequence>
152-
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
153-
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
154-
</Sequence>
155-
</RecoveryNode>
156-
</RateController>
157-
<RecoveryNode number_of_retries="1" name="FollowPath">
158-
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
159-
<Sequence>
160-
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
161-
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
162-
</Sequence>
163-
</RecoveryNode>
164-
</PipelineSequence>
148+
<root BTCPP_format="4" main_tree_to_execute="NavigateToPoseWReplanningAndRecovery">
149+
<BehaviorTree ID="NavigateToPoseWReplanningAndRecovery">
150+
<PipelineSequence name="NavigateWithReplanning">
151+
<ProgressCheckerSelector selected_progress_checker="{selected_progress_checker}" default_progress_checker="progress_checker" topic_name="progress_checker_selector"/>
152+
<GoalCheckerSelector selected_goal_checker="{selected_goal_checker}" default_goal_checker="general_goal_checker" topic_name="goal_checker_selector"/>
153+
<PathHandlerSelector selected_path_handler="{selected_path_handler}" default_path_handler="path_handler" topic_name="path_handler_selector"/>
154+
<ControllerSelector selected_controller="{selected_controller}" default_controller="follow_path" topic_name="controller_selector"/>
155+
<PlannerSelector selected_planner="{selected_planner}" default_planner="grid_based" topic_name="planner_selector"/>
156+
<RateController hz="1.0">
157+
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
158+
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
159+
<Sequence>
160+
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
161+
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
162+
</Sequence>
163+
</RecoveryNode>
164+
</RateController>
165+
<RecoveryNode number_of_retries="1" name="FollowPath">
166+
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
167+
<Sequence>
168+
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
169+
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
170+
</Sequence>
171+
</RecoveryNode>
172+
</PipelineSequence>
173+
</BehaviorTree>
174+
</root>
165175
166176
This subtree has two primary actions ``ComputePathToPose`` and ``FollowPath``.
167177
If either of these two actions fail, they will attempt to clear the failure contextually.
@@ -231,24 +241,28 @@ And the XML snippet:
231241

232242
.. code-block:: xml
233243
234-
<Sequence>
235-
<Fallback>
236-
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
237-
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
238-
</Fallback>
239-
<ReactiveFallback name="RecoveryFallback">
240-
<GoalUpdated/>
241-
<RoundRobin name="RecoveryActions">
242-
<Sequence name="ClearingActions">
243-
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
244-
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
245-
</Sequence>
246-
<Spin spin_dist="1.57" error_code_id="{spin_error_code}" error_msg="{spin_error_msg}"/>
247-
<Wait wait_duration="5.0" error_code_id="{wait_error_code}" error_msg="{wait_error_msg}"/>
248-
<BackUp backup_dist="0.30" backup_speed="0.15" error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
249-
</RoundRobin>
250-
</ReactiveFallback>
251-
</Sequence>
244+
<root BTCPP_format="4" main_tree_to_execute="NavigateToPoseWReplanningAndRecovery">
245+
<BehaviorTree ID="NavigateToPoseWReplanningAndRecovery">
246+
<Sequence>
247+
<Fallback>
248+
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
249+
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
250+
</Fallback>
251+
<ReactiveFallback name="RecoveryFallback">
252+
<GoalUpdated/>
253+
<RoundRobin name="RecoveryActions">
254+
<Sequence name="ClearingActions">
255+
<ClearEntireCostmap name="ClearLocalCostmap-Subtree" service_name="local_costmap/clear_entirely_local_costmap"/>
256+
<ClearEntireCostmap name="ClearGlobalCostmap-Subtree" service_name="global_costmap/clear_entirely_global_costmap"/>
257+
</Sequence>
258+
<Spin spin_dist="1.57" error_code_id="{spin_error_code}" error_msg="{spin_error_msg}"/>
259+
<Wait wait_duration="5.0" error_code_id="{wait_error_code}" error_msg="{wait_error_msg}"/>
260+
<BackUp backup_dist="0.30" backup_speed="0.15" error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
261+
</RoundRobin>
262+
</ReactiveFallback>
263+
</Sequence>
264+
</BehaviorTree>
265+
</root>
252266
253267
At the top level, a ``Sequence`` ensures the following steps are executed in order:
254268

behavior_trees/trees/follow_point.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ This behavior tree will execute infinitely in time until the navigation request
2020

2121
.. code-block:: xml
2222
23-
<root main_tree_to_execute="MainTree">
24-
<BehaviorTree ID="MainTree">
23+
<root BTCPP_format="4" main_tree_to_execute="FollowPoint">
24+
<BehaviorTree ID="FollowPoint">
2525
<PipelineSequence name="NavigateWithReplanning">
26-
<ControllerSelector selected_controller="{selected_controller}" default_controller="FollowPath" topic_name="controller_selector"/>
27-
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
26+
<ControllerSelector selected_controller="{selected_controller}" default_controller="follow_path" topic_name="controller_selector"/>
27+
<PlannerSelector selected_planner="{selected_planner}" default_planner="grid_based" topic_name="planner_selector"/>
2828
<RateController hz="1.0">
2929
<Sequence>
3030
<GoalUpdater input_goal="{goal}" output_goal="{updated_goal}">

behavior_trees/trees/nav_through_poses_recovery.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ Next, the recovery subtree will tick the costmap clearing operations, spinning,
3434
After each of the recoveries in the subtree, the main navigation subtree will be reattempted.
3535
If it continues to fail, the next recovery in the recovery subtree is ticked.
3636

37-
While this behavior tree does not make use of it, the ``PlannerSelector``, ``ControllerSelector``, ``GoalCheckerSelector``, ``ProgressCheckerSelector``, and ``PathHandlerSelector`` behavior tree nodes can also be helpful. Rather than hardcoding the algorithm to use (``GridBased`` and ``FollowPath``), these behavior tree nodes will allow a user to dynamically change the algorithm used in the navigation system via a ROS topic. It may be instead advisable to create different subtree contexts using condition nodes with specified algorithms in their most useful and unique situations. However, the selector nodes can be a useful way to change algorithms from an external application rather than via internal behavior tree control flow logic. It is better to implement changes through behavior tree methods, but we understand that many professional users have external applications to dynamically change settings of their navigators.
37+
While this behavior tree does not make use of it, the ``PlannerSelector``, ``ControllerSelector``, ``GoalCheckerSelector``, ``ProgressCheckerSelector``, and ``PathHandlerSelector`` behavior tree nodes can also be helpful. Rather than hardcoding the algorithm to use (``grid_based`` and ``follow_path``), these behavior tree nodes will allow a user to dynamically change the algorithm used in the navigation system via a ROS topic. It may be instead advisable to create different subtree contexts using condition nodes with specified algorithms in their most useful and unique situations. However, the selector nodes can be a useful way to change algorithms from an external application rather than via internal behavior tree control flow logic. It is better to implement changes through behavior tree methods, but we understand that many professional users have external applications to dynamically change settings of their navigators.
3838

3939
.. code-block:: xml
4040
41-
<root BTCPP_format="4" main_tree_to_execute="MainTree">
42-
<BehaviorTree ID="MainTree">
41+
<root BTCPP_format="4" main_tree_to_execute="NavigateThroughPosesWReplanningAndRecovery">
42+
<BehaviorTree ID="NavigateThroughPosesWReplanningAndRecovery">
4343
<RecoveryNode number_of_retries="6" name="NavigateRecovery">
4444
<PipelineSequence name="NavigateWithReplanning">
4545
<ProgressCheckerSelector selected_progress_checker="{selected_progress_checker}" default_progress_checker="progress_checker" topic_name="progress_checker_selector"/>
4646
<GoalCheckerSelector selected_goal_checker="{selected_goal_checker}" default_goal_checker="general_goal_checker" topic_name="goal_checker_selector"/>
47-
<PathHandlerSelector selected_path_handler="{selected_path_handler}" default_path_handler="PathHandler" topic_name="path_handler_selector" />
48-
<ControllerSelector selected_controller="{selected_controller}" default_controller="FollowPath" topic_name="controller_selector"/>
49-
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
47+
<PathHandlerSelector selected_path_handler="{selected_path_handler}" default_path_handler="path_handler" topic_name="path_handler_selector"/>
48+
<ControllerSelector selected_controller="{selected_controller}" default_controller="follow_path" topic_name="controller_selector"/>
49+
<PlannerSelector selected_planner="{selected_planner}" default_planner="grid_based" topic_name="planner_selector"/>
5050
<RateController hz="0.333">
5151
<RecoveryNode number_of_retries="1" name="ComputePathThroughPoses">
5252
<ReactiveSequence>

0 commit comments

Comments
 (0)