|
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> |
| 2 | +<root BTCPP_format="4" main_tree_to_execute="Count Boxes Objective"> |
| 3 | + <BehaviorTree |
| 4 | + ID="Count Boxes Objective" |
| 5 | + _description="Count the number of boxes in a given area." |
| 6 | + _favorite="false" |
| 7 | + > |
| 8 | + <Control ID="Sequence" name="TopLevelSequence"> |
| 9 | + <SubTree |
| 10 | + ID="CreatePoseVectorFromDirectory" |
| 11 | + _collapsed="false" |
| 12 | + pose_vector="{pose_vector}" |
| 13 | + directory_path="{pose_path}" |
| 14 | + name="given a path, load a PoseStamped from each yaml in that directory" |
| 15 | + /> |
| 16 | + <!--Crop outliers from our region of interest--> |
| 17 | + <Action |
| 18 | + ID="CreateStampedPose" |
| 19 | + reference_frame="world" |
| 20 | + stamped_pose="{crop_pose_centroid}" |
| 21 | + position_xyz="-11;2.75;0" |
| 22 | + /> |
| 23 | + <Action |
| 24 | + ID="VisualizePath" |
| 25 | + marker_lifetime="0.000000" |
| 26 | + marker_name="path_initial" |
| 27 | + path="{pose_vector}" |
| 28 | + pose_marker_size="1" |
| 29 | + show_poses="true" |
| 30 | + /> |
| 31 | + <Action |
| 32 | + ID="CropPosesInBox" |
| 33 | + crop_box_centroid_pose="{crop_pose_centroid}" |
| 34 | + poses="{pose_vector}" |
| 35 | + poses_cropped="{path_cropped}" |
| 36 | + crop_box_size="12;12;1" |
| 37 | + /> |
| 38 | + <SubTree |
| 39 | + ID="Order Poses" |
| 40 | + _collapsed="false" |
| 41 | + centroid="{crop_pose_centroid}" |
| 42 | + poses_in="{path_cropped}" |
| 43 | + poses_ordered="{poses_ordered}" |
| 44 | + x_extent="12" |
| 45 | + y_extent="12" |
| 46 | + /> |
| 47 | + <Action |
| 48 | + ID="VisualizePath" |
| 49 | + marker_lifetime="0.000000" |
| 50 | + marker_name="poses_ordered" |
| 51 | + path="{poses_ordered}" |
| 52 | + pose_marker_size="1" |
| 53 | + show_poses="true" |
| 54 | + /> |
| 55 | + <Action |
| 56 | + ID="SwitchController" |
| 57 | + activate_asap="true" |
| 58 | + automatic_deactivation="true" |
| 59 | + controller_list_action_name="/controller_manager/list_controllers" |
| 60 | + controller_switch_action_name="/controller_manager/switch_controller" |
| 61 | + strictness="1" |
| 62 | + timeout="-1.000000" |
| 63 | + activate_controllers="platform_velocity_controller_nav2" |
| 64 | + deactivate_controllers="platform_velocity_controller" |
| 65 | + /> |
| 66 | + <Action ID="Script" code="total_box_count:=0" /> |
| 67 | + <!--Drive through our newly ordered list of poses and count boxes at each Pose--> |
| 68 | + <Decorator |
| 69 | + ID="ForEach" |
| 70 | + index="{index}" |
| 71 | + out="{out}" |
| 72 | + vector_in="{poses_ordered}" |
| 73 | + > |
| 74 | + <Control ID="Sequence"> |
| 75 | + <Action |
| 76 | + ID="NavigateToPoseAction" |
| 77 | + action_name="/navigate_to_pose" |
| 78 | + current_pose="{current_pose}" |
| 79 | + distance_remaining="{distance_remaining}" |
| 80 | + estimated_time_remaining="{estimated_time_remaining}" |
| 81 | + ignore_stamp_time="true" |
| 82 | + navigation_time="{navigation_time}" |
| 83 | + number_of_recoveries="{number_of_recoveries}" |
| 84 | + pose_stamped="{out}" |
| 85 | + timeout_sec="-1.000000" |
| 86 | + behavior_tree_path="/opt/ros/humble/share/nav2_bt_navigator/behavior_trees/navigate_to_pose_w_replanning_and_recovery.xml" |
| 87 | + /> |
| 88 | + <SubTree |
| 89 | + ID="Count boxes subtree" |
| 90 | + _collapsed="false" |
| 91 | + box_count="{box_count}" |
| 92 | + scene_camera_folder="{scene_camera_folder}" |
| 93 | + wrist_camera_folder="{wrist_camera_folder}" |
| 94 | + /> |
| 95 | + <Action ID="Script" code="total_box_count+=box_count" /> |
| 96 | + </Control> |
| 97 | + </Decorator> |
| 98 | + <Action ID="LogMessage" log_level="info" message="{total_box_count}" /> |
| 99 | + </Control> |
| 100 | + </BehaviorTree> |
| 101 | + <TreeNodesModel> |
| 102 | + <SubTree ID="Count Boxes Objective"> |
| 103 | + <MetadataFields> |
| 104 | + <Metadata runnable="false" /> |
| 105 | + <Metadata subcategory="Application - Advanced Examples" /> |
| 106 | + </MetadataFields> |
| 107 | + <inout_port |
| 108 | + name="wrist_camera_folder" |
| 109 | + default="/home/studio-user/user_ws/src/hangar_sim/wrist_camera_images" |
| 110 | + type="std::string" |
| 111 | + > |
| 112 | + Absolute path to a directory for saving wrist camera pictures |
| 113 | + </inout_port> |
| 114 | + <inout_port |
| 115 | + name="scene_camera_folder" |
| 116 | + default="/home/studio-user/user_ws/src/hangar_sim/scene_camera_images" |
| 117 | + type="std::string" |
| 118 | + > |
| 119 | + Absolute path to a directory for saving scene camera pictures |
| 120 | + </inout_port> |
| 121 | + <inout_port |
| 122 | + name="pose_path" |
| 123 | + default="/home/studio-user/user_ws/src/hangar_sim/poses" |
| 124 | + type="std::string" |
| 125 | + > |
| 126 | + Absolute path to a directory of pose YAML files |
| 127 | + </inout_port> |
| 128 | + </SubTree> |
| 129 | + </TreeNodesModel> |
| 130 | +</root> |
0 commit comments