Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash for missing urdf in resource manager #1301

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ class HARDWARE_INTERFACE_PUBLIC ResourceManager

// Structure to store read and write status so it is not initialized in the real-time loop
HardwareReadWriteStatus read_write_status;

bool is_urdf_loaded__ = false;
};

} // namespace hardware_interface
Expand Down
8 changes: 6 additions & 2 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@ ResourceManager::ResourceManager(
// CM API: Called in "callback/slow"-thread
void ResourceManager::load_urdf(const std::string & urdf, bool validate_interfaces)
{
is_urdf_loaded__ = true;
const std::string system_type = "system";
const std::string sensor_type = "sensor";
const std::string actuator_type = "actuator";
Expand Down Expand Up @@ -795,7 +794,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)
Expand Down
Loading