Would it be correct if we used in the field scan_time of the LaserScan message a time difference like this?
sensor_msgs::LaserScan scan;
scan.scan_time= (current_time-last_time).toSec();
Being current_time and last_time two ros::Time objects, so the function toSec() returns the number of seconds between two callbacks (since I have this scan_time in a callback).
Thanks in advance
EDIT: If anyone is wondering why would I do this, it is because I'm defining IR sensors as a LaserScan for using them in the navigation stack. In the robot, the measures update every 33 ms, but the messages to ROS with this measures can come more or less randomly. I take this messages and shape them into a LaserScan.
Originally posted by nanaky on ROS Answers with karma: 23 on 2014-02-26
Post score: 1