Skip to content

Commit

Permalink
Update environment clear method to clear all internal cache data
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 26, 2023
1 parent 9c96ee7 commit 6329eb1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,39 @@ void Environment::clear()
init_revision_ = 0;
scene_graph_ = nullptr;
state_solver_ = nullptr;
current_state_ = tesseract_scene_graph::SceneState();
commands_.clear();
kinematics_information_.clear();
kinematics_factory_ = tesseract_kinematics::KinematicsPluginFactory();
is_contact_allowed_fn_ = nullptr;
collision_margin_data_ = tesseract_collision::CollisionMarginData();
contact_managers_plugin_info_.clear();
contact_managers_factory_ = tesseract_collision::ContactManagersPluginFactory();

{
std::unique_lock<std::shared_mutex> lock(discrete_manager_mutex_);
discrete_manager_ = nullptr;
}

{
std::unique_lock<std::shared_mutex> lock(continuous_manager_mutex_);
continuous_manager_ = nullptr;
}

{
std::unique_lock<std::shared_mutex> lock(group_joint_names_cache_mutex_);
group_joint_names_cache_.clear();
}

{
std::unique_lock<std::shared_mutex> lock(joint_group_cache_mutex_);
joint_group_cache_.clear();
}

{
std::unique_lock<std::shared_mutex> lock(kinematic_group_cache_mutex_);
kinematic_group_cache_.clear();
}
}

Commands Environment::getInitCommands(const tesseract_scene_graph::SceneGraph& scene_graph,
Expand Down

1 comment on commit 6329eb1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 6329eb1 Previous: 9c96ee7 Ratio
BM_CONTACT_TEST_0_BulletDiscreteBVHManager_LIMITED_CAPSULE_SPHERE/real_time 1.634949235208896 us/iter 0.8113518109704472 us/iter 2.02

This comment was automatically generated by workflow using github-action-benchmark.

CC: @Levi-Armstrong

Please sign in to comment.