Skip to content

Commit

Permalink
Restore behavior change by reverting #2527 (#2546)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Aug 27, 2024
1 parent 19801c8 commit 1184481
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/SdfEntityCreator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,6 @@ void SdfEntityCreator::CreateEntities(const sdf::World *_world,
components::SphericalCoordinates(*_world->SphericalCoordinates()));
}

this->dataPtr->eventManager->Emit<events::LoadSdfPlugins>(_worldEntity,
_world->Plugins());

// Models
for (uint64_t modelIndex = 0; modelIndex < _world->ModelCount();
++modelIndex)
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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<events::LoadSdfPlugins>(_worldEntity,
_world->Plugins());

// Load model plugins after the world plugin.
this->LoadModelPlugins();
}

//////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ["
Expand Down Expand Up @@ -503,7 +503,7 @@ void LogicalAudioSensorPluginPrivate::CreateMicrophone(

// create the detection publisher for this microphone
auto pub = this->node.Advertise<msgs::Double>(
topicFromScopedName(entity, _ecm, false) + "/detection");
topicFromScopedName(entity, _ecm, true) + "/detection");
if (!pub)
{
gzerr << "Error creating a detection publisher for microphone "
Expand Down
2 changes: 1 addition & 1 deletion src/systems/pose_publisher/PosePublisher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void PosePublisher::Configure(const Entity &_entity,
this->dataPtr->usePoseV =
_sdf->Get<bool>("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";
Expand Down

0 comments on commit 1184481

Please sign in to comment.