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 thread safety issue with set active contact manager #1118

Merged
Changes from all 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
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
Loading