Rosanswers logo

Hello, I trying to use the laser_scan_matcher tool. I found some demo launch file, which basically a .bag playback. I would like to use it with my laser node. My currently launch is:

  <arg name="IS_TWISTSTAMPED" default="true" />
  <arg name="use_rviz" default="true" />
  <arg name="publish_covariance" default="false"/>

  <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser"
    args="0.0 0.0 0.0 0.0 0.0 0.0 /base_link /laser 40" />

  <node pkg="lidar" type="laser_scan_publisher" name="laser_scan_publisher" args=""/>

  <group if="$(arg publish_covariance)">
    <param name="laser_scan_matcher_node/do_compute_covariance" value="1"/>
    <param name="laser_scan_matcher_node/publish_pose_with_covariance" value="true"/>
    <param name="laser_scan_matcher_node/publish_pose_with_covariance_stamped" value="true"/>
  <node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
    name="laser_scan_matcher_node" output="screen">

    <param name="max_iterations" value="10"/>


The lidar code, what I'm using which publish LaserScan messages looks like here (its an emulated in first round)

The warning what i got every time, when the LaserScan message published:

[ WARN] [1512405875.489890429]: Could not get initial transform from base to laser frame, Could not find a connection between 'base_link' and 'laser_frame' because they are not part of the same tree.Tf has two or more unconnected trees.

My question is to where to start debug the warning message? HWhat will be te problem? My objective is to reach this result: link

Originally posted by Ezredes on ROS Answers with karma: 1 on 2017-12-04

Post score: 0

Original comments

Comment by jayess on 2017-12-04:
Can you post a screenshot of your tf tree?


1 Answer 1


Rosanswers logo

The code you are using here to generate your laser scan is publishing LIDAR data in the 'laser_frame' coordinate frame, but the laser_scan_matcher node is expecting data in (or with a TF to transform it into) the 'base_link' coordinate system. Because the matcher node can't transform points from the 'laser_frame' into the 'base_link' frame it is failing.

If you find out what coordinate frame the laser messages in the bag file are in (you can visualise them in RVIZ to find this out) then modify line 21 in your code to this:

scan.header.frame_id = '<The laser frame you find in the bag file>'

Then it should start working.

Originally posted by PeteBlackerThe3rd with karma: 9529 on 2017-12-06

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.