Skip to content

Commit a16d203

Browse files
authored
Merge branch 'master' into groot2
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
2 parents 14f5d54 + bd5a99e commit a16d203

14 files changed

Lines changed: 1210 additions & 13 deletions

behavior_trees/trees/nav_through_poses_recovery.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ In nominal execution, this will replan the path at every 3 seconds and pass that
1717
The planner though is now ``ComputePathThroughPoses`` taking a vector, ``goals``, rather than a single pose ``goal`` to plan to.
1818
The ``RemovePassedGoals`` node is used to cull out ``goals`` that the robot has passed on its path.
1919
In this case, it is set to remove a pose from the poses when the robot is within ``0.5`` of the goal and it is the next goal in the list.
20+
Additionally, it records the status of each waypoint (e.g. ``PENDING``, ``COMPLETED``, ``SKIPPED`` or ``FAILED``) in the ``waypoint_statuses``.
2021
This is implemented such that replanning can be computed after the robot has passed by some of the intermediary poses and not continue to try to replan through them in the future.
2122
This time, if the planner fails, it will trigger contextually aware recoveries in its subtree, clearing the global costmap.
2223
Additional recoveries can be added here for additional context-specific recoveries, such as trying another algorithm.
@@ -46,7 +47,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
4647
<RateController hz="0.333">
4748
<RecoveryNode number_of_retries="1" name="ComputePathThroughPoses">
4849
<ReactiveSequence>
49-
<RemovePassedGoals input_goals="{goals}" output_goals="{goals}" radius="0.7"/>
50+
<RemovePassedGoals input_goals="{goals}" output_goals="{goals}" radius="0.7" input_waypoint_statuses="{waypoint_statuses}" output_waypoint_statuses="{waypoint_statuses}"/>
5051
<ComputePathThroughPoses goals="{goals}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
5152
</ReactiveSequence>
5253
<Sequence>

commander_api/index.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ New as of September 2023: the simple navigator constructor will accept a `namesp
8989
+---------------------------------------+----------------------------------------------------------------------------+
9090
| cancelTask() | Cancel an ongoing task, including route tasks. |
9191
+---------------------------------------+----------------------------------------------------------------------------+
92-
| isTaskComplete(trackingRoute=False) | Checks if task is complete yet, times out at ``100ms``. Returns |
93-
| | ``True`` if completed and ``False`` if still going. If checking a route |
94-
| | tracking task, set default argument to ``True``. |
92+
| isTaskComplete(task=RunningTask.NONE) | Checks if task is complete yet, times out at ``100ms``. Returns |
93+
| | ``True`` if completed and ``False`` if still going. Provide the task ID |
94+
| | from the long-running task (follow path, compute and track route, etc) |
9595
+---------------------------------------+----------------------------------------------------------------------------+
96-
| getFeedback(trackingRoute=False) | Gets feedback from task, returns action server feedback msg. |
97-
| | If getting feedback on a tracking task, set default argument to ``True``. |
96+
| getFeedback(task=RunningTask.NONE) | Gets feedback from task, returns action server feedback msg. |
97+
| | provide the task ID for the task you are requesting. |
9898
+---------------------------------------+----------------------------------------------------------------------------+
9999
| getResult() | Gets final result of task, to be called after ``isTaskComplete`` |
100100
| | returns ``True``. Returns action server result msg. |
@@ -105,6 +105,12 @@ New as of September 2023: the simple navigator constructor will accept a `namesp
105105
| getPathThroughPoses(start, goals, | Gets a path through a starting to a set of goals, a list |
106106
| planner_id='', use_start=False) | of ``PoseStamped``, ``nav_msgs/Path``. |
107107
+---------------------------------------+----------------------------------------------------------------------------+
108+
| getRoute(start, goal, | Gets a route from a set start and goal nodeIDs or PoseStamped. |
109+
| use_start=False) | Use Start if given, otherwises uses TF to obtain robot pose. |
110+
+---------------------------------------+----------------------------------------------------------------------------+
111+
| getAndTrackRoute(start, goal, | Gets a route from a set of start and goal NodeIDs or PoseStamped. |
112+
| use_start=False) | Uses start if given, otherwise uses TF to obtain the robot pose. |
113+
+---------------------------------------+----------------------------------------------------------------------------+
108114
| dockRobot(dock_pose, dock_type) | Attempts to dock the robot at a given docking pose and type, without using |
109115
| | docking database of known docks. |
110116
+---------------------------------------+----------------------------------------------------------------------------+
@@ -231,6 +237,7 @@ The ``nav2_simple_commander`` has a few examples to highlight the API functions
231237
- ``example_waypoint_follower.py`` - Demonstrates the waypoint following capabilities of the navigator, as well as a number of auxiliary methods.
232238
- ``example_follow_path.py`` - Demonstrates the path following capabilities of the navigator, as well as a number of auxiliary methods like path smoothing.
233239
- ``example_assisted_teleop.py`` - Demonstrates the assisted teleop capabilities of the navigator.
240+
- ``example_route.py`` - Demonstrates the route server capabilities of the navigator.
234241

235242
The ``nav2_simple_commander`` has a few demonstrations to highlight a couple of simple autonomy applications you can build using the API:
236243

concepts/index.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ Recoveries are used to get the robot out of a bad situation or attempt to deal w
107107
Smoothers can be used for additional quality improvements of the planned path.
108108
In this section, the general concepts around them and their uses in this project are analyzed.
109109

110-
Planner, Controller, Smoother and Recovery Servers
111-
==================================================
112-
Four of the action servers in this project are the planner, behavior, smoother and controller servers.
110+
Planner, Controller, Smoother, Route, and Behavior Servers
111+
==========================================================
112+
113+
Four of the action servers in this project are the planner, behavior, smoother, route, and controller servers.
113114

114115
These action servers are used to host a map of algorithm plugins to complete various tasks.
115116
They also host the environmental representation used by the algorithm plugins to compute their outputs.
@@ -131,6 +132,10 @@ This is done because of the wide variety of behavior actions that may be created
131132
The behavior server also contains a costmap subscriber to the local costmap, receiving real-time updates from the controller server, to compute its tasks.
132133
We do this to avoid having multiple instances of the local costmap which are computationally expensive to duplicate.
133134

135+
The route server does not contain multiple "routing algorithms" like the planner or controller servers.
136+
Instead, it computes a route using a navigation graph using a set of plugins for scoring edges in the graph, parsing graph files, and performing operations along the route, if necessary.
137+
Rather than freespace planning, this computes a route using a graph that can be generated to represent lanes, areas the robot is allowed to navigate, a teach-and-repeat route, urban roadways, and more.
138+
134139
Alternatively, since the BT nodes are trivial plugins calling an action, new BT nodes can be created to call other action servers with other action types.
135140
It is advisable to use the provided servers if possible at all times.
136141
If, due to the plugin or action interfaces, a new server is needed, that can be sustained with the framework.
@@ -173,7 +178,7 @@ However, many classes of controllers and local planners exist.
173178
It is the goal of this project that all controller algorithms can be plugins in this server for common research and industrial tasks.
174179

175180
Behaviors
176-
==========
181+
=========
177182

178183
Recovery behaviors are a mainstay of fault-tolerant systems.
179184
The goal of recoveries are to deal with unknown or failure conditions of the system and autonomously handle them.
@@ -200,6 +205,13 @@ Use of a separate smoother over one that is included as part of a planner is adv
200205
The general task in Nav2 for a smoother is to receive a path and return its improved version.
201206
However, for different input paths, criteria of the improvements and methods of acquiring them exist, creating space for a multitude of smoothers that can be registered in this server.
202207

208+
Route
209+
=====
210+
211+
The route server is a specialized planner that computes a route using a navigation graph, rather than the freespace costmap.
212+
The route is computed as the optimal way from the start to the goal through the set of nodes and directional edges in the pre-defined navigation graph.
213+
This navigation graph can be generated to represent lanes, areas the robot is allowed to navigate, a teach-and-repeat route, urban roadways, and more.
214+
203215
Robot Footprints
204216
================
205217

configuration/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ the best navigation performance.
3636
packages/configuring-waypoint-follower.rst
3737
packages/configuring-loopback-sim.rst
3838
packages/configuring-docking-server.rst
39+
packages/configuring-route-server.rst
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _bt_cancel_compute_and_track_route:
2+
3+
CancelComputeAndTrackRoute
4+
==========================
5+
6+
Used to cancel the compute and track route action that is part of the behavior server. The server address can be remapped using the ``server_name`` input port.
7+
8+
Input Ports
9+
-----------
10+
11+
:service_name:
12+
13+
====== =======
14+
Type Default
15+
------ -------
16+
string N/A
17+
====== =======
18+
19+
Description
20+
Service name, if not using default of ``compute_and_track_route`` due to remapping.
21+
22+
23+
:server_timeout:
24+
25+
====== =======
26+
Type Default
27+
------ -------
28+
double 10
29+
====== =======
30+
31+
Description
32+
Server timeout (ms).
33+
34+
Example
35+
-------
36+
37+
.. code-block:: xml
38+
39+
<CancelComputeAndTrackRoute server_name="compute_and_track_route" server_timeout="10"/>
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
.. _bt_compute_and_track_route_action:
2+
3+
ComputeAndTrackRoute
4+
====================
5+
6+
Invokes the ComputeAndTrackRoute ROS 2 action server, which is implemented by the nav2_route_ module.
7+
The server address can be remapped using the ``server_name`` input port.
8+
9+
.. _nav2_route: https://github.com/ros-navigation/navigation2/tree/main/nav2_route
10+
11+
Input Ports
12+
-----------
13+
:start:
14+
15+
===================================== =======
16+
Type Default
17+
------------------------------------- -------
18+
geometry_msgs::msg::PoseStamped N/A
19+
===================================== =======
20+
21+
Description
22+
Start pose. Optional. Only used if not left empty. Takes in a blackboard variable, e.g. "{start}".
23+
24+
:goal:
25+
26+
===================================== =======
27+
Type Default
28+
------------------------------------- -------
29+
geometry_msgs::msg::PoseStamped N/A
30+
===================================== =======
31+
32+
Description
33+
Goal pose. Takes in a blackboard variable, e.g. "{goal}".
34+
35+
:start_id:
36+
37+
===================================== =======
38+
Type Default
39+
------------------------------------- -------
40+
int N/A
41+
===================================== =======
42+
43+
Description
44+
Start node ID to use.
45+
46+
:goal_id:
47+
48+
===================================== =======
49+
Type Default
50+
------------------------------------- -------
51+
int N/A
52+
===================================== =======
53+
54+
Description
55+
Goal node ID to use.
56+
57+
:use_start:
58+
59+
============== =======
60+
Type Default
61+
-------------- -------
62+
bool false
63+
============== =======
64+
65+
Description
66+
Whether to use the start or use TF to obtain the robot's start pose.
67+
68+
:use_poses:
69+
70+
============== =======
71+
Type Default
72+
-------------- -------
73+
bool false
74+
============== =======
75+
76+
Description
77+
Whether to use the start and goal poses or start and goal node IDs.
78+
79+
:server_name:
80+
81+
============== =======
82+
Type Default
83+
-------------- -------
84+
string N/A
85+
============== =======
86+
87+
Description
88+
Action server name.
89+
90+
91+
:server_timeout:
92+
93+
============== =======
94+
Type Default
95+
-------------- -------
96+
double 10
97+
============== =======
98+
99+
Description
100+
Action server timeout (ms).
101+
102+
Output Ports
103+
------------
104+
105+
:execution_time:
106+
107+
================================= =======
108+
Type Default
109+
--------------------------------- -------
110+
builtin_interfaces::msg::Duration N/A
111+
================================= =======
112+
113+
Description
114+
Time it took to compute the route.
115+
116+
:error_code_id:
117+
118+
============== =======
119+
Type Default
120+
-------------- -------
121+
uint16 N/A
122+
============== =======
123+
124+
Description
125+
Compute route error code. See ``ComputeAndTrackRoute`` action message for the enumerated set of error codes.
126+
127+
:error_msg:
128+
129+
============== =======
130+
Type Default
131+
-------------- -------
132+
string N/A
133+
============== =======
134+
135+
Description
136+
Compute route error message. See ``ComputeAndTrackRoute`` action message for the enumerated set of error codes.
137+
138+
Example
139+
-------
140+
141+
.. code-block:: xml
142+
143+
<ComputeAndTrackRoute start="{start}" goal="{goal}" use_poses="{true}" use_start="{true}" server_name="ComputeAndTrackRoute" server_timeout="10"
144+
error_code_id="{compute_route_error_code}" error_msg="{compute_route_error_msg}"/>

0 commit comments

Comments
 (0)