diff --git a/src/SdfEntityCreator.cc b/src/SdfEntityCreator.cc index 8d8be86491..1c45bfc4e8 100644 --- a/src/SdfEntityCreator.cc +++ b/src/SdfEntityCreator.cc @@ -319,9 +319,6 @@ void SdfEntityCreator::CreateEntities(const sdf::World *_world, components::SphericalCoordinates(*_world->SphericalCoordinates())); } - this->dataPtr->eventManager->Emit(_worldEntity, - _world->Plugins()); - // Models for (uint64_t modelIndex = 0; modelIndex < _world->ModelCount(); ++modelIndex) @@ -331,7 +328,7 @@ void SdfEntityCreator::CreateEntities(const sdf::World *_world, levelEntityNames.find(model->Name()) != levelEntityNames.end()) { - Entity modelEntity = this->CreateEntities(model); + Entity modelEntity = this->CreateEntities(model, false); this->SetParent(modelEntity, _worldEntity); } @@ -381,7 +378,7 @@ void SdfEntityCreator::CreateEntities(const sdf::World *_world, if (_world->ModelNameExists(_ref->Data())) { const sdf::Model *model = _world->ModelByName(_ref->Data()); - Entity modelEntity = this->CreateEntities(model); + Entity modelEntity = this->CreateEntities(model, false); this->SetParent(modelEntity, _worldEntity); this->SetParent(_entity, modelEntity); } @@ -456,6 +453,12 @@ void SdfEntityCreator::CreateEntities(const sdf::World *_world, // Store the world's SDF DOM to be used when saving the world to file this->dataPtr->ecm->CreateComponent( _worldEntity, components::WorldSdf(*_world)); + + this->dataPtr->eventManager->Emit(_worldEntity, + _world->Plugins()); + + // Load model plugins after the world plugin. + this->LoadModelPlugins(); } ////////////////////////////////////////////////// diff --git a/src/systems/logical_audio_sensor_plugin/LogicalAudioSensorPlugin.cc b/src/systems/logical_audio_sensor_plugin/LogicalAudioSensorPlugin.cc index a460e620c2..e4d633cd59 100644 --- a/src/systems/logical_audio_sensor_plugin/LogicalAudioSensorPlugin.cc +++ b/src/systems/logical_audio_sensor_plugin/LogicalAudioSensorPlugin.cc @@ -405,7 +405,7 @@ void LogicalAudioSensorPluginPrivate::CreateAudioSource( }; // create services for this source - const auto validName = topicFromScopedName(entity, _ecm, false); + const auto validName = topicFromScopedName(entity, _ecm, true); if (validName.empty()) { gzerr << "Failed to create valid topics with entity scoped name [" @@ -503,7 +503,7 @@ void LogicalAudioSensorPluginPrivate::CreateMicrophone( // create the detection publisher for this microphone auto pub = this->node.Advertise( - topicFromScopedName(entity, _ecm, false) + "/detection"); + topicFromScopedName(entity, _ecm, true) + "/detection"); if (!pub) { gzerr << "Error creating a detection publisher for microphone " diff --git a/src/systems/pose_publisher/PosePublisher.cc b/src/systems/pose_publisher/PosePublisher.cc index 28fbbdc8d4..395f3dc9bf 100644 --- a/src/systems/pose_publisher/PosePublisher.cc +++ b/src/systems/pose_publisher/PosePublisher.cc @@ -252,7 +252,7 @@ void PosePublisher::Configure(const Entity &_entity, this->dataPtr->usePoseV = _sdf->Get("use_pose_vector_msg", this->dataPtr->usePoseV).first; - std::string poseTopic = topicFromScopedName(_entity, _ecm, false) + "/pose"; + std::string poseTopic = topicFromScopedName(_entity, _ecm, true) + "/pose"; if (poseTopic.empty()) { poseTopic = "/pose";