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 segfault in the Breadcrumbs system #180

Merged
merged 3 commits into from
Jun 5, 2020
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions src/systems/breadcrumbs/Breadcrumbs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ void Breadcrumbs::PreUpdate(const ignition::gazebo::UpdateInfo &_info,
}

std::set<Entity> processedEntities;
for (const auto &e : this->pendingGeometryUpdate) {
for (const auto &e : this->pendingGeometryUpdate)
{
Entity perf = _ecm.EntityByComponents(components::Performer(),
components::ParentEntity(e));
if (perf == kNullEntity)
Expand Down Expand Up @@ -282,16 +283,15 @@ void Breadcrumbs::PreUpdate(const ignition::gazebo::UpdateInfo &_info,
auto td = _info.simTime - it->second;
if (td > this->disablePhysicsTime)
{
auto nameComp = _ecm.Component<components::Name>(it->first);
auto name = _ecm.Component<components::Name>(it->first)->Data();
if (!this->MakeStatic(it->first, _ecm))
{
ignerr << "Failed to make breadcrumb '" << nameComp->Data()
ignerr << "Failed to make breadcrumb '" << name
<< "' static." << std::endl;
}
else
{
ignmsg << "Breadcrumb '" << nameComp->Data()
<< "' is now static." << std::endl;
ignmsg << "Breadcrumb '" << name << "' is now static." << std::endl;
}
this->autoStaticEntities.erase(it++);
}
Expand Down