From ba7275a686aeb3887281f187999ff9bd42924ae5 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Fri, 17 Jan 2025 00:40:42 +0100 Subject: [PATCH] update write cycle statistics only if it is valid --- controller_manager/src/controller_manager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index 6dd92e3f8b..bc629fd386 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -3456,12 +3456,17 @@ void ControllerManager::hardware_components_diagnostic_callback( } }; + // For components : {actuator, sensor and system} update_stats( component_name, component_info.read_statistics, read_cycle_suffix, level, component_info, params_); - update_stats( - component_name, component_info.write_statistics, write_cycle_suffix, level, component_info, - params_); + // For components : {actuator and system} + if (component_info.write_statistics) + { + update_stats( + component_name, component_info.write_statistics, write_cycle_suffix, level, + component_info, params_); + } } }