Skip to content

Commit 24ebe9e

Browse files
committed
store canonical link mappings in its own class, not in a component
Signed-off-by: Ashton Larkin <[email protected]>
1 parent 2d096fe commit 24ebe9e

File tree

7 files changed

+314
-755
lines changed

7 files changed

+314
-755
lines changed

include/ignition/gazebo/components/ReferenceModels.hh

-124
This file was deleted.

src/SdfEntityCreator.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
#include "ignition/gazebo/components/ParentEntity.hh"
6060
#include "ignition/gazebo/components/Physics.hh"
6161
#include "ignition/gazebo/components/Pose.hh"
62-
#include "ignition/gazebo/components/ReferenceModels.hh"
6362
#include "ignition/gazebo/components/RgbdCamera.hh"
6463
#include "ignition/gazebo/components/Scene.hh"
6564
#include "ignition/gazebo/components/SelfCollide.hh"
@@ -404,11 +403,8 @@ Entity SdfEntityCreator::CreateEntities(const sdf::Model *_model,
404403
canonicalLinkPair.second, modelEntity, *this->dataPtr->ecm);
405404
if (kNullEntity != canonicalLinkEntity)
406405
{
407-
// Map this canonical link to the model. Since a link may be the
408-
// canonical link for multiple models (example: nested models), create
409-
// a component that completes this mapping if it doesn't already exist.
410-
this->dataPtr->ecm->ComponentDefault<components::ReferenceModels>(
411-
canonicalLinkEntity)->Data().AddModel(modelEntity);
406+
this->dataPtr->ecm->CreateComponent(
407+
modelEntity, components::ModelCanonicalLink(canonicalLinkEntity));
412408
}
413409
else
414410
{

0 commit comments

Comments
 (0)