[SOLVED] rtabmap fails to run a bag of depth and rgdb images
Hi,
I am playing a bag of 16 bits-per-pixel depth and 8 bit rgb images. While playing the bag, I can extract both the rgb and the depth images into files (to verify that the data is ok) (I used the thread here to create and extract the depth images)
The way the depth image is stored in the bag is by using a python script that uses the PIL package to read a pgm image from file into a PIL object, serialize the object data into byte array (using io.BytesIO()), and save the byte array in PPM format.
To verify the data, I wanted to view the images first, before running rtabmap In rviz I can view the rgb image, but I cannot view the depth image. According to here:
"RVIZ cannot view 16 bit images natively. You'll have to convert them to an 8 bit format."
So I assume that the images are correct and move on to use rtabmap I launch rtabmap using the launch file below:
roslaunch ~/avner/PGR/vision/trunk/ros/catkin_ws/src/bpc_slam_rtabmap/launch/rgbd_slam.rgbd_dataset4.launch
But I cannot see the 3D map in rviz, and I do see error messages from rgbd_odometry
...
BEG getCvType
terminate called after throwing an instance of 'cv_bridge::Exception'
what(): Image is wrongly formed: height * step != size or 385 * 1280 != 492817
Aborted
The depth file is stored the bag in PPM format. The data payload is 492800 (6402385)
- width: 640
- height: 385
- bytes per pixel 2
- step size 640*2 = 1280
The size of the file is 492817, due to the header payload
So actually, the details in the error message are correct ("height*step" should not be equal to "size") Can someone tell me what am I doing wrong and how to satisfy rgbd_odometry?
Thanks,
Avner
Looking at http://docs.ros.org/jade/api/cv_bridg... , the data in sensor_msgs::Image topic should not include the header.