Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use core segmentation behavior in lab_sim #88

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/example_behaviors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ example_interfaces)
foreach(package IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${package} REQUIRED)
endforeach()
find_package(moveit_pro_ml REQUIRED)

add_library(
example_behaviors
Expand All @@ -41,7 +40,6 @@ target_include_directories(
PRIVATE ${PCL_INCLUDE_DIRS})
ament_target_dependencies(example_behaviors
${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(example_behaviors onnx_sam2)

# Install Libraries
install(
Expand Down
1 change: 1 addition & 0 deletions src/lab_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ install(
config
description
launch
models
objectives
waypoints
DESTINATION
Expand Down
45 changes: 0 additions & 45 deletions src/lab_sim/objectives/run_sam2_onnx.xml

This file was deleted.

88 changes: 88 additions & 0 deletions src/lab_sim/objectives/segment_point_cloud_from_clicked_point.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8" ?>
<root
BTCPP_format="4"
main_tree_to_execute="Segment Point Cloud from Clicked Point"
>
<!--//////////-->
<BehaviorTree
ID="Segment Point Cloud from Clicked Point"
_description="Captures a point cloud and requests the user to click an object in the image to be segmented. The point cloud is then filtered to only include the selected object."
_favorite="true"
>
<Control ID="Sequence">
<Action ID="ClearSnapshot" />
<Action
ID="GetImage"
topic_name="/wrist_camera/color"
timeout_sec="5.000000"
message_out="{image}"
/>
<Action
ID="GetPointsFromUser"
point_prompts="Select the object to be segmented;"
point_names="Point1;"
view_name="/wrist_camera/color"
pixel_coords="{pixel_coords}"
/>
<Action
ID="GetMasks2DFromPointQuery"
image="{image}"
pixel_coords="{pixel_coords}"
masks2d="{masks2d}"
decoder_model_path="models/decoder.onnx"
encoder_model_path="models/sam2_hiera_large_encoder.onnx"
model_package="lab_sim"
/>
<Action
ID="GetPointCloud"
topic_name="/wrist_camera/points"
timeout_sec="5.000000"
message_out="{point_cloud}"
/>
<Action
ID="GetCameraInfo"
topic_name="/wrist_camera/camera_info"
message_out="{camera_info}"
timeout_sec="5.000000"
/>
<Action
ID="GetMasks3DFromMasks2D"
camera_info="{camera_info}"
masks2d="{masks2d}"
point_cloud="{point_cloud}"
masks3d="{masks3d}"
/>
<Decorator
ID="ForEach"
vector_in="{masks3d}"
out="{mask3d}"
index="{index}"
>
<Action
ID="GetPointCloudFromMask3D"
point_cloud="{point_cloud}"
mask3d="{mask3d}"
point_cloud_fragment="{point_cloud_fragment}"
/>
</Decorator>
<Action
ID="SendPointCloudToUI"
point_cloud="{point_cloud_fragment}"
pcd_topic="/pcd_pointcloud_captures"
/>
<Action
ID="PublishPointCloud"
point_cloud="{point_cloud_fragment}"
point_cloud_topic="/my_point_cloud"
/>
<Action ID="SwitchUIPrimaryView" primary_view_name="Visualization" />
</Control>
</BehaviorTree>
<TreeNodesModel>
<SubTree ID="Segment Point Cloud from Clicked Point">
<MetadataFields>
<Metadata runnable="true" />
</MetadataFields>
</SubTree>
</TreeNodesModel>
</root>
Loading