diff --git a/src/example_behaviors/include/example_behaviors/sam2_segmentation.hpp b/src/example_behaviors/include/example_behaviors/example_sam2_segmentation.hpp similarity index 92% rename from src/example_behaviors/include/example_behaviors/sam2_segmentation.hpp rename to src/example_behaviors/include/example_behaviors/example_sam2_segmentation.hpp index 06fed8be..1b738b10 100644 --- a/src/example_behaviors/include/example_behaviors/sam2_segmentation.hpp +++ b/src/example_behaviors/include/example_behaviors/example_sam2_segmentation.hpp @@ -17,16 +17,16 @@ namespace example_behaviors /** * @brief Segment an image using the SAM 2 model */ -class SAM2Segmentation : public moveit_studio::behaviors::AsyncBehaviorBase +class ExampleSAM2Segmentation : public moveit_studio::behaviors::AsyncBehaviorBase { public: /** - * @brief Constructor for the SAM2Segmentation behavior. + * @brief Constructor for the ExampleSAM2Segmentation behavior. * @param name The name of a particular instance of this Behavior. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree. * @param config This contains runtime configuration info for this Behavior, such as the mapping between the Behavior's data ports on the behavior tree's blackboard. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree. * @details An important limitation is that the members of the base Behavior class are not instantiated until after the initialize() function is called, so these classes should not be used within the constructor. */ - SAM2Segmentation(const std::string& name, const BT::NodeConfiguration& config, + ExampleSAM2Segmentation(const std::string& name, const BT::NodeConfiguration& config, const std::shared_ptr& shared_resources); /** diff --git a/src/example_behaviors/src/sam2_segmentation.cpp b/src/example_behaviors/src/example_sam2_segmentation.cpp similarity index 94% rename from src/example_behaviors/src/sam2_segmentation.cpp rename to src/example_behaviors/src/example_sam2_segmentation.cpp index a7e27f6d..7e6661fe 100644 --- a/src/example_behaviors/src/sam2_segmentation.cpp +++ b/src/example_behaviors/src/example_sam2_segmentation.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include @@ -59,7 +59,7 @@ namespace example_behaviors mask_msg.y = 0; } - SAM2Segmentation::SAM2Segmentation(const std::string& name, const BT::NodeConfiguration& config, + ExampleSAM2Segmentation::ExampleSAM2Segmentation(const std::string& name, const BT::NodeConfiguration& config, const std::shared_ptr& shared_resources) : moveit_studio::behaviors::AsyncBehaviorBase(name, config, shared_resources) { @@ -70,7 +70,7 @@ namespace example_behaviors sam2_ = std::make_unique(encoder_onnx_file, decoder_onnx_file); } - BT::PortsList SAM2Segmentation::providedPorts() + BT::PortsList ExampleSAM2Segmentation::providedPorts() { return { BT::InputPort(kPortImage, kPortImageDefault, @@ -83,7 +83,7 @@ namespace example_behaviors }; } - tl::expected SAM2Segmentation::doWork() + tl::expected ExampleSAM2Segmentation::doWork() { const auto ports = moveit_studio::behaviors::getRequiredInputs(getInput(kPortImage), getInput #include #include +#include #include @@ -40,6 +41,7 @@ class ExampleBehaviorsLoader : public moveit_studio::behaviors::SharedResourcesN shared_resources); moveit_studio::behaviors::registerBehavior(factory, "ExampleNDTRegistration", shared_resources); moveit_studio::behaviors::registerBehavior(factory, "ExampleRANSACRegistration", shared_resources); + moveit_studio::behaviors::registerBehavior(factory, "ExampleSAM2Segmentation", shared_resources); } }; } // namespace example_behaviors diff --git a/src/lab_sim/objectives/run_sam2_onnx.xml b/src/lab_sim/objectives/run_sam2_onnx.xml index 2661486b..181bcd83 100644 --- a/src/lab_sim/objectives/run_sam2_onnx.xml +++ b/src/lab_sim/objectives/run_sam2_onnx.xml @@ -18,7 +18,7 @@ point_names="Point1;" view_name="/wrist_camera/color" /> - +