Ask Your Question

getting inf values in scan using pointcloud_to_laserscan indigo

asked 2016-01-05 09:19:18 -0600

Naman gravatar image

updated 2016-01-08 11:19:23 -0600


-- See Update 2 --

I am using iai_kinect2(ROS Indigo and Ubuntu 14.04) to get a depth cloud from my Kinect2 in the form sensor_msgs/Image. Then, it is converted to sensor_msgs/PointCloud2 using depth_image_proc to do all the filtering operations using pcl. Now, I want to use pointcloud_to_laserscan but I am having some issues in converting the filtered_pointcloud to laser_scan. It does not give any error but the output laser_scan contains only INF. There are many related posts like this and this. I can't use depthimage_to_laserscan because I need to merge multiple point clouds and do filtering. Also, I tried changing the target_frame to kinect2_link but that didn't help. Also, I tried changing some of the parameters but no change in the output laser_scan. Here is my launch file :


    <node pkg="kinect2_bridge" type="kinect2_bridge" name="kinect2" output="screen">
        <param name="publish_tf" value="true"/>

    <node pkg="nodelet" type="nodelet" name="standalone_nodelet"  args="manager"/>

    <node pkg="nodelet" type="nodelet" name="point_cloud_xyz" args="load depth_image_proc/point_cloud_xyz standalone_nodelet">
        <remap from="camera_info" to="/kinect2/sd/camera_info"/>
        <remap from="image_rect" to="/kinect2/sd/image_depth_rect"/>    
        <remap from="points" to="/kinect2/pointcloud"/>

    <node pkg="kinect2_filtering" type="kinect2_filtering" name="kinect2_filtering" output="screen"/>

    <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pcl_to_laser" output="screen">
        <remap from="cloud_in" to="/kinect2/pointcloud_filtered"/>
        <remap from="scan" to="scan2"/>
                target_frame: kinect2_link # Leave disabled to output scan in pointcloud frame
                transform_tolerance: 0.01
                min_height: 0.0
                max_height: 1.0

                angle_min: -1.5708 # -M_PI/2
                angle_max: 1.5708 # M_PI/2
                angle_increment: 0.0523 # M_PI/360.0
                scan_time: 0.3333
                range_min: 0.45
                range_max: 4.0
                use_inf: true

                # Concurrency level, affects number of pointclouds queued for processing and number of threads used
                # 0 : Detect number of cores
                # 1 : Single threaded
                # 2->inf : Parallelism level
                concurrency_level: 1


I am unable to make pointcloud_to_laserscan work properly. Does anyone have any idea what is the issue here? Any help will be appreciated.

Update 1 : When I changed max_height: 5.0, I get a laser_scan but it is completely wrong. Here it is :

  seq: 7653
    secs: 1452114415
    nsecs: 194144000
  frame_id: kinect2_link
angle_min: -1.57079994678
angle_max: 1.57079994678
angle_increment: 0.0522999987006
time_increment: 0.0
scan_time: 0.333299994469
range_min: 0.449999988079
range_max: 4.0
ranges: [inf, inf, inf, inf, inf, inf, inf, inf, inf, 0.45063257217407227, 0.45248475670814514, 0.4535152316093445, 0.454106867313385, 0.45574814081192017, 0.45014896988868713, 0.45500892400741577, 0.4504481256008148, 0.45145583152770996, 0.450962096452713, 0.45117509365081787, 0.45415404438972473, 0.4528849124908447, 0.4500834047794342, 0.45053648948669434, 0.4508683979511261, 0.4519908130168915, 0.45469483733177185, 0.4522281289100647, 0.45500484108924866, 0.45522522926330566, 0.45422250032424927, 0.4566135108470917, 0.4510946571826935, 0.45335447788238525, 0.45148807764053345, 0.4525870084762573, 0.45198413729667664, 0.45033854246139526, 0.4502975344657898, 0.45032933354377747, 0.4510512351989746, 0.4511733055114746, 0.45179998874664307, 0.4508054852485657, 0.45005494356155396, 0.45013701915740967, 0.4505907893180847, 0.45257997512817383, 0.4503863453865051, 0.45146650075912476, 0.45116832852363586, 0.45020565390586853, 0.4511633813381195, 0.4503015875816345, 0.4507128894329071, 0.4509909152984619, 0.4540099501609802, 0.4507279098033905, 0.45697665214538574, 0.45599526166915894, 0.45608508586883545]
intensities: []

Ranges are either INF or very close to range_min (0.45). Here is ... (more)

edit retag flag offensive close merge delete


Does your rviz screenshot include the original point cloud, or the filtered point cloud?

ahendrix gravatar image ahendrix  ( 2016-01-06 17:43:21 -0600 )edit

RVIZ screenshot is showing the filtered point cloud.

Naman gravatar image Naman  ( 2016-01-06 18:12:37 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-06 07:04:25 -0600

Akif gravatar image

updated 2016-01-07 01:04:32 -0600

It seems like your point cloud readings are rejected to due some reason and all your laser message remains as INF.

It may be helpful to follow rqt_console output of pointcloud_to_laserscan_node in DEBUG level to see the reasons for rejections. There may be an order of magnitude problem with your ranges and readings.


There may be a transformation problem with your frames. RGBD sensors should use _optical frames which has different axis orientation than the standard one. Please check REP-103 on this. If your "kinect2_link" frame is an optical frame, then you will get your laser scan on vertical plane since pointcloud_to_laserscan generates scans on x-y plane. This also explains the reason that when you change max_height your range is affected (z axis is forward on optical frames).

edit flag offensive delete link more


Thanks @Akif! Yes, Transformation was the problem!

Naman gravatar image Naman  ( 2016-01-08 11:20:43 -0600 )edit

You're welcome!

Akif gravatar image Akif  ( 2016-01-09 03:23:50 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-01-05 09:19:18 -0600

Seen: 1,645 times

Last updated: Jan 08 '16