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

laser_scan_matcher failed

asked 2012-10-03 21:53:46 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello,

I am using gmapping and it is working fine with fake odometry. But now I wanted to use laser_scan_matcher to get better odometry data. I have a .bag file with the scan data and tf between laser and baseLink and the fake odometry. Gmapping is working fine, but laser_scan_matcher throws some error:

[ WARN] [1349336438.204428307]: Could not get initial transform from base to laser frame, Lookup would require extrapolation into the future.  Requested time 1349336437.203845202 but the latest data is at time 1349256596.739311565, when looking up transform from frame [/laser] to frame [/base_link]
[ WARN] [1349336438.204658155]: Skipping scan
[ WARN] [1349336439.213438249]: Could not get initial transform from base to laser frame, Lookup would require extrapolation into the future.  Requested time 1349336438.204962942 but the latest data is at time 1349256596.739311565, when looking up transform from frame [/laser] to frame [/base_link]
[ WARN] [1349336439.213652382]: Skipping scan

Why is this? I mentioned, that the latest data time is not changing.

Thanks

edit retag flag offensive close merge delete

Comments

How are you playing the bag? Are you setting rosparam use_sim_time to true? (you should be).

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2012-10-04 11:57:52 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
2

answered 2012-10-04 12:00:11 -0500

updated 2012-10-04 12:00:25 -0500

The laser_scan_matcher waits for 1 second for the tf. If it doesn''t get it, it gives up on the current scan, and tries again when the next scan arrives. This looks like a problem with the timestamps in the bag, or maybe improper use of "use_sim_time"

edit flag offensive delete link more
0

answered 2012-10-03 23:11:10 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

The code of the tf publisher is:

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char** argv){
  ros::init(argc, argv, "robot_tf_publisher");
  ros::NodeHandle n;

  ros::Rate r(100);lase
  tf::TransformBroadcaster broadcaster;

  while(n.ok()){
    broadcaster.sendTransform(
      tf::StampedTransform(
        tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.1, 0.0, 0.2)),
        ros::Time::now(),"laser", "base_link"));
    r.sleep();
  }
}

It is out of an example

At the moment everything is running on the same system. Should i change the laser _scan_matcher.cpp?

edit flag offensive delete link more

Comments

2

Please do not create answers just for discussion. Either editi your original post or use the comment functionality. Why are you not using URDF or a static_transform_publisher? You need to future-date your transforms. Have a look at the tf faq.

Lorenz gravatar image Lorenz  ( 2012-10-03 23:29:04 -0500 )edit

i used static_transform_publisher now for base_link -> laser and odom -> base_link. Laser_scan_matcher produces good odom i think (it looks fine in rviz) but now the gmapping told me "transform from base_link to odom failed". I thougt it was map->odom->base_link->laser or not?

darkchris90 gravatar image darkchris90  ( 2012-10-10 01:33:35 -0500 )edit
0

answered 2012-10-03 22:35:00 -0500

Lorenz gravatar image

To me this looks like a bug in laser_scan_matcher. It doesn't seem to wait for transforms to become available. You might be able work around this by publishing your tf tree faster. What's your current publish rate? Is the laser connected to a different computer? If yes, it needs to be time-synchronized to the computer running laser_scan_matcher.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-03 21:53:46 -0500

Seen: 1,494 times

Last updated: Oct 07 '12