Skip to content

Commit

Permalink
Document behavior tree error_code_name_prefixes, error_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
aosmw committed Aug 31, 2024
1 parent b13e200 commit 47c9846
Show file tree
Hide file tree
Showing 21 changed files with 274 additions and 112 deletions.
4 changes: 2 additions & 2 deletions behavior_trees/trees/follow_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ This behavior tree will execute infinitely in time until the navigation request
<RateController hz="1.0">
<Sequence>
<GoalUpdater input_goal="{goal}" output_goal="{updated_goal}">
<ComputePathToPose goal="{updated_goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}"/>
<ComputePathToPose goal="{updated_goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
</GoalUpdater>
<TruncatePath distance="1.0" input_path="{path}" output_path="{truncated_path}"/>
</Sequence>
</RateController>
<KeepRunningUntilFailure>
<FollowPath path="{truncated_path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}"/>
<FollowPath path="{truncated_path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
</KeepRunningUntilFailure>
</PipelineSequence>
</BehaviorTree>
Expand Down
8 changes: 4 additions & 4 deletions behavior_trees/trees/nav_through_poses_recovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
<RecoveryNode number_of_retries="1" name="ComputePathThroughPoses">
<ReactiveSequence>
<RemovePassedGoals input_goals="{goals}" output_goals="{goals}" radius="0.7"/>
<ComputePathThroughPoses goals="{goals}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}"/>
<ComputePathThroughPoses goals="{goals}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
</ReactiveSequence>
<Sequence>
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
Expand All @@ -56,7 +56,7 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="FollowPath">
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}"/>
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
<Sequence>
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
Expand All @@ -75,9 +75,9 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
<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" error_code_id="{spin_error_code}"/>
<Spin spin_dist="1.57" error_code_id="{spin_error_code} error_msg="{spin_error_msg}"/>
<Wait wait_duration="5.0"/>
<BackUp backup_dist="0.30" backup_speed="0.05" error_code_id="{backup_error_code}"/>
<BackUp backup_dist="0.30" backup_speed="0.05" error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
</RoundRobin>
</ReactiveFallback>
</Sequence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ In conclusion, this particular BT would serve, both as an example and ready-to-u
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
<RateController hz="1.0">
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}"/>
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</RecoveryNode>
</RateController>
Expand All @@ -60,7 +60,7 @@ In conclusion, this particular BT would serve, both as an example and ready-to-u
</RetryUntilSuccessful>
</PathLongerOnApproach>
<RecoveryNode number_of_retries="1" name="FollowPath">
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}"/>
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
</RecoveryNode>
</ReactiveSequence>
Expand Down
8 changes: 4 additions & 4 deletions behavior_trees/trees/nav_to_pose_recovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
<PlannerSelector selected_planner="{selected_planner}" default_planner="GridBased" topic_name="planner_selector"/>
<RateController hz="1.0">
<RecoveryNode number_of_retries="1" name="ComputePathToPose">
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}"/>
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
<Sequence>
<WouldAPlannerRecoveryHelp error_code="{compute_path_error_code}"/>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</Sequence>
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="FollowPath">
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}"/>
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
<Sequence>
<WouldAControllerRecoveryHelp error_code="{follow_path_error_code}"/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
Expand All @@ -69,9 +69,9 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
<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" error_code_id="{spin_error_code}"/>
<Spin spin_dist="1.57" error_code_id="{spin_error_code}" error_msg="{spin_error_msg}"/>
<Wait wait_duration="5.0"/>
<BackUp backup_dist="0.30" backup_speed="0.05" error_code_id="{backup_code_id}"/>
<BackUp backup_dist="0.30" backup_speed="0.05" error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
</RoundRobin>
</ReactiveFallback>
</Sequence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ While this behavior tree does not make use of it, the ``PlannerSelector``, ``Con
</Inverter>
<IsPathValid path="{path}"/>
</ReactiveSequence>
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}"/>
<ComputePathToPose goal="{goal}" path="{path}" planner_id="{selected_planner}" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
</Fallback>
<ClearEntireCostmap name="ClearGlobalCostmap-Context" service_name="global_costmap/clear_entirely_global_costmap"/>
</RecoveryNode>
</RateController>
<RecoveryNode number_of_retries="1" name="RecoveryFollowPath">
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}"/>
<FollowPath path="{path}" controller_id="{selected_controller}" error_code_id="{follow_path_error_code}" error_msg="{follow_path_error_msg}"/>
<ClearEntireCostmap name="ClearLocalCostmap-Context" service_name="local_costmap/clear_entirely_local_costmap"/>
</RecoveryNode>
</PipelineSequence>
Expand Down
22 changes: 17 additions & 5 deletions configuration/packages/bt-plugins/actions/AssistedTeleop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Input Ports
====== =======

Description
Action server name.
Action server name.

:server_timeout:

Expand All @@ -55,22 +55,34 @@ Input Ports
====== =======

Description
Action server timeout (ms).
Action server timeout (ms).

:error_code_id:

============== =======
Type Default
-------------- -------
uint16 N/A
uint16 N/A
============== =======

Description
Assisted teleop error code. See ``AssistedTeleop`` action message for the enumerated set of error codes.
Assisted teleop error code. See ``AssistedTeleop`` action message for the enumerated set of error codes.

:error_msg:

============== =======
Type Default
-------------- -------
uint16 N/A
============== =======

Description
Assisted teleop error message. See ``AssistedTeleop`` action message for the enumerated set of error codes.

Example
-------

.. code-block:: xml
<AssistedTeleop is_recovery="false" server_name="assisted_teleop_server" server_timeout="10" error_code_id="{assisted_teleop_error_code}"/>
<AssistedTeleop is_recovery="false" server_name="assisted_teleop_server" server_timeout="10"
error_code_id="{assisted_teleop_error_code}" error_msg="{assisted_teleop_error_msg}"/>
26 changes: 19 additions & 7 deletions configuration/packages/bt-plugins/actions/BackUp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Input Ports
====== =======

Description
Total distance to backup (m).
Total distance to backup (m).

:backup_speed:

Expand All @@ -32,7 +32,7 @@ Input Ports
====== =======

Description
Backup speed (m/s).
Backup speed (m/s).

:time_allowance:

Expand All @@ -54,7 +54,7 @@ Input Ports
====== =======

Description
Action server name.
Action server name.

:server_timeout:

Expand All @@ -65,7 +65,7 @@ Input Ports
====== =======

Description
Action server timeout (ms).
Action server timeout (ms).

Output Ports
------------
Expand All @@ -75,15 +75,27 @@ Output Ports
============== =======
Type Default
-------------- -------
uint16 N/A
uint16 N/A
============== =======

Description
Backup error code. See ``BackUp`` action message for the enumerated set of error codes.
Backup error code. See ``BackUp`` action message for the enumerated set of error codes.

:error_msg:

============== =======
Type Default
-------------- -------
string N/A
============== =======

Description
Backup error message. See ``BackUp`` action message for the enumerated set of error codes.

Example
-------

.. code-block:: xml
<BackUp backup_dist="-0.2" backup_speed="0.05" server_name="backup_server" server_timeout="10" error_code_id="{backup_error_code}"/>
<BackUp backup_dist="-0.2" backup_speed="0.05" server_name="backup_server" server_timeout="10"
error_code_id="{backup_error_code}" error_msg="{backup_error_msg}"/>
29 changes: 20 additions & 9 deletions configuration/packages/bt-plugins/actions/ComputeCoveragePath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Input Ports
===================================== =======

Description
Whether or not to generate a headland of the field or polygon to compute coverage of
Whether or not to generate a headland of the field or polygon to compute coverage of

:generate_route:

Expand All @@ -31,7 +31,7 @@ Input Ports
============================================= =======

Description
Whether or not to generate a route, e.g. an ordered set of swaths
Whether or not to generate a route, e.g. an ordered set of swaths

:generate_path:

Expand All @@ -42,7 +42,7 @@ Input Ports
============== =======

Description
Whether or not to generate a path, e.g. adding path connectors to the ordered route
Whether or not to generate a path, e.g. adding path connectors to the ordered route

:file_field:

Expand All @@ -53,7 +53,7 @@ Input Ports
============== =======

Description
The filepath to the field's GML file to use, if not specifying the field via ``polygons``
The filepath to the field's GML file to use, if not specifying the field via ``polygons``


:file_field_id:
Expand All @@ -65,7 +65,7 @@ Input Ports
============== =======

Description
The ID of the field in the GML File to use, if multiple exist in the same file. This is the ordered number of the fields in the file.
The ID of the field in the GML File to use, if multiple exist in the same file. This is the ordered number of the fields in the file.

:polygons:

Expand Down Expand Up @@ -101,7 +101,7 @@ Output Ports
========================== =======

Description
Path created by action server in the form of a navigation path. Takes in a blackboard variable, e.g. "{path}".
Path created by action server in the form of a navigation path. Takes in a blackboard variable, e.g. "{path}".

:coverage_path:

Expand All @@ -123,13 +123,24 @@ Output Ports
============== =======

Description
Compute coverage error code. See ``ComputeCoveragePath`` action message for the enumerated set of error codes.
Compute coverage error code. See ``ComputeCoveragePath`` action message for the enumerated set of error codes.

:error_msg:

============== =======
Type Default
-------------- -------
string N/A
============== =======

Description
Compute coverage error message. See ``ComputeCoveragePath`` action message for the enumerated set of error codes.

Example
-------

.. code-block:: xml
<ComputeCoveragePath file_field="{field_filepath}" nav_path="{path}" coverage_path="{cov_path}" server_name="ComputeCoverage" server_timeout="10" error_code_id="{compute_coverage_error_code}"/>
<ComputeCoveragePath file_field="{field_filepath}" nav_path="{path}" coverage_path="{cov_path}" server_name="ComputeCoverage" server_timeout="10" error_code_id="{compute_coverage_error_code}" error_msg="{compute_coverage_error_msg}"/>
Note: the blackboard IDs for the path, error code, and more may be adjusted,but need to match the corresponding parameters in the ``CoverageNavigator`` plugin to set on the blackboard for use from the action server.
Note: the blackboard IDs for the path, error code, and more may be adjusted, but need to match the corresponding parameters in the ``CoverageNavigator`` plugin to set on the blackboard for use from the action server.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,20 @@ Output Ports
Description
Compute path through poses error code. See ``ComputePathThroughPoses`` action message for the enumerated set of error codes.

:error_msg:

============== =======
Type Default
-------------- -------
string N/A
============== =======

Description
Compute path through poses error message. See ``ComputePathThroughPoses`` action message for the enumerated set of error codes.

Example
-------

.. code-block:: xml
<ComputePathThroughPoses goals="{goals}" path="{path}" planner_id="GridBased" server_name="ComputePathThroughPoses" server_timeout="10" error_code_id="{compute_path_error_code}"/>
<ComputePathThroughPoses goals="{goals}" path="{path}" planner_id="GridBased" server_name="ComputePathThroughPoses" server_timeout="10" error_code_id="{compute_path_error_code}" error_msg="{compute_path_error_msg}"/>
Loading

0 comments on commit 47c9846

Please sign in to comment.