@@ -237,12 +237,6 @@ SimulationRunner::SimulationRunner(const sdf::World *_world,
237237
238238 ignmsg << " Serving world SDF generation service on [" << opts.NameSpace ()
239239 << " /" << genWorldSdfService << " ]" << std::endl;
240-
241- std::string entitySystemService{" entity/system/add" };
242- this ->node ->Advertise (entitySystemService,
243- &SimulationRunner::EntitySystemAddService, this );
244- ignmsg << " Serving entity system service on [" << opts.NameSpace ()
245- << " /" << entitySystemService << " ]" << std::endl;
246240}
247241
248242// ////////////////////////////////////////////////
@@ -814,7 +808,7 @@ void SimulationRunner::Step(const UpdateInfo &_info)
814808 this ->ProcessRecreateEntitiesRemove ();
815809
816810 // handle systems that need to be added
817- this ->ProcessEntitySystems ();
811+ this ->systemMgr -> ProcessPendingEntitySystems ();
818812
819813 // Update all the systems.
820814 this ->UpdateSystems ();
@@ -1446,53 +1440,6 @@ bool SimulationRunner::GenerateWorldSdf(const msgs::SdfGeneratorConfig &_req,
14461440 return false ;
14471441}
14481442
1449- // ////////////////////////////////////////////////
1450- bool SimulationRunner::EntitySystemAddService (const msgs::EntityPlugin_V &_req,
1451- msgs::Boolean &_res)
1452- {
1453- std::lock_guard<std::mutex> lock (this ->systemsMsgMutex );
1454- this ->systemsToAdd .push_back (_req);
1455- _res.set_data (true );
1456- return true ;
1457- }
1458-
1459- // ////////////////////////////////////////////////
1460- void SimulationRunner::ProcessEntitySystems ()
1461- {
1462- std::lock_guard<std::mutex> lock (this ->systemsMsgMutex );
1463- for (auto &req : this ->systemsToAdd )
1464- {
1465- Entity entity = req.entity ().id ();
1466-
1467- for (auto &pluginMsg : req.plugins ())
1468- {
1469- std::string fname = pluginMsg.filename ();
1470- std::string name = pluginMsg.name ();
1471- std::string innerxml = pluginMsg.innerxml ();
1472-
1473- // Use the SDF parser to read all the inner xml.
1474- sdf::ElementPtr pluginSDF (new sdf::Element);
1475- sdf::initFile (" plugin.sdf" , pluginSDF);
1476- std::stringstream tmp;
1477- tmp << " <sdf version='" << SDF_VERSION << " '>" ;
1478- tmp << " <plugin name='" << name << " ' filename='" << fname << " '>" ;
1479- tmp << innerxml;
1480- tmp << " </plugin></sdf>" ;
1481-
1482- if (sdf::readString (tmp.str (), pluginSDF))
1483- {
1484- this ->LoadPlugin (entity, fname, name, pluginSDF);
1485- }
1486- else
1487- {
1488- ignerr << " Error reading Plugin SDF. Unable to parse Innerxml:\n "
1489- << innerxml << std::endl;
1490- }
1491- }
1492- }
1493- this ->systemsToAdd .clear ();
1494- }
1495-
14961443
14971444// ////////////////////////////////////////////////
14981445void SimulationRunner::SetFuelUriMap (
0 commit comments