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

How can I set up laser_scan_matcher based on my own lidar measurement?

asked 2017-12-04 11:03:30 -0500

Ezredes gravatar image

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

edit retag flag offensive close merge delete


Can you post a screenshot of your tf tree?

jayess gravatar image jayess  ( 2017-12-04 20:19:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-12-06 06:19:08 -0500

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.

edit flag offensive delete link more

Question Tools



Asked: 2017-12-04 11:03:30 -0500

Seen: 455 times

Last updated: Dec 06 '17