@@ -237,12 +237,6 @@ SimulationRunner::SimulationRunner(const sdf::World *_world,
237
237
238
238
ignmsg << " Serving world SDF generation service on [" << opts.NameSpace ()
239
239
<< " /" << 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;
246
240
}
247
241
248
242
// ////////////////////////////////////////////////
@@ -814,7 +808,7 @@ void SimulationRunner::Step(const UpdateInfo &_info)
814
808
this ->ProcessRecreateEntitiesRemove ();
815
809
816
810
// handle systems that need to be added
817
- this ->ProcessEntitySystems ();
811
+ this ->systemMgr -> ProcessPendingEntitySystems ();
818
812
819
813
// Update all the systems.
820
814
this ->UpdateSystems ();
@@ -1446,53 +1440,6 @@ bool SimulationRunner::GenerateWorldSdf(const msgs::SdfGeneratorConfig &_req,
1446
1440
return false ;
1447
1441
}
1448
1442
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
-
1496
1443
1497
1444
// ////////////////////////////////////////////////
1498
1445
void SimulationRunner::SetFuelUriMap (
0 commit comments