This is basically a duplicate of this question. See my answer there for a possible solution to your problem.
Originally posted by Stefan Kohlbrecher with karma: 24361 on 2012-03-04
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by tom on 2012-03-04:
Thanks. I haven't found this answer before.
Comment by tom on 2012-03-05:
Thank you very much again. Works like a charm. BTW. I was unable to install hector_slam (hector_common, actually). hector_roscpp_introspections crashes saying: introspection.cpp:225: error: ‘struct boost::filesystem::path’ has no member named ‘native’. Any solutions? Diamondback, Ubuntu 10.04.
Comment by Stefan Kohlbrecher on 2012-03-05:
Oh ok, thanks for the heads up, I'll investigate this.
Comment by tom on 2012-03-05:
Also, I had to increase time ROS waits for /map -> base_link in hector_trajectory_server, trajectoryUpdateTimerCallback to ros::Duration dur (1.5); Otherwise poses container in /trajectory message was mostly empty in my system. In case people are using slower machines, this might be necessary.
Comment by tom on 2012-03-05:
I would also uncomment ROS_ERROR in the aforementioned method to leave a hint for users struggling with the same issue. But again, thanks for the software - hope constructive comments are always appreciated :).