Having trouble with the depth image to laserscan converstion
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 depthimagetolaserscan 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 camerainfo topic and it continuously publishes the disstortionmodel 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?
Asked by stevemartin on 2018-09-24 06:07:37 UTC
Comments
Your distortion matrix D is empty as the error message says (look here at CameraInfo). Is your realsense camera well calibrated?
Asked by l4ncelot on 2018-09-24 06:36:50 UTC
@l4ncelot I did not calibrate the camera, I just used this open source plugin https://github.com/SyrianSpock/realsense_gazebo_plugin
Do I need to calibrate it? If yes, can you point somewhere?
Asked by stevemartin on 2018-09-24 06:53:51 UTC
Sorry, I overlooked you're using Gazebo plugin. So you don't need to calibrate it.
Asked by l4ncelot on 2018-09-24 06:57:23 UTC
@l4ncelot So I guess I have to populate D matrix with 0s? Can I do it manually?
Asked by stevemartin on 2018-09-24 07:02:27 UTC
You can. Editing this should be enough. But I have no idea, if it's gonna solve the initial problem... try it though.
Asked by l4ncelot on 2018-09-24 07:15:36 UTC
@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
Asked by stevemartin on 2018-09-24 08:46:40 UTC
@stevemartin: from the code I'm not sure what's happening here.
distortion_state
should be== NONE
, asD
is empty.Asked by gvdhoorn on 2018-09-24 10:32:53 UTC
And with
distortion_state == NONE
, the image should just be forwarded instead of being undistorted.Asked by gvdhoorn on 2018-09-24 10:33:50 UTC
Hi! Any updates on this? I managed to publish a non-empty distortion matrix from the gazebo plugin but it didn't solve the problem.
Asked by Jasmin on 2019-10-10 09:44:51 UTC
It didn't work because I forgot to set
info_msg.distortion_model
. The error disappears when setting it as well as theinfo_msg.D
matrix.Asked by Jasmin on 2019-10-11 09:29:33 UTC