diff --git a/src/rendering/RenderUtil.cc b/src/rendering/RenderUtil.cc index eff16149ea..7af78219a5 100644 --- a/src/rendering/RenderUtil.cc +++ b/src/rendering/RenderUtil.cc @@ -356,9 +356,14 @@ class ignition::gazebo::RenderUtilPrivate /// RenderUtil::Update. /// \param[in] _actorAnimationData A map of entities to their animation update /// data. + /// \param[in] _entityPoses A map of entity ids and pose updates. + /// \param[in] _trajectoryPoses A map of entity ids and trajectory + /// pose updates. /// \sa actorManualSkeletonUpdate public: void UpdateAnimation(const std::unordered_map &_actorAnimationData); + AnimationUpdateData> &_actorAnimationData, + const std::unordered_map &_entityPoses, + const std::unordered_map &_trajectoryPoses); }; ////////////////////////////////////////////////// @@ -804,7 +809,8 @@ void RenderUtil::Update() } else { - this->dataPtr->UpdateAnimation(actorAnimationData); + this->dataPtr->UpdateAnimation(actorAnimationData, entityPoses, + trajectoryPoses); } } @@ -2028,8 +2034,10 @@ void RenderUtilPrivate::UpdateThermalCamera(const std::unordered_map &_actorAnimationData) +void RenderUtilPrivate::UpdateAnimation(const std::unordered_map &_actorAnimationData, + const std::unordered_map &_entityPoses, + const std::unordered_map &_trajectoryPoses) { for (auto &it : _actorAnimationData) { @@ -2098,16 +2106,18 @@ void RenderUtilPrivate::UpdateAnimation( // update actor trajectory animation math::Pose3d globalPose; - if (entityPoses.find(it.first) != entityPoses.end()) + auto entityPosesIt = _entityPoses.find(it.first); + if (entityPosesIt != _entityPoses.end()) { - globalPose = entityPoses[it.first]; + globalPose = entityPosesIt->second; } math::Pose3d trajPose; // Trajectory from the ECS - if (trajectoryPoses.find(it.first) != trajectoryPoses.end()) + auto trajectoryPosesIt = _trajectoryPoses.find(it.first); + if (trajectoryPosesIt != _trajectoryPoses.end()) { - trajPose = trajectoryPoses[it.first]; + trajPose = trajectoryPosesIt->second; } else { diff --git a/test/integration/follow_actor_system.cc b/test/integration/follow_actor_system.cc index 654e578c85..566384f1bf 100644 --- a/test/integration/follow_actor_system.cc +++ b/test/integration/follow_actor_system.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "ignition/gazebo/components/Actor.hh" #include "ignition/gazebo/components/Name.hh" @@ -88,7 +89,7 @@ class Relay ///////////////////////////////////////////////// -TEST_P(FollowActorTest, PublishCmd) +TEST_P(FollowActorTest, IGN_UTILS_TEST_DISABLED_ON_MAC(PublishCmd)) { // Start server ServerConfig serverConfig; diff --git a/test/worlds/follow_actor.sdf b/test/worlds/follow_actor.sdf index 1bc7015a70..a02a444fc6 100644 --- a/test/worlds/follow_actor.sdf +++ b/test/worlds/follow_actor.sdf @@ -1,6 +1,46 @@ + + + + ogre2 + + + true + 0 0 0 0 0 0 + + + + + 0.1 0.1 0.1 + + + + + 1 0 1.3 0 0 0 + + 1.047 + + 320 + 240 + + + 0.1 + 100 + + + 1 + 30 + true + camera + + + + true 1 -2 0.5 0 0 0