ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Pointcloud_to_laserscan for bag files?

asked 2016-06-01 15:29:00 -0600

Autumneverlast gravatar image

updated 2016-06-03 11:39:21 -0600

Hello all,

I am currently working to analyze pointcloud data from a Velodyne LIDAR and run SLAM on it, so I've been trying to run pointcloud_to_laserscan on it in order to convert it into a form that many SLAM packages will accept. The data I'm working with is inside a bag file.

However, I'm having a number of issues getting this to work. I can run a pointcloud_to_laserscan node, but the thing doesn't seem to be subscribing to anything and thus I can't get my pointcloud data to it. I'm new to ROS and thus have a lot of trouble understanding the Kinect-based launch file approach since I'm trying to pull from a bag file rather than trying to read from a camera. Does anyone have any advice on how to handle this situation? Know any free 3D SLAM packages for Velodyne? Am I just stupid and there's an obvious, easy way to go about this that I'm missing?

Edit: I've been working on getting Pointcloud_to_laserscan working, somewhat have launch files down. The issue I'm getting now is that this module seems to be subscribing to the /tf and /tf_static topics instead of the pointcloud one. My current launch file is below.


  <arg name="path" default="/media/sf_Research/Data-2016-03-16-LidarMBI-Bag/" />
  <arg name="file_1" default="12-L-shape-in-parkinglot.bag" />
  <arg name="file_2" default="16-back-to-building-along-walkway.bag" />

  <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
<remap from="cloud_in" to="velodyne_points"/>
            # target_frame: camera_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.087 # 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

  <node pkg="rosbag" type="play" name="player" output="screen" args="--clock $(arg path)$(arg file_2).bag"/>


Double Edit: The solution below works perfectly for what I need to do, thank you so much to kmhallen for sending it. Any future people who have the same problem, use the link below.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-02 20:28:34 -0600

kmhallen gravatar image

This might be useful. I don't know much about it.

edit flag offensive delete link more


The package as uploaded had many, many issues, but once those were fixed (through downloading dependencies and updating some files), it worked. It worked like a charm. Thank you so much, you're an absolute life saver.

Out of curiosity, how did you find this package?

Autumneverlast gravatar image Autumneverlast  ( 2016-06-03 11:37:26 -0600 )edit

A co-worker used it to extract a single scan from the large pointcloud.

Were you able to build a 3D map and localize with just a velodyne point cloud? If so, this is the only open source 3D SLAM implementation I am aware of. Can you post results?

kmhallen gravatar image kmhallen  ( 2016-06-03 22:03:55 -0600 )edit

That's wonderful, if it's not too much trouble I would appreciate it if you could thank them on my behalf.

And I wasn't able to build a 3D map and localize with just the pointcloud data, I'm currently working to add odometry data via output from the robot in order to add localization for SLAM.

Autumneverlast gravatar image Autumneverlast  ( 2016-06-06 13:08:50 -0600 )edit

Question Tools

1 follower


Asked: 2016-06-01 15:29:00 -0600

Seen: 903 times

Last updated: Jun 03 '16