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

Use ira_laser_tools to fuse the rplidar A2 and Kinect laser scan,but the output of the merger is only kinect's data.

asked 2018-07-01 22:07:46 -0500

skydddive gravatar image

updated 2018-07-04 04:04:42 -0500

I have a rpidar A2 and a Kinect camera,i use the ira_laser_tools to fuse the laser scan from the rplidar and kinect ,then use the merge data to bulid a 2d grid map by gmapping.But when i used the rviz to look the topic /scan_multi,which is the output of laserscan_multi_merger,has only a laser scan data.

i use roslaunch kinect_rpldiar_gmapping_demo.launch to rosrun rplidar node and kinect node :

      <!-- 3D sensor -->
      <arg name="3d_sensor" default="kinect"/>
      <include file="$(find turtlebot_bringup)/launch/3dsensor.launch"/>
      <!-- laser driver -->
      <arg name="laser_type" default="rplidar" />
      <include file="$(find rplidar_ros)/launch/$(arg laser_type).launch" />
      <!-- Gmapping -->
      <arg name="custom_gmapping_launch_file" default="$(find turtlebot_navigation)/launch/includes/gmapping/rplidar_kinect_gmapping.launch.xml"/>
      <include file="$(arg custom_gmapping_launch_file)"/>
      <!-- Move base -->
      <include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/>
      <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot_rviz_launchers)/rviz/navigation.rviz"/>


and then roslaunh ira_laser_merge.lauch is following:


    <node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger" output="screen">
    <param name="destination_frame" value="/base_link"/>
    <param name="cloud_destination_topic" value="/merged_cloud"/>
    <param name="scan_destination_topic" value="/scan_multi"/>
    <param name="laserscan_topics" value ="/scan_kinect /scan_laser" /> 


the nodelaserscan_multi_merger,it said,

Error:"[pcl::concatenatePointCloud] Number of fields in cloud1 (4) !=Number of fields in cloud2(5)".

cloud1 is kinect's fake laser scan;cloud2 is rplidar's laser scan.

Then i see the part-code about the pcl::concatenatePointcloud ,which is the error comes from.(The all code is )

 if (!strip && cloud1.fields.size () != cloud2.fields.size ())
   PCL_ERROR ("[pcl::concatenatePointCloud] Number of fields in cloud1 (%u) != Number of fields in cloud2 (%u)\n", cloud1.fields.size (), cloud2.fields.size ());
   return (false);

So,what's the cloud.field? meaning the kind of pointcloud?
i want to know about it .because when i look the /scan_multi laserscan by using rviz,there is only one data from /scan_kinect.i guess ,is the question related to the abouve error?

edit retag flag offensive close merge delete


Im having the exact same issue. Did you ever find a solution?

logan.ydid gravatar image logan.ydid  ( 2019-09-30 22:31:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-02 17:19:19 -0500

I think you're asking how to use a kinect to get a laser scan along with an rplidar?

Essentially, you need to make a node which takes in the 2 as inputs and outputs a composite laser scan which is used by gmapping. You can use the depth image to laser scan nodelet to make the laser scan for the kinect, or at least get the points for it.

From there I would probably convert the kinect points to the laser frame ID and raytrace from the frame to find the range. You can use some geometry to get the angle. Then fill out the message with nans for positions between valid kinect readings and the rplidar you're filtering out of bounds.

edit flag offensive delete link more


Thank you for your replying~ Yesterday,i use the ira_laser_tools to merge the fake laser data from kinect and rplidar A2' laser data.But there is a new problem.When i roslaunch the ira_laser_tools package: "[pcl::concatenatePointCloud] Number of fields in cloud1 (4) !=Number of fields in cloud2(5)

skydddive gravatar image skydddive  ( 2018-07-03 04:02:00 -0500 )edit

Sounds like you need to look into the PCL documentation to understand better how to concat pointclouds. I can't do much without code to look at.

stevemacenski gravatar image stevemacenski  ( 2018-07-03 12:49:38 -0500 )edit

there has lines(612-718) in abou concatenatePointclould.By seeing this code,i think the error has no effect on the result about merge data ..but,the multi data has only the kinect data.

skydddive gravatar image skydddive  ( 2018-07-03 20:06:27 -0500 )edit

Question Tools



Asked: 2018-07-01 22:07:46 -0500

Seen: 830 times

Last updated: Jul 04 '18