From f3dc61b58ab054f9f2085cf472e0c98a17206bb2 Mon Sep 17 00:00:00 2001 From: bpapaspyros Date: Fri, 29 Nov 2024 14:50:07 +0100 Subject: [PATCH 1/4] fix: move predicate publishing rate parameter to base controller --- .../modulo_controllers_controller_interface.json | 11 ++--------- .../src/BaseControllerInterface.cpp | 2 +- source/modulo_controllers/src/ControllerInterface.cpp | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json index 761ee78b..1da78639 100644 --- a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json +++ b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json @@ -2,9 +2,10 @@ "$schema": "https://docs.aica.tech/schemas/1-3-0/controller.schema.json", "name": "Controller Interface", "description": { - "brief": "Base controller class to combine ros2_control, control libraries and modulo" + "brief": "Base controller class to combine ros2_control, control libraries and modulo" // todo: to be updated }, "plugin": "modulo_controllers/ControllerInterface", + "inherits": "modulo_controllers/BaseControllerInterface", "virtual": true, "parameters": [ { @@ -48,14 +49,6 @@ "parameter_name": "input_validity_period", "parameter_type": "double", "default_value": "1.0" - }, - { - "display_name": "Predicate publishing rate", - "description": "The rate at which to publish controller predicates (in Hertz)", - "parameter_name": "predicate_publishing_rate", - "parameter_type": "double", - "default_value": "10.0", - "internal": true } ] } \ No newline at end of file diff --git a/source/modulo_controllers/src/BaseControllerInterface.cpp b/source/modulo_controllers/src/BaseControllerInterface.cpp index c89c22d2..b3aaa754 100644 --- a/source/modulo_controllers/src/BaseControllerInterface.cpp +++ b/source/modulo_controllers/src/BaseControllerInterface.cpp @@ -31,7 +31,7 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn BaseCo [this](const std::vector& parameters) -> rcl_interfaces::msg::SetParametersResult { return this->on_set_parameters_callback(parameters); }); - + add_parameter("predicate_publishing_rate", 10.0, "The rate at which to publish controller predicates"); return CallbackReturn::SUCCESS; } diff --git a/source/modulo_controllers/src/ControllerInterface.cpp b/source/modulo_controllers/src/ControllerInterface.cpp index e77b174e..41ea23c9 100644 --- a/source/modulo_controllers/src/ControllerInterface.cpp +++ b/source/modulo_controllers/src/ControllerInterface.cpp @@ -28,7 +28,6 @@ rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn Contro "activation_timeout", 1.0, "The seconds to wait for valid data on the state interfaces before activating"); add_parameter( "input_validity_period", 1.0, "The maximum age of an input state before discarding it as expired"); - add_parameter("predicate_publishing_rate", 10.0, "The rate at which to publish controller predicates"); return add_interfaces(); } catch (const std::exception& e) { From 163625aa35834244da8127af96a7422da753af67 Mon Sep 17 00:00:00 2001 From: bpapaspyros Date: Fri, 29 Nov 2024 14:52:26 +0100 Subject: [PATCH 2/4] fix: add controller description for the base controller interface --- ...controllers_base_controller_interface.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 source/modulo_controllers/controller_descriptions/modulo_controllers_base_controller_interface.json diff --git a/source/modulo_controllers/controller_descriptions/modulo_controllers_base_controller_interface.json b/source/modulo_controllers/controller_descriptions/modulo_controllers_base_controller_interface.json new file mode 100644 index 00000000..b7a58486 --- /dev/null +++ b/source/modulo_controllers/controller_descriptions/modulo_controllers_base_controller_interface.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://docs.aica.tech/schemas/1-3-0/controller.schema.json", + "name": "Base Controller Interface", + "description": { + "brief": "Base controller class to combine ros2_control, control libraries and modulo" + }, + "plugin": "modulo_controllers/BaseControllerInterface", + "virtual": true, + "parameters": [ + { + "display_name": "Predicate publishing rate", + "description": "The rate at which to publish controller predicates (in Hertz)", + "parameter_name": "predicate_publishing_rate", + "parameter_type": "double", + "default_value": "10.0", + "internal": true + } + ] +} \ No newline at end of file From c3d6ef7cc7410c75a2767def9a536962eed5c48b Mon Sep 17 00:00:00 2001 From: bpapaspyros Date: Fri, 29 Nov 2024 14:55:55 +0100 Subject: [PATCH 3/4] docs: update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30587142..7945b27d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Release Versions: ## Upcoming changes - fix(components): remove incorrect log line (#166) + - fix(controllers): move predicate publishing rate parameter to BaseControllerInterface (#168) ## 5.0.2 From 16cddc5f5b92b4b662822641adaeb8d463f9893f Mon Sep 17 00:00:00 2001 From: bpapaspyros Date: Fri, 29 Nov 2024 15:02:59 +0100 Subject: [PATCH 4/4] docs: update description for controller interface description --- .../modulo_controllers_controller_interface.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json index 1da78639..8a58baa9 100644 --- a/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json +++ b/source/modulo_controllers/controller_descriptions/modulo_controllers_controller_interface.json @@ -2,7 +2,7 @@ "$schema": "https://docs.aica.tech/schemas/1-3-0/controller.schema.json", "name": "Controller Interface", "description": { - "brief": "Base controller class to combine ros2_control, control libraries and modulo" // todo: to be updated + "brief": "Controller interface class that includes custom parameters for derived controllers" }, "plugin": "modulo_controllers/ControllerInterface", "inherits": "modulo_controllers/BaseControllerInterface",