|
| 1 | +<!-- |
| 2 | + This Behavior Tree computes a complete coverage path over a selected space, navigates to the start point of the path, then follows the coverage path. |
| 3 | + Can also take the coverage_path instead of Nav Path for segmented swaths from turns |
| 4 | + for changes in operational modes (e.g. raise tool, turn off payload in turns not in field). |
| 5 | +
|
| 6 | + Field filepath is set by the Navigator plugin in the action request, but also may be hardcoded |
| 7 | + or set using the polygons input port instead for dynamically computed values instead of from file. |
| 8 | +
|
| 9 | + It might be wise to still have the planner server on hand to connect to the coverage path in realistic uses. |
| 10 | +
|
| 11 | + This BT shows set polygon usage with the coverage server |
| 12 | +--> |
| 13 | + |
| 14 | +<root main_tree_to_execute="MainTree"> |
| 15 | + <BehaviorTree ID="MainTree"> |
| 16 | + <RateController hz="0.0000001"> <!-- once, for demo --> |
| 17 | + <Sequence name="NavigateWithoutReplanning"> |
| 18 | + <!-- May use: |
| 19 | + 'polygons="{field_polygon}" polygons_frame_id="{polygon_frame_id}"' if set polygon via NavigateCompleteCoverage |
| 20 | + or file_field="{field_filepath}" if setting polygon file via NavigateCompleteCoverage --> |
| 21 | + |
| 22 | + <!-- Compute path to cover fields --> |
| 23 | + <ComputeCoveragePath nav_path="{path}" polygons="{field_polygon}" polygons_frame_id="{polygon_frame_id}" error_code_id="{compute_coverage_error_code}"/> |
| 24 | + |
| 25 | + <!-- Go to start of path before navigating --> |
| 26 | + <GetPoseFromPath path="{path}" pose="{start_pose}" index="0" /> |
| 27 | + <ComputePathToPose goal="{start_pose}" path="{path_to_start}" planner_id="GridBased" error_code_id="{compute_path_error_code}"/> |
| 28 | + <FollowPath path="{path_to_start}" controller_id="FollowPath" error_code_id="{follow_path_error_code}"/> |
| 29 | + |
| 30 | + <!-- Follow computed path --> |
| 31 | + <FollowPath path="{path}" controller_id="FollowPath" error_code_id="{follow_path_error_code}"/> |
| 32 | + </Sequence> |
| 33 | + </RateController> |
| 34 | + </BehaviorTree> |
| 35 | +</root> |
0 commit comments