Use ira_laser_tools to fuse the rplidar A2 and Kinect laser scan,but the output of the merger is only kinect's data.
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 :
<launch>
<!-- 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"/>
</launch>
and then roslaunh ira_laser_merge.lauch
is following:
<launch>
<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" />
</node>
</launch>
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 https://docs.ros.org/api/pcl_conversi... )
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?
Im having the exact same issue. Did you ever find a solution?