Skip to content

Commit

Permalink
Create resources if a world file contains any model
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Sep 14, 2021
1 parent 8c15353 commit 40324ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scenario/src/gazebo/src/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ bool World::createECMResources()
<< "step=" << physics.MaxStepSize() << std::endl
<< "type=" << physics.EngineType() << std::endl;

// Create required model resources
sMessage << "Models:" << std::endl;
for (const auto& model : this->models()) {
if (!std::static_pointer_cast<Model>(model)->createECMResources()) {
sError << "Failed to initialize ECM model resources" << std::endl;
return false;
}
}

return true;
}

Expand Down

0 comments on commit 40324ae

Please sign in to comment.