This repository has been archived by the owner on Dec 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pose averaging to Pick Apriltag Labeled Object
- Loading branch information
Showing
3 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/picknik_ur_gazebo_config/objectives/loop_detect_april.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<root BTCPP_format="4" main_tree_to_execute="Loop Detect April"> | ||
<!-- ////////// --> | ||
<BehaviorTree ID="Loop Detect April" _description="Loops finding April Tag marker until failure." _favorite="true"> | ||
<Control ID="Sequence"> | ||
<!-- Keep executing until failure --> | ||
<Decorator ID="KeepRunningUntilFailure"> | ||
<Control ID="Sequence" name="GetDetection"> | ||
<Action ID="LoadObjectiveParameters" config_file_name="apriltag_detection_config.yaml" parameters="{parameters}"/> | ||
<Action ID="GetCameraInfo" topic_name="/wrist_mounted_camera/color/camera_info" message_out="{camera_info}"/> | ||
<Action ID="GetImage" topic_name="/wrist_mounted_camera/color/image_raw" message_out="{image}"/> | ||
<Action ID="DetectApriltags" image="{image}" camera_info="{camera_info}" parameters="{parameters}" detections="{detections}"/> | ||
<!-- if you don't want this behavior to fail when it can't find an April tag comment out the line below --> | ||
<Action ID="GetDetectionPose" detections="{detections}" target_id="0" target_label="" detection_pose="{detection_pose}"/> | ||
</Control> | ||
</Decorator> | ||
</Control> | ||
</BehaviorTree> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/picknik_ur_gazebo_config/objectives/sample_april_tag.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<root BTCPP_format="4" main_tree_to_execute="Sample April Tag"> | ||
<!-- ////////// --> | ||
<BehaviorTree ID="Sample April Tag" _description="Samples the pose of an April tag and returns the average measurement." _favorite="true"> | ||
<Decorator ID="Repeat" num_cycles="{num_cycles}" name="SamplePose"> | ||
<Control ID="Sequence"> | ||
<Action ID="LoadObjectiveParameters" config_file_name="{apriltag_config}" parameters="{parameters}"/> | ||
<Action ID="GetCameraInfo" topic_name="/wrist_mounted_camera/color/camera_info" message_out="{camera_info}"/> | ||
<Decorator ID="RetryUntilSuccessful" num_attempts="5"> | ||
<Control ID="Sequence"> | ||
<Action ID="GetImage" topic_name="/wrist_mounted_camera/color/image_raw" message_out="{image}"/> | ||
<Action ID="DetectApriltags" image="{image}" camera_info="{camera_info}" parameters="{parameters}" detections="{detections}"/> | ||
<Action ID="GetDetectionPose" detections="{detections}" target_id="{tag_id}" target_label="" detection_pose="{detection_pose}"/> | ||
</Control> | ||
</Decorator> | ||
<Action ID="AveragePoseStamped" pose_sample="{detection_pose}" avg_pose="{avg_pose}" max_distance="{max_distance}" max_rotation="{max_rotation}"/> | ||
<!-- TODO: update this objective to allow rejecting noisy samples but fail after X attempts | ||
<Fallback name="Average pose or sample more"> | ||
<Action ID="AveragePoseStamped"/> | ||
<Control ID="Sequence"> | ||
<Script code="num_cycles={num_cycles - 1}" /> | ||
<Script code="num_failures={num_failures + 1}" /> | ||
</Control> | ||
</Fallback> --> | ||
</Control> | ||
</Decorator> | ||
</BehaviorTree> | ||
</root> |