Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 124be23 + cb0d2f9 commit 8075a22Copy full SHA for 8075a22
camera_handler/src/CameraHandler.cpp
@@ -170,7 +170,7 @@ void CameraHandler::handleSimulation(){
170
depth_msg.height=resol[1]; //Set the height of the image
171
depth_msg.is_bigendian=0;
172
depth_msg.encoding=sensor_msgs::image_encodings::TYPE_32FC1;
173
- depth_msg.step=depth_msg.width*sizeof(simFloat);
+ depth_msg.step=depth_msg.width*sensor_msgs::image_encodings::bitDepth(depth_msg.encoding)/8;
174
depth_msg.data.resize(depth_msg.height*depth_msg.step);
175
const simFloat* depth_buf = simGetVisionSensorDepthBuffer(_associatedObjectID);
176
simFloat* depth_img = reinterpret_cast<simFloat*>(depth_msg.data.data());
0 commit comments