Skip to content

Commit

Permalink
Fix environment clear such that cache is cleared before plugin factor…
Browse files Browse the repository at this point in the history
…ies are destroyed
  • Loading branch information
Levi Armstrong authored and Levi-Armstrong committed Nov 17, 2024
1 parent e3db715 commit 093f5ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ void Environment::Implementation::clear()
collision_margin_data = tesseract_collision::CollisionMarginData();
kinematics_information.clear();
contact_managers_plugin_info.clear();
kinematics_factory = tesseract_kinematics::KinematicsPluginFactory();
contact_managers_factory = tesseract_collision::ContactManagersPluginFactory();

{
std::unique_lock<std::shared_mutex> lock(discrete_manager_mutex);
Expand All @@ -639,6 +637,10 @@ void Environment::Implementation::clear()
std::unique_lock<std::shared_mutex> lock(kinematic_group_cache_mutex);
kinematic_group_cache.clear();
}

// Must clear cache before deleting plugin factories
kinematics_factory = tesseract_kinematics::KinematicsPluginFactory();
contact_managers_factory = tesseract_collision::ContactManagersPluginFactory();
}

bool Environment::Implementation::reset()
Expand Down

0 comments on commit 093f5ae

Please sign in to comment.