diff --git a/behaviour_library/CMakeLists.txt b/behaviour_library/CMakeLists.txt
index 3769a4d..786d3ea 100644
--- a/behaviour_library/CMakeLists.txt
+++ b/behaviour_library/CMakeLists.txt
@@ -15,6 +15,7 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(behaviortree_ros2 REQUIRED)
find_package(btcpp_ros2_interfaces REQUIRED)
+find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(robot_swiss_knife_msgs REQUIRED)
find_package(move_base_skill REQUIRED)
@@ -22,6 +23,7 @@ find_package(move_base_skill REQUIRED)
set(THIS_PACKAGE_DEPS
behaviortree_ros2::behaviortree_ros2
${btcpp_ros2_interfaces_TARGETS}
+ ${geometry_msgs_TARGETS}
${sensor_msgs_TARGETS}
${robot_swiss_knife_msgs_TARGETS}
)
@@ -35,6 +37,20 @@ add_library(image_sub_plugin SHARED src/image_sub_behaviour.cpp)
target_compile_definitions(image_sub_plugin PRIVATE BT_PLUGIN_EXPORT)
target_link_libraries(image_sub_plugin ${THIS_PACKAGE_DEPS})
+#####################################
+# Point cloud subscription behaviour
+#####################################
+add_library(cloud_sub_plugin SHARED src/cloud_sub_behaviour.cpp)
+target_compile_definitions(cloud_sub_plugin PRIVATE BT_PLUGIN_EXPORT)
+target_link_libraries(cloud_sub_plugin ${THIS_PACKAGE_DEPS})
+
+##################################################
+# Behaviour for publishing a pose stamped message
+##################################################
+add_library(pose_pub_plugin SHARED src/pose_pub_behaviour.cpp)
+target_compile_definitions(pose_pub_plugin PRIVATE BT_PLUGIN_EXPORT)
+target_link_libraries(pose_pub_plugin ${THIS_PACKAGE_DEPS})
+
###########################################
# Behaviour for checking object visibility
###########################################
@@ -42,6 +58,27 @@ add_library(check_visibility_plugin SHARED src/check_visibility_behaviour.cpp)
target_compile_definitions(check_visibility_plugin PRIVATE BT_PLUGIN_EXPORT)
target_link_libraries(check_visibility_plugin ${THIS_PACKAGE_DEPS})
+################################
+# Object segmentation behaviour
+################################
+add_library(segment_objects_plugin SHARED src/segment_objects_behaviour.cpp)
+target_compile_definitions(segment_objects_plugin PRIVATE BT_PLUGIN_EXPORT)
+target_link_libraries(segment_objects_plugin ${THIS_PACKAGE_DEPS})
+
+#######################################
+# ROI point cloud extraction behaviour
+#######################################
+add_library(extract_roi_3d_points_plugin SHARED src/extract_roi_3d_points_behaviour.cpp)
+target_compile_definitions(extract_roi_3d_points_plugin PRIVATE BT_PLUGIN_EXPORT)
+target_link_libraries(extract_roi_3d_points_plugin ${THIS_PACKAGE_DEPS})
+
+#############################
+# Pose calculation behaviour
+#############################
+add_library(calculate_pose_plugin SHARED src/calculate_pose_behaviour.cpp)
+target_compile_definitions(calculate_pose_plugin PRIVATE BT_PLUGIN_EXPORT)
+target_link_libraries(calculate_pose_plugin ${THIS_PACKAGE_DEPS})
+
########################################################
# Behaviour for moving a robot's base between locations
########################################################
@@ -57,7 +94,12 @@ target_link_libraries(example_tree ${THIS_PACKAGE_DEPS})
install(TARGETS
image_sub_plugin
+ cloud_sub_plugin
+ pose_pub_plugin
check_visibility_plugin
+ segment_objects_plugin
+ extract_roi_3d_points_plugin
+ calculate_pose_plugin
move_base_plugin
example_tree
DESTINATION lib/${PROJECT_NAME}
@@ -65,7 +107,12 @@ install(TARGETS
install(TARGETS
image_sub_plugin
+ cloud_sub_plugin
+ pose_pub_plugin
check_visibility_plugin
+ segment_objects_plugin
+ extract_roi_3d_points_plugin
+ calculate_pose_plugin
move_base_plugin
LIBRARY DESTINATION share/${PROJECT_NAME}/bt_plugins
ARCHIVE DESTINATION share/${PROJECT_NAME}/bt_plugins
diff --git a/behaviour_library/README.md b/behaviour_library/README.md
index a424bda..7139b8a 100644
--- a/behaviour_library/README.md
+++ b/behaviour_library/README.md
@@ -19,6 +19,19 @@ By default, this launches an example tree executor, which is currently the only
## Short descriptions of available behaviours
-* `ImageSubBehaviour`: Subscribes to image messages. Saves a received image message on the `latest_image` output port.
+### Publisher / subscriber behaviours
+
+* `ImageSubBehaviour`: Subscribes to `sensor_msgs/msg/Image` messages. Saves a received image message on the `latest_image` output port.
+* `PointCloudSubBehaviour`: Subscribes to `sensor_msgs/msg/PointCloud2` messages. Saves a received image message on the `latest_point_cloud` output port.
+* `PosePubBehaviour`: Publishes `geometry_msgs/msg/PoseStamped` messages. Reads the pose to be published from the `object_pose` input port.
+
+### Service interface behaviours
+
* `CheckVisibilityBehaviour`: Acts as a client of the [object visibility checking component](https://github.com/alex-mitrevski/robot-swiss-army-knife/tree/main/perception/object_visibility_checker). Thus, expects an image (input port `latest_image`) and target object categories (input port `object_categories`) to be available on the blackboard. Saves the result on the `visible_objects` output port.
+* `SegmentObjectsBehaviour`: Acts as a client of the [object segmentation component](https://github.com/alex-mitrevski/robot-swiss-army-knife/tree/main/perception/semantic_segmentation). Thus, expects an image (input port `latest_image`) and target object categories (input port `object_categories`) to be available on the blackboard. Saves the result on the `segmented_objects` output port.
+* `ExtractROI3DPointsBehaviour`: Acts as a client of the [ROI cloud extraction component](https://github.com/alex-mitrevski/robot-swiss-army-knife/tree/main/perception/point_cloud_utils). Thus, expects a point cloud (input port `latest_point_cloud`) and segmented objects as produced by the `SegmentObjectsBehaviour` (input port `segmented_objects`) to be available on the blackboard. Saves the result on the `object_clouds` output port.
+* `CalculatePoseBehaviour`: Acts as a client of the [cloud-based pose calculation component](https://github.com/alex-mitrevski/robot-swiss-army-knife/tree/main/perception/point_cloud_utils). Expects object points clouds as produced by the `ExtractROI3DPointsBehaviour` (input port `object_clouds`) and the name of the object of interest (input port `object_of_interest`) to be available on the blackboard. Saves the result on the `calculated_pose` output port. If the name is not available in `object_clouds` directly, looks for an existing name that contains the passed name (e.g. if the value passed on `object_of_interest` is `cup`, but `object_clouds` has an object `cup_0`, it will calculate the pose of `cup_0`).
+
+### Skill behaviours
+
* `MoveBaseBehaviour`: Acts as a client of the [move base skill](https://github.com/alex-mitrevski/robot-swiss-army-knife/tree/main/skills/move_base_skill). Expects a skill goal type (input port `goal_type`) and navigation goals (input port `goal_poses` for goals specified as a list of `geometry_msgs/msg/PoseStamped` messages). Does not have any output ports.
\ No newline at end of file
diff --git a/behaviour_library/behaviour_trees/object-pose-estimation-tree.xml b/behaviour_library/behaviour_trees/object-pose-estimation-tree.xml
new file mode 100644
index 0000000..16dfe1f
--- /dev/null
+++ b/behaviour_library/behaviour_trees/object-pose-estimation-tree.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/behaviour_library/include/behaviour_library/calculate_pose_behaviour.hpp b/behaviour_library/include/behaviour_library/calculate_pose_behaviour.hpp
new file mode 100644
index 0000000..51b75df
--- /dev/null
+++ b/behaviour_library/include/behaviour_library/calculate_pose_behaviour.hpp
@@ -0,0 +1,53 @@
+#ifndef CALCULATE_POSE_BEHAVIOUR_HPP
+#define CALCULATE_POSE_BEHAVIOUR_HPP
+
+#include
+#include