0
$\begingroup$

Rosanswers logo

Hello,

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

https://answers.ros.org/question/172756/laserscan-to-pointcloud/?answer=269368#post-id-269368 http://www.theconstructsim.com/merge-laser-scans-single-pointcloud/ https://www.youtube.com/watch?v=MyA0as18Wkk&feature=youtu.be http://wiki.ros.org/laser_assembler/Tutorials/HowToAssembleLaserScans

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: https://answers.ros.org/question/11618/error-client-wants-topic-a-to-have-b-but-our-version-has-c-dropping-connection/, 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:

<launch>
<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>
<node name="test_client" pkg="sweep_ros" type="pcl_assembler_client.py" output="screen"/>

</launch>

and rosservice file:

#!/usr/bin/env python

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

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

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

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

    r.sleep()

Thanks, Hdbot


Originally posted by hdbot on ROS Answers with karma: 36 on 2018-10-28

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

[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

and:

<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?


Originally posted by gvdhoorn with karma: 86574 on 2018-10-29

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by hdbot on 2018-10-29:
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.

$\endgroup$

Your Answer

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