Robotics StackExchange | Archived questions

pointcloud_to_laserscan give me inf ranges

Hi! I am trying to convert pointcloud2 messages to laserscan messages using the package pointcloud_to_laserscan. The pointcloud2 message was published by a node called laser_ortho_projector, a package that can take in scan data and imu data and publish the projected pointcloud2 in the base_ortho frame. Going back to pointcloud_to_laserscan, when I run

rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node cloud_in:=/cloud_ortho

and

run rostopic echo /newscan

I am getting:

header: 
  seq: 4
  stamp: 
    secs: 1541308093
    nsecs: 944408000
  frame_id: "base_ortho"
angle_min: -3.14159274101
angle_max: 3.14159274101
angle_increment: 0.0174532923847
time_increment: 0.0
scan_time: 0.0333333350718
range_min: 0.0
range_max: inf
ranges: [inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, 

inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf, inf]
intensities: []

My OS is Ubuntu 16.04 and my ROS version is Kinetic. I have been stuck for so long. Any help will be appreciated. Thank you.

Asked by Kolohe113 on 2018-11-04 00:13:19 UTC

Comments

My first guess would be that the input point cloud is not intersecting with the plane of the laser scanner you're trying to simulate. Have you visualised everything in RVIZ to make sure the location of the point cloud and the laser scanner are correct?

Asked by PeteBlackerThe3rd on 2018-11-04 05:40:44 UTC

The default range_max value for the pointcloud_to_laserscan is 4 metres, so if your point cloud is further away than this then the laser scan will contain all max values, so you might want to increase this parameter too.

Asked by PeteBlackerThe3rd on 2018-11-04 06:08:40 UTC

From range_max: inf, it seems like the range is inf.

Asked by Kolohe113 on 2018-11-04 20:56:27 UTC

@Kolohe113 Have you fixed this issue? could you please share solution.

Asked by Ajay on 2020-06-16 23:58:30 UTC

Answers

At first, one who has this issue needs to change the log level of pointcloud_to_laserscan node to DEBUG. For example with rqt_logger_level tool.

After this, logs show the reason of rejected (inf) points.

In my case, min_height parameter was 0.0, so all points below this value were rejected. So setting the parameter to a negative value solved it.

Asked by _andrei_ on 2022-04-17 22:54:19 UTC

Comments