From 7b5037089c6565f205ce694ac7440b41c25fdea3 Mon Sep 17 00:00:00 2001 From: Alberto Tudela Date: Tue, 11 Feb 2025 13:33:18 +0100 Subject: [PATCH] First jazzy release Signed-off-by: Alberto Tudela --- .github/workflows/build.yml | 4 +-- README.md | 2 +- rasa_bt/CHANGELOG.rst | 13 +++++++++ rasa_bt/CMakeLists.txt | 7 ++--- rasa_bt/include/rasa_bt/action/bt_types.hpp | 30 +++++++++++++++++++-- rasa_bt/package.xml | 4 +-- rasa_bt/src/action/parse_action.cpp | 2 +- rasa_bt/test/CMakeLists.txt | 2 +- rasa_bt/test/action/CMakeLists.txt | 7 ++--- rasa_bt/test/action/test_parse_action.cpp | 4 +-- rasa_bt/test/test_register.cpp | 4 +-- rasa_msgs/CHANGELOG.rst | 4 +++ rasa_msgs/package.xml | 2 +- rasa_ros/CHANGELOG.rst | 4 +++ rasa_ros/README.md | 6 ++--- 15 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 rasa_bt/CHANGELOG.rst diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c84f31d..fb9a557 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ name: Build on: push: - branches: [main, humble] + branches: [main, jazzy, humble] pull_request: env: @@ -26,7 +26,7 @@ jobs: rasa_bt rasa_msgs rasa_ros - target-ros2-distro: humble + target-ros2-distro: jazzy colcon-defaults: | { "build": { diff --git a/README.md b/README.md index b67e903..f3f6643 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # rasa_ros -![ROS2](https://img.shields.io/badge/ros2-humble-blue?logo=ros&logoColor=white) +![ROS2](https://img.shields.io/badge/ros2-jazzy-blue?logo=ros&logoColor=white) [![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0) [![Build](https://github.com/grupo-avispa/rasa_ros/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/grupo-avispa/rasa_ros/actions/workflows/build.yml) diff --git a/rasa_bt/CHANGELOG.rst b/rasa_bt/CHANGELOG.rst new file mode 100644 index 0000000..3336804 --- /dev/null +++ b/rasa_bt/CHANGELOG.rst @@ -0,0 +1,13 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package rasa_bt +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.1.1 (11-02-2025) +------------------ +* First jazzy release. +* Move to BehaviorTree 4.6. + +0.1.0 (31-01-2025) +------------------ +* Added BT nodes for Rasa. +* Contributors: Alberto Tudela diff --git a/rasa_bt/CMakeLists.txt b/rasa_bt/CMakeLists.txt index 3c20589..2541d88 100644 --- a/rasa_bt/CMakeLists.txt +++ b/rasa_bt/CMakeLists.txt @@ -50,7 +50,7 @@ endif() # ############################################### # # Find ament macros and libraries find_package(ament_cmake REQUIRED) -find_package(behaviortree_cpp_v3 REQUIRED) +find_package(behaviortree_cpp REQUIRED) find_package(nav2_behavior_tree REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_action REQUIRED) @@ -69,12 +69,13 @@ foreach(bt_plugin ${plugin_libs}) "$" ) target_link_libraries(${bt_plugin} PUBLIC + behaviortree_cpp::behaviortree_cpp rclcpp::rclcpp rclcpp_action::rclcpp_action rclcpp_lifecycle::rclcpp_lifecycle ${rasa_msgs_TARGETS} ) - ament_target_dependencies(${bt_plugin} PUBLIC behaviortree_cpp_v3 nav2_behavior_tree) # TODO(ajtudela): Fix this in jazzy + ament_target_dependencies(${bt_plugin} PUBLIC nav2_behavior_tree) # TODO(ajtudela): Fix this in kilted target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT) endforeach() @@ -114,7 +115,7 @@ endif() ament_export_include_directories(include/${PROJECT_NAME}) ament_export_libraries() ament_export_dependencies( - behaviortree_cpp_v3 + behaviortree_cpp nav2_behavior_tree rclcpp rclcpp_action diff --git a/rasa_bt/include/rasa_bt/action/bt_types.hpp b/rasa_bt/include/rasa_bt/action/bt_types.hpp index 45c0e08..f9a68cc 100644 --- a/rasa_bt/include/rasa_bt/action/bt_types.hpp +++ b/rasa_bt/include/rasa_bt/action/bt_types.hpp @@ -16,18 +16,39 @@ #ifndef RASA_BT__ACTION__BT_TYPES_HPP_ #define RASA_BT__ACTION__BT_TYPES_HPP_ -#include - #include +#include "behaviortree_cpp/behavior_tree.h" +#include "behaviortree_cpp/json_export.h" #include "rasa_msgs/msg/entity.hpp" #include "rasa_msgs/msg/intent.hpp" +// Allow bi-directional convertion to JSON +BT_JSON_CONVERTER(rasa_msgs::msg::Entity, entity) +{ + add_field("start", &entity.start); + add_field("end", &entity.end); + add_field("value", &entity.value); + add_field("entity", &entity.entity); + add_field("confidence", &entity.confidence); +} + +BT_JSON_CONVERTER(rasa_msgs::msg::Intent, intent) +{ + add_field("confidence", &intent.confidence); + add_field("name", &intent.name); +} + // Template specialization to converts a string to Goal. namespace BT { template<> inline rasa_msgs::msg::Entity convertFromString(BT::StringView str) { + if (StartWith(str, "json:")) { + str.remove_prefix(5); + return convertFromJSON(str); + } + rasa_msgs::msg::Entity output; if (!str.empty()) { // We expect values separated by ; @@ -47,6 +68,11 @@ template<> inline rasa_msgs::msg::Entity convertFromString(BT::StringView str) template<> inline rasa_msgs::msg::Intent convertFromString(BT::StringView str) { + if (StartWith(str, "json:")) { + str.remove_prefix(5); + return convertFromJSON(str); + } + // We expect real numbers separated by ; auto parts = splitString(str, ';'); if (parts.size() != 2) { diff --git a/rasa_bt/package.xml b/rasa_bt/package.xml index c5d9854..6516b7c 100644 --- a/rasa_bt/package.xml +++ b/rasa_bt/package.xml @@ -2,13 +2,13 @@ rasa_bt - 1.0.0 + 0.1.1 A package containing behavior trees plugins for the rasa_ros stack. Alberto Tudela Apache-2.0 Alberto Tudela ament_cmake - behaviortree_cpp_v3 + behaviortree_cpp nav2_behavior_tree rclcpp rclcpp_action diff --git a/rasa_bt/src/action/parse_action.cpp b/rasa_bt/src/action/parse_action.cpp index 3074bff..296e9f2 100644 --- a/rasa_bt/src/action/parse_action.cpp +++ b/rasa_bt/src/action/parse_action.cpp @@ -50,7 +50,7 @@ BT::NodeStatus ParseAction::on_success() } // namespace rasa_bt -#include "behaviortree_cpp_v3/bt_factory.h" +#include "behaviortree_cpp/bt_factory.h" BT_REGISTER_NODES(factory) { BT::NodeBuilder builder = diff --git a/rasa_bt/test/CMakeLists.txt b/rasa_bt/test/CMakeLists.txt index 727dc07..849dda1 100644 --- a/rasa_bt/test/CMakeLists.txt +++ b/rasa_bt/test/CMakeLists.txt @@ -10,5 +10,5 @@ target_link_libraries(test_register rclcpp::rclcpp ) ament_target_dependencies(test_register - behaviortree_cpp_v3 + behaviortree_cpp ) diff --git a/rasa_bt/test/action/CMakeLists.txt b/rasa_bt/test/action/CMakeLists.txt index 29cf415..a0e23d2 100644 --- a/rasa_bt/test/action/CMakeLists.txt +++ b/rasa_bt/test/action/CMakeLists.txt @@ -1,8 +1,9 @@ +find_package(ament_index_cpp REQUIRED) + # Test for the parse action -ament_add_gtest(test_parse_action - test_parse_action.cpp -) +ament_add_gtest(test_parse_action test_parse_action.cpp) target_link_libraries(test_parse_action + ament_index_cpp::ament_index_cpp rasa_parse_action_bt_node ) ament_target_dependencies(test_parse_action diff --git a/rasa_bt/test/action/test_parse_action.cpp b/rasa_bt/test/action/test_parse_action.cpp index e1613b3..8219b44 100644 --- a/rasa_bt/test/action/test_parse_action.cpp +++ b/rasa_bt/test/action/test_parse_action.cpp @@ -18,8 +18,8 @@ #include #include -#include -#include "behaviortree_cpp_v3/bt_factory.h" +#include "ament_index_cpp/get_package_share_directory.hpp" +#include "behaviortree_cpp/bt_factory.h" #include "nav2_behavior_tree/utils/test_action_server.hpp" #include "rasa_bt/action/parse_action.hpp" diff --git a/rasa_bt/test/test_register.cpp b/rasa_bt/test/test_register.cpp index 2809666..ed98b77 100644 --- a/rasa_bt/test/test_register.cpp +++ b/rasa_bt/test/test_register.cpp @@ -14,8 +14,8 @@ // limitations under the License. #include -#include "behaviortree_cpp_v3/bt_factory.h" -#include "behaviortree_cpp_v3/utils/shared_library.h" +#include "behaviortree_cpp/bt_factory.h" +#include "behaviortree_cpp/utils/shared_library.h" #include "rclcpp/rclcpp.hpp" TEST(WhisperBT, register_nodes) diff --git a/rasa_msgs/CHANGELOG.rst b/rasa_msgs/CHANGELOG.rst index a0cfe08..18f7ac1 100644 --- a/rasa_msgs/CHANGELOG.rst +++ b/rasa_msgs/CHANGELOG.rst @@ -2,6 +2,10 @@ Changelog for package rasa_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.1 (11-02-2025) +------------------ +* First jazzy release. + 0.1.0 (16-01-2025) ------------------ * Initial release. diff --git a/rasa_msgs/package.xml b/rasa_msgs/package.xml index e36a77c..db1d195 100644 --- a/rasa_msgs/package.xml +++ b/rasa_msgs/package.xml @@ -2,7 +2,7 @@ rasa_msgs - 0.1.0 + 0.1.1 ROS 2 message definitions for Rasa Open Source Alberto Tudela Apache-2.0 diff --git a/rasa_ros/CHANGELOG.rst b/rasa_ros/CHANGELOG.rst index 950f36a..d27fe72 100644 --- a/rasa_ros/CHANGELOG.rst +++ b/rasa_ros/CHANGELOG.rst @@ -2,6 +2,10 @@ Changelog for package rasa_ros ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.1 (11-02-2025) +------------------ +* First jazzy release. + 0.1.0 (17-01-2025) ------------------ * Initial release. diff --git a/rasa_ros/README.md b/rasa_ros/README.md index 0bb1f8b..030968e 100644 --- a/rasa_ros/README.md +++ b/rasa_ros/README.md @@ -8,7 +8,7 @@ This package is a ROS2 wrapper for the natural language understanding (NLU) [Ras #### Dependencies -- [Robot Operating System (ROS) 2](https://docs.ros.org/en/humble/) (middleware for robotics), +- [Robot Operating System (ROS) 2](https://docs.ros.org/en/jazzy/) (middleware for robotics), #### Building @@ -18,7 +18,7 @@ To build from source, clone the latest version from the main repository into you cd colcon_workspace/src git clone https://github.com/grupo-avispa/rasa_ros.git -b main cd colcon_workspace -rosdep install -i --from-path src --rosdistro humble -y +rosdep install -i --from-path src --rosdistro jazzy -y colcon build --symlink-install ``` @@ -60,6 +60,4 @@ This node has an action server that receives a string with a message and returns Port of the Rasa server. -[Ubuntu]: https://ubuntu.com/ -[ROS2]: https://docs.ros.org/en/humble/