#!c++
// msg is of type gazebo::msgs::LogicalCameraImage
// Pose of camera in world coordinates
ignition::math::Pose3d cameraPose = gazebo::msgs::ConvertIgn(msg.pose());
// Pose of first model relative to camera
ignition::math::Pose3d modelRelativePose = gazebo::msgs::ConvertIgn(msg.model(0).pose());
// Pose of first model in world coordinates
ignition::math::Pose3d modelWorldPose = modelRelativePose + cameraPose;
Original report (archived issue) by Anonymous.
Under the Model Poses title, the given code has an error during the calculation of model's world pose. Page URL: http://gazebosim.org/tutorials?tut=logical_camera_sensor&cat=sensors#ModelPoses
Last line should be like this.