osrf / gazebo_tutorials

Tutorials for gazebo
http://gazebosim.org/tutorials
150 stars 72 forks source link

Logical Camera Sensor Information Is Wrong #90

Open osrf-migration opened 5 years ago

osrf-migration commented 5 years ago

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

#!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;

Last line should be like this.