RE: Problems interfacing RTAB-Map and V-Rep
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Problems-interfacing-RTAB-Map-and-V-Rep-tp1444p1461.html
Hi,
Your sensor_msgs/Image should have "32FC1" or "16UC1" encoding. Using cv_bridge, you can create such image like this:
cv::Mat depthData(480, 640, CV_32FC1); // your input data from VREP (values scaled between 0 and 1)
cv_bridge::CvImage depth;
depth.header.frame_id = "camera";
depth.header.stamp = ros::time::now();
depth.encoding = "bgr8";
depth.image = depthData * 3.0f; // scale to 3 meters
depthPub.publish(depth.toImageMsg());
You may want to use DepthCloud Plugin in RVIZ to visualize the cloud generated by depth and rgb topics.
cheers