diff --git a/hardware_interface/src/resource_manager.cpp b/hardware_interface/src/resource_manager.cpp index efdf0ea347..971700fb9e 100644 --- a/hardware_interface/src/resource_manager.cpp +++ b/hardware_interface/src/resource_manager.cpp @@ -611,13 +611,10 @@ class ResourceStorage auto interfaces = hardware.export_state_interfaces(); const auto interface_names = add_state_interfaces(interfaces); - if (interface_names.empty()) - { - RCLCPP_WARN( - get_logger(), - "Importing state interfaces for the hardware '%s' returned no state interfaces.", - hardware.get_name().c_str()); - } + RCLCPP_WARN_EXPRESSION( + get_logger(), interface_names.empty(), + "Importing state interfaces for the hardware '%s' returned no state interfaces.", + hardware.get_name().c_str()); hardware_info_map_[hardware.get_name()].state_interfaces = interface_names; available_state_interfaces_.reserve( available_state_interfaces_.capacity() + interface_names.size());