Skip to content

Commit 2a291d7

Browse files
authored
Move isStopped, isPathValid, and isPoseOccupied from condition nodes to action nodes (#885)
Signed-off-by: Maurice <mauricepurnawan@gmail.com>
1 parent 99b4776 commit 2a291d7

11 files changed

Lines changed: 50 additions & 42 deletions

behavior_trees/overview/detailed_behavior_tree_walkthrough.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ BTs are primarily defined in XML. The tree shown above is represented in XML as
6565
</Inverter>
6666
<IsGoalNearby path="{path}" proximity_threshold="4.0" max_robot_pose_search_dist="1.5"/>
6767
<TruncatePathLocal input_path="{path}" output_path="{remaining_path}" distance_forward="-1" distance_backward="0.0" />
68-
<IsPathValid path="{remaining_path}"/>
68+
<ValidatePath path="{remaining_path}"/>
6969
</ReactiveSequence>
7070
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
7171
</Fallback>
@@ -172,7 +172,7 @@ The XML of this subtree is as follows:
172172
</Inverter>
173173
<IsGoalNearby path="{path}" proximity_threshold="4.0" max_robot_pose_search_dist="1.5"/>
174174
<TruncatePathLocal input_path="{path}" output_path="{remaining_path}" distance_forward="-1" distance_backward="0.0" />
175-
<IsPathValid path="{remaining_path}"/>
175+
<ValidatePath path="{remaining_path}"/>
176176
</ReactiveSequence>
177177
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
178178
</Fallback>

behavior_trees/trees/nav_through_poses_recovery.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
5656
</Inverter>
5757
<IsGoalNearby path="{path}" proximity_threshold="4.0" max_robot_pose_search_dist="1.5"/>
5858
<TruncatePathLocal input_path="{path}" output_path="{remaining_path}" distance_forward="-1" distance_backward="0.0" />
59-
<IsPathValid path="{remaining_path}"/>
59+
<ValidatePath path="{remaining_path}"/>
6060
</ReactiveSequence>
6161
<ReactiveSequence>
6262
<RemovePassedGoals input_goals="{goals}" output_goals="{goals}" radius="0.7" input_waypoint_statuses="{waypoint_statuses}" output_waypoint_statuses="{waypoint_statuses}"/>

behavior_trees/trees/nav_to_pose_recovery.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
5252
</Inverter>
5353
<IsGoalNearby path="{path}" proximity_threshold="4.0" max_robot_pose_search_dist="1.5"/>
5454
<TruncatePathLocal input_path="{path}" output_path="{remaining_path}" distance_forward="-1" distance_backward="0.0" />
55-
<IsPathValid path="{remaining_path}"/>
55+
<ValidatePath path="{remaining_path}"/>
5656
</ReactiveSequence>
5757
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
5858
</Fallback>

behavior_trees/trees/nav_to_pose_with_consistent_replanning_and_if_path_becomes_invalid.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
4848
</Inverter>
4949
<IsGoalNearby path="{path}" proximity_threshold="4.0" max_robot_pose_search_dist="1.5"/>
5050
<TruncatePathLocal input_path="{path}" output_path="{remaining_path}" distance_forward="-1" distance_backward="0.0" />
51-
<IsPathValid path="{remaining_path}"/>
51+
<ValidatePath path="{remaining_path}"/>
5252
</ReactiveSequence>
5353
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
5454
</Fallback>

behavior_trees/trees/navigate_on_route_graph_w_recovery.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This behavior tree implements a different style of navigation than the other ver
77
Rather than using a freespace planner ``ComputePathToPose`` to plan a complete path to the goal, this behavior tree instead uses the Route Server to find a route to the goal through a pre-defined navigation graph.
88
This can be useful for navigating in large-scale environments where real-time planning in freespace for a long distance is not computationally feasible, where a map of the entire space is not possible to plan within, or where deterministic behavior and limited navigation zones/lanes/routes are demanded.
99

10-
This tree computes a route through the environment using the ``ComputeRoute`` node which is executed on initialization and when either the goal is updated due to preemption (``GlobalUpdatedGoal``) or the current route path is invalid due to collision (``isPathValid``).
10+
This tree computes a route through the environment using the ``ComputeRoute`` node which is executed on initialization and when either the goal is updated due to preemption (``GlobalUpdatedGoal``) or the current route path is invalid due to collision (``ValidatePath``).
1111
After which, if the robot's starting pose is too far from the first route node in the graph solution, it will use freespace planning to connect the robot's current pose to the first node in the route.
1212
This is called the ``first mile`` and is computed using the ``ComputePathToPose`` node.
1313
This may be removed if navigation only on the graph is required and you know that the robot will always be located on or near the graph.
@@ -35,7 +35,7 @@ For a detailed description of the role of the selector nodes, recovery behaviors
3535
<Inverter>
3636
<GlobalUpdatedGoal/>
3737
</Inverter>
38-
<IsPathValid path="{path}"/> <!-- Base it on the complete connected 'path', not simply the 'route_path' -->
38+
<ValidatePath path="{path}"/> <!-- Base it on the complete connected 'path', not simply the 'route_path' -->
3939
</ReactiveSequence>
4040
<Sequence name="ComputeAndSmoothRoute">
4141
<!-- Compute the route -->

configuration/packages/bt-plugins/conditions/IsPoseOccupied.rst renamed to configuration/packages/bt-plugins/actions/CheckPoseOccupancy.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. _bt_is_pose_occupied_condition:
1+
.. _bt_check_pose_occupancy_action:
22

3-
IsPoseOccupied
4-
==============
3+
CheckPoseOccupancy
4+
==================
55

6-
Checks to see if the pose is occupied. If it is occupied, the condition returns SUCCESS, otherwise
6+
Checks to see if the pose is occupied. If it is occupied, it returns SUCCESS, otherwise
77
it returns FAILURE.
88

99
Input Ports
@@ -81,4 +81,4 @@ Example
8181

8282
.. code-block:: xml
8383
84-
<IsPoseOccupied server_timeout="10" pose="{goal}"/>
84+
<CheckPoseOccupancy server_timeout="10" pose="{goal}"/>

configuration/packages/bt-plugins/conditions/IsStopped.rst renamed to configuration/packages/bt-plugins/actions/CheckStopStatus.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.. _bt_is_stopped_condition:
1+
.. _bt_check_stop_status_action:
22

3-
IsStopped
4-
=========
3+
CheckStopStatus
4+
===============
55

66
BT node that tracks robot odometry and returns SUCCESS if robot is considered stopped for long enough,
77
RUNNING if stopped but not for long enough and FAILURE otherwise
@@ -36,4 +36,4 @@ Example
3636

3737
.. code-block:: xml
3838
39-
<IsStopped velocity_threshold="0.01" duration_stopped="1000"/>
39+
<CheckStopStatus velocity_threshold="0.01" duration_stopped="1000"/>

configuration/packages/bt-plugins/conditions/IsPathValid.rst renamed to configuration/packages/bt-plugins/actions/ValidatePath.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
.. _bt_is_path_valid_condition:
1+
.. _bt_validate_path_action:
22

3-
IsPathValid
4-
===========
3+
ValidatePath
4+
============
55

66
Checks to see if the global path is valid. If there is an
7-
obstacle along the path, the condition returns FAILURE, otherwise
7+
obstacle along the path, it returns FAILURE, otherwise
88
it returns SUCCESS. Optionally checks specific costmap layers and
99
can use a custom footprint for validation.
1010

@@ -114,7 +114,7 @@ Example
114114

115115
.. code-block:: xml
116116
117-
<IsPathValid
117+
<ValidatePath
118118
server_timeout="10"
119119
path="{path}"
120120
max_cost="100"
@@ -128,7 +128,7 @@ With custom footprint:
128128

129129
.. code-block:: xml
130130
131-
<IsPathValid
131+
<ValidatePath
132132
path="{path}"
133133
footprint="[[0.5,0.5],[0.5,-0.5],[-0.5,-0.5],[-0.5,0.5]]"
134134
collision_poses="{collision_poses}" />
@@ -137,7 +137,7 @@ Checking a specific costmap layer:
137137

138138
.. code-block:: xml
139139
140-
<IsPathValid
140+
<ValidatePath
141141
path="{path}"
142142
layer_name="obstacle_layer"
143143
check_full_path="true"

configuration/packages/configuring-bt-xml.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Action Plugins
6767
bt-plugins/actions/ToggleCollisionMonitor.rst
6868
bt-plugins/actions/FollowObject.rst
6969
bt-plugins/actions/CancelFollowObject.rst
70+
bt-plugins/actions/ValidatePath.rst
71+
bt-plugins/actions/CheckPoseOccupancy.rst
72+
bt-plugins/actions/CheckStopStatus.rst
7073

7174
Condition Plugins
7275
*****************
@@ -82,11 +85,8 @@ Condition Plugins
8285
bt-plugins/conditions/InitialPoseReceived.rst
8386
bt-plugins/conditions/IsGoalNearby.rst
8487
bt-plugins/conditions/IsStuck.rst
85-
bt-plugins/conditions/IsStopped.rst
8688
bt-plugins/conditions/TimeExpired.rst
8789
bt-plugins/conditions/IsBatteryLow.rst
88-
bt-plugins/conditions/IsPathValid.rst
89-
bt-plugins/conditions/IsPoseOccupied.rst
9090
bt-plugins/conditions/IsWithinPathTrackingBounds.rst
9191
bt-plugins/conditions/PathExpiringTimer.rst
9292
bt-plugins/conditions/AreErrorCodesPresent.rst

migration/Kilted.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,3 +833,14 @@ Refactored Inflation layer powered by OpenMP
833833

834834
The new implementation replaces the previous queue-based cell iteration with a Felzenszwalb-Huttenlocher distance transform algorithm.
835835
When OpenMP is not available at compile time, the layer falls back to single-threaded operation.
836+
837+
Move isStopped, isPathValid, and isPoseOccupied from condition nodes to action nodes
838+
------------------------------------------------------------------------------------
839+
840+
In `PR 5991 <https://github.com/ros-navigation/navigation2/pull/5991>`_, the following nodes were moved from condition nodes to action nodes and renamed:
841+
842+
- `IsStopped` is now `CheckStopStatus`
843+
- `IsPathValid` is now `ValidatePath`
844+
- `IsPoseOccupied` is now `CheckPoseOccupancy`
845+
846+
This change was made because these behavior tree nodes may return RUNNING or require more time to complete, making them unsuitable for behavior tree that are expected to be ticked at 100 Hz.

0 commit comments

Comments
 (0)