From c4c060f72d76fb7d5433df37b82c16d855a6a89d Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Tue, 16 Jan 2024 22:03:09 +0100 Subject: [PATCH] check the components size instead of the variable (fixes #1299) --- hardware_interface/src/resource_manager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hardware_interface/src/resource_manager.cpp b/hardware_interface/src/resource_manager.cpp index 0cbb620c76..469c576f5d 100644 --- a/hardware_interface/src/resource_manager.cpp +++ b/hardware_interface/src/resource_manager.cpp @@ -795,7 +795,12 @@ void ResourceManager::load_urdf(const std::string & urdf, bool validate_interfac resource_storage_->systems_.size()); } -bool ResourceManager::is_urdf_already_loaded() const { return is_urdf_loaded__; } +bool ResourceManager::is_urdf_already_loaded() const +{ + return ( + !resource_storage_->actuators_.empty() || !resource_storage_->sensors_.empty() || + !resource_storage_->systems_.empty()); +} // CM API: Called in "update"-thread LoanedStateInterface ResourceManager::claim_state_interface(const std::string & key)