Ask Your Question
0

Error formating LaserScan to PointCloud [closed]

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

hdbot gravatar image

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/1727... http://www.theconstructsim.com/merge-... https://www.youtube.com/watch?v=MyA0a... http://wiki.ros.org/laser_assembler/T...

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/1161... , 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

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
0

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

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?

edit flag offensive delete link more

Comments

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 imagehdbot ( 2018-10-29 07:16:51 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 62 times

Last updated: Oct 29 '18