From 140d4ca77cc97a228a822119d097d6361c09f6e9 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Mon, 9 Dec 2024 23:09:36 +0100 Subject: [PATCH] Revert "Add macro with also enable argument" --- doc/introspection.rst | 4 ---- .../hardware_interface/introspection.hpp | 20 +------------------ 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/doc/introspection.rst b/doc/introspection.rst index 9289c3005d..1f07227624 100644 --- a/doc/introspection.rst +++ b/doc/introspection.rst @@ -46,10 +46,6 @@ How to register a variable for introspection // The variable is introspected only when the controller is active and // then deactivated when the controller is deactivated. REGISTER_ROS2_CONTROL_INTROSPECTION("my_variable_name", &my_variable_); - // Register the variable for introspection that starts with the introspection enabled - // So, that the variable starts to be introspected, when the controller is in configured state. - // However, once the controller is activated and deactivated, the introspection is disabled. - REGISTER_ROS2_CONTROL_INTROSPECTION("my_active_variable", &my_active_variable_, true); ... } diff --git a/hardware_interface/include/hardware_interface/introspection.hpp b/hardware_interface/include/hardware_interface/introspection.hpp index 3bc6f06107..ca36d88be3 100644 --- a/hardware_interface/include/hardware_interface/introspection.hpp +++ b/hardware_interface/include/hardware_interface/introspection.hpp @@ -24,28 +24,10 @@ namespace hardware_interface constexpr char DEFAULT_REGISTRY_KEY[] = "ros2_control"; constexpr char DEFAULT_INTROSPECTION_TOPIC[] = "~/introspection_data"; -#define REGISTER_ROS2_CONTROL_INTROSPECTION_2_ARGS(ID, ENTITY) \ +#define REGISTER_ROS2_CONTROL_INTROSPECTION(ID, ENTITY) \ REGISTER_ENTITY( \ hardware_interface::DEFAULT_REGISTRY_KEY, get_name() + "." + ID, ENTITY, \ &stats_registrations_, false) - -#define REGISTER_ROS2_CONTROL_INTROSPECTION_3_ARGS(ID, ENTITY, ENABLE) \ - REGISTER_ENTITY( \ - hardware_interface::DEFAULT_REGISTRY_KEY, get_name() + "." + ID, ENTITY, \ - &stats_registrations_, ENABLE) - -#ifndef GET_4TH_ARG -#define GET_4TH_ARG(arg1, arg2, arg3, arg4, ...) arg4 -#endif - -#define REGISTER_ROS2_CONTROL_INTROSPECTION_MACRO_CHOOSER(...) \ - GET_4TH_ARG( \ - __VA_ARGS__, REGISTER_ROS2_CONTROL_INTROSPECTION_3_ARGS, \ - REGISTER_ROS2_CONTROL_INTROSPECTION_2_ARGS) - -#define REGISTER_ROS2_CONTROL_INTROSPECTION(...) \ - REGISTER_ROS2_CONTROL_INTROSPECTION_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) - } // namespace hardware_interface #endif // HARDWARE_INTERFACE__INTROSPECTION_HPP_