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

Add a flexible mechanism to combine user and default plugins #2497

Merged
merged 18 commits into from
Aug 29, 2024
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into config_loading
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
azeey committed Aug 26, 2024
commit a9b759498f4a93df79d221b6b2b7ce98ced230d2
16 changes: 0 additions & 16 deletions src/LevelManager.cc
Original file line number Diff line number Diff line change
@@ -110,22 +110,6 @@ void LevelManager::ReadLevelPerformerInfo(const sdf::World &_world)
gzerr << "Could not find a plugin tag with name " << kPluginName
<< ". Levels and distributed simulation will not work.\n";
}
else
{
this->ReadPerformers(pluginElem);
if (this->useLevels)
this->ReadLevels(pluginElem);
}

this->ConfigureDefaultLevel();

/* // Load world plugins. */
/* this->runner->EventMgr().Emit<events::LoadSdfPlugins>(this->worldEntity, */
/* this->runner->sdfWorld->Plugins()); */

// Store the world's SDF DOM to be used when saving the world to file
this->runner->entityCompMgr.CreateComponent(
worldEntity, components::WorldSdf(*this->runner->sdfWorld));
}

/////////////////////////////////////////////////
7 changes: 2 additions & 5 deletions src/SimulationRunner.cc
Original file line number Diff line number Diff line change
@@ -246,7 +246,6 @@ SimulationRunner::SimulationRunner(const sdf::World &_world,
// Create the level manager
this->levelMgr = std::make_unique<LevelManager>(this,
this->serverConfig.UseLevels());

auto worldElem = this->sdfWorld->Element();
bool includeDefaultServerPlugins = true;
bool includeDefaultGuiPlugins = true;
@@ -264,7 +263,6 @@ SimulationRunner::SimulationRunner(const sdf::World &_world,
.first;
}
}

auto getUserPlugins = [&]()
{
std::list<ServerConfig::PluginInfo> userPlugins;
@@ -274,7 +272,6 @@ SimulationRunner::SimulationRunner(const sdf::World &_world,
}
return userPlugins;
};

auto combineUserAndDefaultPlugins =
[](const auto &_userPlugins, const auto &_defaultPlugins, bool _includeDefaultPlugins)
{
@@ -331,11 +328,11 @@ SimulationRunner::SimulationRunner(const sdf::World &_world,
/* gzdbg << plugin.Plugin().Element()->ToString("\t"); */
}

this->CreateEntities(_world);
this->LoadServerPlugins(pluginsToLoad);
// Store the initial state of the ECM;
this->initialEntityCompMgr.CopyFrom(this->entityCompMgr);

this->LoadLoggingPlugins(this->serverConfig);

// TODO(louise) Combine both messages into one.
this->node->Advertise("control", &SimulationRunner::OnWorldControl, this);
@@ -352,7 +349,7 @@ SimulationRunner::SimulationRunner(const sdf::World &_world,
// In the future, support modifying GUI from the server at runtime.
if (_world.Gui())
{
this->guiMsg = convert<msgs::GUI>(*_world->Gui());
this->guiMsg = convert<msgs::GUI>(*_world.Gui());
if (worldElem)
{
auto policies = worldElem->FindElement("gz:policies");
You are viewing a condensed version of this merge commit. You can view the full changes here.