Ask Your Question
1

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

skydddive gravatar image

updated 2018-07-04 04:04:42 -0600

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?

edit retag flag offensive close merge delete

Comments

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

logan.ydid gravatar imagelogan.ydid ( 2019-09-30 22:31:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Comments

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 imageskydddive ( 2018-07-03 04:02:00 -0600 )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 imagestevemacenski ( 2018-07-03 12:49:38 -0600 )edit

there has lines(612-718) in https://docs.ros.org/api/pcl_conversi... 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 imageskydddive ( 2018-07-03 20:06:27 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 206 times

Last updated: Jul 04 '18