Skip to content

Commit

Permalink
Update LogicalCamera plugin to detect nested models (#2788) (#2800)
Browse files Browse the repository at this point in the history
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)

Co-authored-by: Dyst-0 <69257845+Dyst-0@users.noreply.github.com>
  • Loading branch information
mergify[bot] and Dyst-0 authored Feb 27, 2025
1 parent c0b8a1b commit 2c9466d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/systems/logical_camera/LogicalCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,14 @@ void LogicalCameraPrivate::UpdateLogicalCameras(
GZ_PROFILE("LogicalCameraPrivate::UpdateLogicalCameras");
std::map<std::string, math::Pose3d> modelPoses;

_ecm.Each<components::Model, components::Name, components::Pose>(
[&](const Entity &,
const components::Model *,
const components::Name *_name,
const components::Pose *_pose)->bool
{
/// todo(anyone) We currently assume there are only top level models
/// Update to retrieve world pose when nested models are supported.
modelPoses[_name->Data()] = _pose->Data();
return true;
});

_ecm.Each<components::Model, components::Name>(
[&](const Entity &_entity,
const components::Model *,
const components::Name *_name)->bool
{
modelPoses[_name->Data()] = worldPose(_entity, _ecm);
return true;
});

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

0 comments on commit 2c9466d

Please sign in to comment.