Skip to content

Commit a8b1f0c

Browse files
committed
Add behavior tree to navigate to start before starting fields navigation (#65)
* Add behavior tree to navigate to start before starting fields navigation * snake case * comments
1 parent cb8c6b5 commit a8b1f0c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 BTCPP_format="4" 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

Comments
 (0)