Skip to content

Commit 76d5084

Browse files
Add IsGoalNearby bt node (#842)
* Add IsGoalNearby bt node Signed-off-by: Jakubach <jakubach@gmail.com> * Change default value of proximity_threshold Signed-off-by: Jakubach <jakubach@gmail.com> * Update description of max_robot_pose_search_dist Co-authored-by: Steve Macenski <stevenmacenski@gmail.com> Signed-off-by: Jakub Chudziński <jakubach@gmail.com> --------- Signed-off-by: Jakubach <jakubach@gmail.com> Signed-off-by: Jakub Chudziński <jakubach@gmail.com> Co-authored-by: Steve Macenski <stevenmacenski@gmail.com>
1 parent 736d6ca commit 76d5084

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
.. _bt_is_goal_nearby_condition:
2+
3+
IsGoalNearby
4+
============
5+
6+
Checks if the robot is near the goal by computing the remaining path length from the robot's current position to the goal. Returns SUCCESS when the remaining path length is less than the proximity threshold, otherwise returns FAILURE.
7+
8+
Parameter
9+
---------
10+
11+
:transform_tolerance:
12+
13+
Defined and declared in :ref:`configuring_bt_navigator`.
14+
15+
Example
16+
^^^^^^^
17+
.. code-block:: yaml
18+
19+
bt_navigator:
20+
ros__parameters:
21+
# other bt_navigator parameters
22+
transform_tolerance: 0.1
23+
24+
Input Ports
25+
-----------
26+
27+
:path:
28+
29+
==================================== =======
30+
Type Default
31+
------------------------------------ -------
32+
nav_msgs::msg::Path N/A
33+
==================================== =======
34+
35+
Description
36+
The planned path to evaluate.
37+
38+
:proximity_threshold:
39+
40+
====== =======
41+
Type Default
42+
------ -------
43+
double 1.0
44+
====== =======
45+
46+
Description
47+
The remaining path length (in meters) considered as "nearby". When the remaining distance along the path is less than this threshold, the condition returns SUCCESS.
48+
49+
:max_robot_pose_search_dist:
50+
51+
====== =======
52+
Type Default
53+
------ -------
54+
double -1.0
55+
====== =======
56+
57+
Description
58+
Maximum forward integrated distance along the path (starting from the last detected pose) to bound the search for the closest pose to the robot. When set to a negative value (default), the entire path is searched every time. Setting this to a positive value (e.g., 1.0-2.0 meters) can improve performance when this BT node is ticked frequently to address looping or crossed paths (when present).
59+
60+
:global_frame:
61+
62+
====== =======
63+
Type Default
64+
------ -------
65+
string "map"
66+
====== =======
67+
68+
Description
69+
The global reference frame.
70+
71+
:robot_base_frame:
72+
73+
====== =======
74+
Type Default
75+
------ -------
76+
string "base_link"
77+
====== =======
78+
79+
Description
80+
Robot base frame.
81+
82+
Example
83+
^^^^^^^
84+
85+
.. code-block:: xml
86+
87+
<IsGoalNearby path="{path}" proximity_threshold="1.0" />

configuration/packages/configuring-bt-xml.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Condition Plugins
8080
bt-plugins/conditions/GoalUpdated.rst
8181
bt-plugins/conditions/GlobalUpdatedGoal.rst
8282
bt-plugins/conditions/InitialPoseReceived.rst
83+
bt-plugins/conditions/IsGoalNearby.rst
8384
bt-plugins/conditions/IsStuck.rst
8485
bt-plugins/conditions/IsStopped.rst
8586
bt-plugins/conditions/TimeExpired.rst

plugins/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ Behavior Tree Nodes
619619
| `Is Pose Occupied Condition`_ | Maurice Alexander | Checks if a pose is |
620620
| | Purnawan | occupied. |
621621
+------------------------------------+--------------------+------------------------+
622+
| `Is Goal Nearby Condition`_ | Jakub Chudziński | Checks if the robot is |
623+
| | | near the goal based on |
624+
| | | remaining path length. |
625+
+------------------------------------+--------------------+------------------------+
622626

623627
.. _Goal Reached Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/goal_reached_condition.cpp
624628
.. _Goal Updated Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/goal_updated_condition.cpp
@@ -640,6 +644,7 @@ Behavior Tree Nodes
640644
.. _Is Battery Charging Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/is_battery_charging_condition.cpp
641645
.. _Are Poses Near Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/are_poses_near_condition.cpp
642646
.. _Is Pose Occupied Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/is_pose_occupied_condition.cpp
647+
.. _Is Goal Nearby Condition: https://github.com/ros-navigation/navigation2/tree/main/nav2_behavior_tree/plugins/condition/is_goal_nearby_condition.cpp
643648

644649
+--------------------------+---------------------+----------------------------------+
645650
| Decorator Plugin Name | Creator | Description |

0 commit comments

Comments
 (0)