Having trouble with the depth image to laserscan converstion

asked 2018-09-24 06:07:37 -0500

stevemartin gravatar image

I have my robot simulation which uses Intel Realsense plugin and I wanted to do the mapping using the depth camera. However, when I launch the depthimage_to_laserscan package, I get this error: Could not convert depth image to laserscan:

Cannot call rectifyPoint when distortion is unknown.

Even though, I have remapped the necessary topics:

<node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan">
    <param name="scan_height" value="3"/>
    <param name="output_frame_id" value="camera_depth_frame"/>
    <remap from="image" to="/realsense/camera/depth/image_rect"/>
    <remap from="camera_info" to="/realsense/camera/depth/camera_info"/>
  </node>

I have checked the camera_info topic and it continuously publishes the disstortion_model message:

distortion_model: ''
D: []
K: [463.8890075683594, 0.0, 320.0, 0.0, 463.8890075683594, 240.0, 0.0, 0.0, 1.0]
R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
P: [463.8890075683594, 0.0, 320.0, 0.0, 0.0, 463.8890075683594, 240.0, 0.0, 0.0, 0.0, 1.0, 0.0]

What am I doing wrong?

edit retag flag offensive close merge delete

Comments

Your distortion matrix D is empty as the error message says (look here at CameraInfo). Is your realsense camera well calibrated?

l4ncelot gravatar image l4ncelot  ( 2018-09-24 06:36:50 -0500 )edit

@l4ncelot I did not calibrate the camera, I just used this open source plugin https://github.com/SyrianSpock/realse...

Do I need to calibrate it? If yes, can you point somewhere?

stevemartin gravatar image stevemartin  ( 2018-09-24 06:53:51 -0500 )edit

Sorry, I overlooked you're using Gazebo plugin. So you don't need to calibrate it.

l4ncelot gravatar image l4ncelot  ( 2018-09-24 06:57:23 -0500 )edit

@l4ncelot So I guess I have to populate D matrix with 0s? Can I do it manually?

stevemartin gravatar image stevemartin  ( 2018-09-24 07:02:27 -0500 )edit

You can. Editing this should be enough. But I have no idea, if it's gonna solve the initial problem... try it though.

l4ncelot gravatar image l4ncelot  ( 2018-09-24 07:15:36 -0500 )edit

@l4ncelot Yes, that sucks, I wouldn't even bother doing that. Btw, do you have an idea how to launch this wrapper https://github.com/intel-ros/realsense I guess I need to add the functionality to gazebo

stevemartin gravatar image stevemartin  ( 2018-09-24 08:46:40 -0500 )edit

@stevemartin: from the code I'm not sure what's happening here.

distortion_state should be == NONE, as D is empty.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-24 10:32:53 -0500 )edit

And with distortion_state == NONE, the image should just be forwarded instead of being undistorted.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-24 10:33:50 -0500 )edit