Rosanswers logo


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?


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


Originally posted by MarkyMark2012 on ROS Answers with karma: 1834 on 2014-08-20

Post score: 0

Original comments

Comment by Moda on 2014-08-20:
did you sudo apt-get install ros-yourdistro-dephtimage-to-laserscan? I've just install my XtionPro and it work fine

Comment by Moda on 2014-08-20:
I'm using hydro, and launch the openni2.launch,

Comment by MarkyMark2012 on 2014-08-20:
No this is built from scratch - running on raspberry-pi

Comment by anamcarvalho on 2014-08-24:
Have you changed anything from the original code of the package? Or any parameter?

Comment by MarkyMark2012 on 2014-08-27:
@anamcarvalho - nope changed nothing. What depth image size vs camera model size do you get? (This is with and XTion)




1 Answer 1


Rosanswers logo

Fix here

Originally posted by MarkyMark2012 with karma: 1834 on 2014-09-02

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.