depthimage_to_laserscan - image convertion error
Hi,
Getting, what I can only assume is a simple problem to fix but I've yet to find it, with depthimage_to_laser scan using an XTion sensor.
I'm starting up the xtion driver and depthimage_to_laser scan thus:
rosrun openni2_camera openni2_camera_node /openni2_camera/deh/image_raw:=/image /openni2_camera/depth/camera_info:=/camera_info
rosrun depthimage_to_laserscan depthimage_to_laserscan
But get this error:
"Could not convert depth image to laserscan: scan_height ( 1 pixels) is too large for the image height."
The camera_info topic is reporting (rostopic echo /camera_info):
header: seq: 811175 stamp: secs: 1408516955 nsecs: 604143184 frame_id: /openni2_depth_frame height: 480 width: 640 distortion_model: plumb_bob D: [0.0, 0.0, 0.0, 0.0, 0.0] K: [570.3422241210938, 0.0, 314.5, 0.0, 570.3422241210938, 235.5, 0.0, 0.0, 1.0] R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] P: [570.3422241210938, 0.0, 314.5, 0.0, 0.0, 570.3422241210938, 235.5, 0.0, 0.0, 0.0, 1.0, 0.0] binning_x: 0 binning_y: 0 roi: x_offset: 0 y_offset: 0 height: 0 width: 0 do_rectify: False
Which to me looks like the frame sizing should be fine. I can view the depth image in rviz with out issue
Does anyone have a suggestion re: what I can check?
UPDATE:
So I've updated the depthimage_to_laserscan code to give me a better idea of what is going on around this error
the if statement:
if(scan_height_/2 > cam_model_.cy() || scan_height_/2 > depth_msg->height - cam_model_.cy())
{
...
}
because after listing the componnet data i get:
[ERROR] [1408936282.644193807]: Could not convert depth image to laserscan: scan_height ( 1 pixels) is too large for the image height.
cam_model_.cy 235.5
depth_msg->height 120
depth_msg->height - cam_model_.cy() -115.5
Obviously 0.5 > -115.5
If I take that check put it'll run for a while producing some data then crash with a seg fault.
Any idea on that logic?
Many Thanks
Mark
did you sudo apt-get install ros-yourdistro-dephtimage-to-laserscan? I've just install my XtionPro and it work fine
I'm using hydro, and launch the openni2.launch,
No this is built from scratch - running on raspberry-pi
Have you changed anything from the original code of the package? Or any parameter?
@anamcarvalho - nope changed nothing. What depth image size vs camera model size do you get? (This is with and XTion)
Thanks
Mark