Rosanswers logo

I want to use depthimage_ to_ Laserscan detects obstacles lower than the laser plane. I used turbobot3 for simulation testing, but it did not get good results.

image description

As you can see, depthimage_ to_ The laserscan program did not convert the obstacles in the figure into lasers, and I do not know what went wrong.

The following is about depthimage_ to_ Laser.launch file

  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="open_rviz" default="true"/>
  <!-- TurtleBot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  <!-- Depth Image to Laser Scan Node -->
  <node name="depthimage_to_laserscan" pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" args="">
    <remap from="image"       to="/camera/depth/image_raw"/> <!-- change here for your camera depth topic name. Default: "/camera/depth/image_raw" -->

<!-- the remap for camera_info by default uses the same path as the one given to the image topic. Default: "<path_to_image_topic>/camera_info>" -->
    <remap from="camera_info" to="/camera/depth/camera_info"/> 
    <remap from="scan" to="/xtion_scan"/> 
    <!-- PARAMETERS: -->
    <!-- These are the default values. --> 
    <param name="scan_height"     type="int"    value="1"/> <!-- default: 1 pixel. Number of pixel rows used to generate laser scan. -->
    <param name="scan_time"       type="double" value="0.033"/> <!-- default:0.033, 30 FPS . Time between scans. -->
    <param name="range_min"       type="double" value="0.45"/> <!--default:0.45m. Ranges less than this are considered -Inf. -->
    <param name="range_max"       type="double" value="10.0"/> <!--default: 10m. Ranges less than this are considered +Inf. -->
    <param name="output_frame_id" type="str"    value="camera_depth_frame"/> <!--default: camera_depth_frame. Frame id of the laser scan. -->

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find depthimage_to_laserscan)/cfg/d2l.rviz"/>

I hope someone can answer my question.Anyway,thanks.

Originally posted by wugeshenhuaking on ROS Answers with karma: 35 on 2022-10-04

Post score: 0

Original comments

Comment by Mike Scheutzow on 2022-10-06:
I think you need to investigate which row of the rectangular depth map is being used by depthimage_to_laserscan - the wiki page is not very clear about this. My best guess is that it selects the row from the middle of the image e.g. if the depth image height is 400, it uses row 200.

Comment by Mike Scheutzow on 2022-10-13:
Have you made any progress on answering this?

Comment by wugeshenhuaking on 2022-10-13:
@Mike Scheutzow As you said, it starts from the middle of the image, and searches up and down at the same time. You only need to adjust the parameters to an appropriate value to succeed. But this function package has a fatal disadvantage, that is, when the robot moves a certain distance, it cannot extract obstacles. I guess it is because the position of obstacles in the depth image has changed.

Comment by Mike Scheutzow on 2022-10-14:
Do you think this is because the object is too far away, or because the pixel row(s) don't intersect with the object?

Comment by wugeshenhuaking on 2022-10-16:
@Mike Scheutzow I think this is the pixel line does not intersect the object


1 Answer 1


Rosanswers logo

By default, only 1 row of the rectangular image is converted to a scan line. As we discussed in the comments, it uses the middle row from the image.

Originally posted by Mike Scheutzow with karma: 4903 on 2022-10-14

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

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