From f963acb3cbb9144bafaf5114acbd770a8b846e82 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Thu, 29 Jun 2023 14:05:43 +0200 Subject: [PATCH] Specialize templates to get fully qualified name (#35) --- VERSION | 2 +- doxygen/doxygen.conf | 2 +- source/modulo_component_interfaces/package.xml | 2 +- .../include/modulo_components/ComponentInterface.hpp | 2 +- .../modulo_components/modulo_components/component_interface.py | 2 +- source/modulo_components/package.xml | 2 +- .../modulo_components/test/cpp/test_component_communication.cpp | 2 +- .../test/cpp/test_lifecycle_component_communication.cpp | 2 +- .../test/python/test_component_communication.py | 2 +- .../test/python/test_lifecycle_component_communication.py | 2 +- source/modulo_core/package.xml | 2 +- source/modulo_utils/package.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/VERSION b/VERSION index a6333e400..0d3ad67af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.9 +2.2.10 diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index a7658eb4e..858f9d298 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Modulo" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.2.9 +PROJECT_NUMBER = 2.2.10 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/source/modulo_component_interfaces/package.xml b/source/modulo_component_interfaces/package.xml index 048e4d3b3..e2fbbddad 100644 --- a/source/modulo_component_interfaces/package.xml +++ b/source/modulo_component_interfaces/package.xml @@ -2,7 +2,7 @@ modulo_component_interfaces - 2.2.9 + 2.2.10 Interface package for communicating with modulo components through the ROS framework Enrico Eberhard GPLv3 diff --git a/source/modulo_components/include/modulo_components/ComponentInterface.hpp b/source/modulo_components/include/modulo_components/ComponentInterface.hpp index 460eedb05..151aef7fd 100644 --- a/source/modulo_components/include/modulo_components/ComponentInterface.hpp +++ b/source/modulo_components/include/modulo_components/ComponentInterface.hpp @@ -1259,7 +1259,7 @@ inline state_representation::CartesianPose ComponentInterface::lookup_tra template inline void ComponentInterface::publish_predicate(const std::string& name) { modulo_component_interfaces::msg::Predicate message; - message.component = this->get_fully_qualified_name(); + message.component = this->get_node_base_interface()->get_fully_qualified_name(); message.predicate = name; message.value = this->get_predicate(name); this->predicate_publisher_->publish(message); diff --git a/source/modulo_components/modulo_components/component_interface.py b/source/modulo_components/modulo_components/component_interface.py index 1b466bd8a..02bc02538 100644 --- a/source/modulo_components/modulo_components/component_interface.py +++ b/source/modulo_components/modulo_components/component_interface.py @@ -712,7 +712,7 @@ def _publish_predicate(self, name): self.get_logger().error(f"Predicate '{name}' has invalid type: expected 'bool', got '{type(value)}'.", throttle_duration_sec=1.0) return - message.component = self.get_name() + message.component = self.get_fully_qualified_name() message.predicate = name self._predicate_publisher.publish(message) diff --git a/source/modulo_components/package.xml b/source/modulo_components/package.xml index 14c4a3d08..7dea8085b 100644 --- a/source/modulo_components/package.xml +++ b/source/modulo_components/package.xml @@ -2,7 +2,7 @@ modulo_components - 2.2.9 + 2.2.10 Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework Baptiste Busch Enrico Eberhard diff --git a/source/modulo_components/test/cpp/test_component_communication.cpp b/source/modulo_components/test/cpp/test_component_communication.cpp index 23e66b78f..05628a00d 100644 --- a/source/modulo_components/test/cpp/test_component_communication.cpp +++ b/source/modulo_components/test/cpp/test_component_communication.cpp @@ -65,7 +65,7 @@ TEST_F(ComponentCommunicationTest, InputOutputManual) { TEST_F(ComponentCommunicationTest, Trigger) { auto trigger = std::make_shared(rclcpp::NodeOptions()); auto listener = - std::make_shared("trigger", std::vector{"test"}); + std::make_shared("/trigger", std::vector{"test"}); this->exec_->add_node(listener); this->exec_->add_node(trigger); auto result_code = this->exec_->spin_until_future_complete(listener->get_predicate_future(), 500ms); diff --git a/source/modulo_components/test/cpp/test_lifecycle_component_communication.cpp b/source/modulo_components/test/cpp/test_lifecycle_component_communication.cpp index 1e533e858..94786c3c5 100644 --- a/source/modulo_components/test/cpp/test_lifecycle_component_communication.cpp +++ b/source/modulo_components/test/cpp/test_lifecycle_component_communication.cpp @@ -69,7 +69,7 @@ TEST_F(LifecycleComponentCommunicationTest, InputOutputManual) { TEST_F(LifecycleComponentCommunicationTest, Trigger) { auto trigger = std::make_shared(rclcpp::NodeOptions()); auto listener = - std::make_shared("trigger", std::vector{"test"}); + std::make_shared("/trigger", std::vector{"test"}); this->exec_->add_node(trigger->get_node_base_interface()); trigger->configure(); this->exec_->add_node(listener); diff --git a/source/modulo_components/test/python/test_component_communication.py b/source/modulo_components/test/python/test_component_communication.py index 409d1c5e4..61b9e9c6d 100644 --- a/source/modulo_components/test/python/test_component_communication.py +++ b/source/modulo_components/test/python/test_component_communication.py @@ -50,7 +50,7 @@ def test_input_output_invalid(ros_exec, make_minimal_invalid_encoded_state_publi def test_trigger(ros_exec, make_predicates_listener): trigger = Trigger() - listener = make_predicates_listener("trigger", ["test"]) + listener = make_predicates_listener("/trigger", ["test"]) ros_exec.add_node(listener) ros_exec.add_node(trigger) ros_exec.spin_until_future_complete(listener.predicates_future, timeout_sec=0.5) diff --git a/source/modulo_components/test/python/test_lifecycle_component_communication.py b/source/modulo_components/test/python/test_lifecycle_component_communication.py index 025e0d7b9..28e2ba846 100644 --- a/source/modulo_components/test/python/test_lifecycle_component_communication.py +++ b/source/modulo_components/test/python/test_lifecycle_component_communication.py @@ -77,7 +77,7 @@ def test_input_output_invalid(ros_exec, make_lifecycle_change_client, make_minim def test_trigger(ros_exec, make_lifecycle_change_client, make_predicates_listener): trigger = Trigger() - listener = make_predicates_listener("trigger", ["test"]) + listener = make_predicates_listener("/trigger", ["test"]) client = make_lifecycle_change_client("trigger") ros_exec.add_node(trigger) ros_exec.add_node(listener) diff --git a/source/modulo_core/package.xml b/source/modulo_core/package.xml index 1b6249f3f..96735b268 100644 --- a/source/modulo_core/package.xml +++ b/source/modulo_core/package.xml @@ -2,7 +2,7 @@ modulo_core - 2.2.9 + 2.2.10 Modulo Core communication and translation utilities for interoperability with AICA Control Libraries Baptiste Busch Enrico Eberhard diff --git a/source/modulo_utils/package.xml b/source/modulo_utils/package.xml index dd89f7133..ab5a4c96a 100644 --- a/source/modulo_utils/package.xml +++ b/source/modulo_utils/package.xml @@ -2,7 +2,7 @@ modulo_utils - 2.2.9 + 2.2.10 Modulo utils package for shared test fixtures Dominic Reber GPLv3