ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Error formating LaserScan to PointCloud [closed]

asked 2018-10-28 16:46:51 -0600

hdbot gravatar image


I am trying to covert LaserScan to PointCloud using laser_assembler. I am following the tutorials on the and I have also looked at others trying to achieve similar results as me in the forum. I have looked at following setups:

However, when I run the launch file I get error:

[ERROR] [1540762433.045464456]: Client [/laser_scan_assembler] wants topic /pc2 to have datatype/md5sum [sensor_msgs/LaserScan/90c7ef2dc6895d81024acba2ac42f369], but our version has [sensor_msgs/PointCloud2/1158d486dd51d683ce2f1be655c3c181]. Dropping connect

I tried to fix this error following this suggestion: , but I was not able to understand why I am getting this error. Since I am not using anything different than the package associated with laser_assembler.

Does anyone know how I can fix it?

My launch file:

<include file="$(find sweep_ros)/launch/servo.launch"/>
<param name="robot_description" textfile="$(find scanse)/urdf/scanse.urdf" />
<include file="$(find sweep_ros)/launch/sweep.launch" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find sweep_ros)/rviz/sweep_pc2.rviz" />
<node pkg="laser_assembler" type="laser_scan_assembler" output="screen"  name="laser_scan_assembler">
    <remap from="scan" to="/pc2"/>
    <param name="tf_cache_time_secs" type="double" value="10.0" />
    <param name="max_scans" type="int" value="400" />
    <param name="ignore_laser_skew" type="bool" value="true" />
    <param name="fixed_frame" type="string" value="laser_frame" />
<node name="test_client" pkg="sweep_ros" type="" output="screen"/>


and rosservice file:

#!/usr/bin/env python

import rospy 
from laser_assembler.srv import AssembleScans2
from sensor_msgs.msg import PointCloud2

assemble_scans = rospy.ServiceProxy('assemble_scans2', AssembleScans2)
pub = rospy.Publisher ("/pointcloud", PointCloud2, queue_size=1)
r = rospy.Rate (1)

while (True):
        resp = assemble_scans(rospy.Time(0,0), rospy.get_rostime())
        print "Got cloud with %u points" % len(
        pub.publish (

    except rospy.ServiceException, e:
        print "Service call failed: %s"%e


Thanks, Hdbot

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by hdbot
close date 2019-03-26 11:23:38.657713

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-29 03:18:02 -0600

gvdhoorn gravatar image

updated 2018-10-29 03:19:18 -0600

[ERROR] [1540762433.045464456]: Client [/laser_scan_assembler] wants topic /pc2 to have datatype/md5sum [sensor_msgs/LaserScan/90c7ef2dc6895d81024acba2ac42f369], but our version has [sensor_msgs/PointCloud2/1158d486dd51d683ce2f1be655c3c181]. Dropping connect


<remap from="scan" to="/pc2"/>

you are feeding the laser_scan_assembler node sensor_msgs/PointCloud2s as input while it needs/expects sensor_msgs/LaserScans.

That won't work.

Input should be sensor_msgs/LaserScan, output is sensor_msgs/PointCloud2 (as part of the service response).

What node is publishing on the /pc2 topic?

edit flag offensive delete link more


The /pc2 is from my laser, I realized I should have used point_cloud2_assembler instead after reading your answer. My pointcloud gets assembled now. Thanks.

hdbot gravatar image hdbot  ( 2018-10-29 07:16:51 -0600 )edit

Question Tools

1 follower


Asked: 2018-10-28 16:46:51 -0600

Seen: 355 times

Last updated: Oct 29 '18