Skip to content

Commit c68ba90

Browse files
Dyst-0mergify[bot]
authored andcommitted
Update LogicalCamera plugin to detect nested models (#2788)
Signed-off-by: Dyst-0 <69257845+Dyst-0@users.noreply.github.com> Signed-off-by: Ian Chen <ichen@openrobotics.org> Co-authored-by: Ian Chen <ichen@openrobotics.org> (cherry picked from commit 036515f)
1 parent c0b8a1b commit c68ba90

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/systems/logical_camera/LogicalCamera.cc

+8-12
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,14 @@ void LogicalCameraPrivate::UpdateLogicalCameras(
255255
GZ_PROFILE("LogicalCameraPrivate::UpdateLogicalCameras");
256256
std::map<std::string, math::Pose3d> modelPoses;
257257

258-
_ecm.Each<components::Model, components::Name, components::Pose>(
259-
[&](const Entity &,
260-
const components::Model *,
261-
const components::Name *_name,
262-
const components::Pose *_pose)->bool
263-
{
264-
/// todo(anyone) We currently assume there are only top level models
265-
/// Update to retrieve world pose when nested models are supported.
266-
modelPoses[_name->Data()] = _pose->Data();
267-
return true;
268-
});
269-
258+
_ecm.Each<components::Model, components::Name>(
259+
[&](const Entity &_entity,
260+
const components::Model *,
261+
const components::Name *_name)->bool
262+
{
263+
modelPoses[_name->Data()] = worldPose(_entity, _ecm);
264+
return true;
265+
});
270266

271267
_ecm.Each<components::LogicalCamera, components::WorldPose>(
272268
[&](const Entity &_entity,

0 commit comments

Comments
 (0)