Skip to content

Commit

Permalink
Fix thread safety issue with set active contact manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jan 29, 2025
1 parent 708141a commit 5ea3884
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ bool Environment::Implementation::applyAddContactManagersPluginInfoCommand(
bool Environment::Implementation::applySetActiveContinuousContactManagerCommand(
const std::shared_ptr<const SetActiveContinuousContactManagerCommand>& cmd)
{
setActiveContinuousContactManagerHelper(cmd->getName());
setActiveContinuousContactManager(cmd->getName());

++revision;
commands.push_back(cmd);
Expand All @@ -2120,7 +2120,7 @@ bool Environment::Implementation::applySetActiveContinuousContactManagerCommand(
bool Environment::Implementation::applySetActiveDiscreteContactManagerCommand(
const std::shared_ptr<const SetActiveDiscreteContactManagerCommand>& cmd)
{
setActiveDiscreteContactManagerHelper(cmd->getName());
setActiveDiscreteContactManager(cmd->getName());

++revision;
commands.push_back(cmd);
Expand Down Expand Up @@ -2691,7 +2691,7 @@ tesseract_common::ContactManagersPluginInfo Environment::getContactManagersPlugi
bool Environment::setActiveDiscreteContactManager(const std::string& name)
{
std::unique_lock<std::shared_mutex> lock(mutex_);
return impl_->setActiveDiscreteContactManagerHelper(name);
return impl_->setActiveDiscreteContactManager(name);
}

std::unique_ptr<tesseract_collision::DiscreteContactManager>
Expand All @@ -2704,7 +2704,7 @@ Environment::getDiscreteContactManager(const std::string& name) const
bool Environment::setActiveContinuousContactManager(const std::string& name)
{
std::unique_lock<std::shared_mutex> lock(mutex_);
return impl_->setActiveContinuousContactManagerHelper(name);
return impl_->setActiveContinuousContactManager(name);
}

std::unique_ptr<tesseract_collision::ContinuousContactManager>
Expand Down

0 comments on commit 5ea3884

Please sign in to comment.