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

Added workaround to disable plugin on model removal. #1

Merged
merged 1 commit into from
Oct 25, 2023
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: 8 additions & 0 deletions system__waste_bin/src/WasteBin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ void WasteBin::PostUpdate(const UpdateInfo & _info,
if (_info.paused) return;
if (!this->dataPtr->configured) return;

if (!this->dataPtr->model.Valid(_ecm))
{
gzwarn << "Model <" << this->dataPtr->modelName << "> no longer valid. "
<< "Disabling WasteBin plugin." << std::endl;
this->dataPtr->configured = false;
return;
}

// This conceptually rather belongs to the Configure() step, but in the Configure() step
// the ContactSensorData components are not yet created.
if (!this->dataPtr->collisionsInitialized)
Expand Down