NKU-MobFly-Robotics / laser_scan_matcher

An incremental laser scan matcher, using PLICP (point-to-line iterative closest point) scan matching algorithm.
125 stars 37 forks source link

How to integrate Laserscanner? #1

Closed ywiyogo closed 3 years ago

ywiyogo commented 3 years ago

Hi @nkuwenjian ,

I found your repository, and thank you for your work simplifying the laser scan matching libs in one repository. I tested with my bagfile, and it works very good. However, if I cannot work directly with the laserscanner (RPlidar).

Using this modification in the launch file, I only see one update of the occupancy grid map. The scan matcher seems not working.

<param name="/use_sim_time" value="false"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser"
    args="0.15 0.0 0.0 0.0 0.0 0.0 /base_link /laser 40" />
<node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
    name="laser_scan_matcher_node" output="screen">
    <param name="map_frame" value="map"/>
    <param name="base_frame" value="base_link" />
    <param name="max_iterations" value="10"/>
    <param name="do_compute_covariance" value="1"/>
  </node>

Could you give me a hint how to see the real time scan matching by integrating the /scan topic directly?

From the visualization of the nodes, topics and the TF tree, these are the differences:

Offline with bagfile:

scanmatcherFromBag tfBagfile

Online with the laserscan: scanmatcherFromRpLidar

tfRplidar

nkuwenjian commented 3 years ago

Hi @ywiyogo , I know what the problem is.

The input of the laser scan matcher includes laser scan and odometry data. Currently, you just use the laser scanner to provide laser scan data. You may need to install the laser scanner on a mobile robot and read the odometry data from the mobile base. The odometry data is used to provide a good initial guess for current pose estimation.

Generally speaking, the TF tree should be map->odom->base_link->laser, wherein the transformation of odom->base_link is provided by a mobile platform. This repo obtains the odometry data by listening to this transformation and uses message filters to synchronize the timestamp of laser scan and odometry data.

Best,

Jian Wen

ywiyogo commented 3 years ago

多谢 @nkuwenjian for the hint! Since I work with RaspberryPi, I don't have any odometry data. As a workaround, I added the base_link as the odometry frame in the launch file: <param name="odom_frame" value="base_link" />.

I works very well. Can I later push this new launch file to your repo for instance as rplidar.launch? Cheers, Yongkie

nkuwenjian commented 3 years ago

@ywiyogo ok ^_^