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

"scan.time_increment" in laser scan message publishing

asked 2011-12-21 07:08:23 -0600

alfa_80 gravatar image

updated 2011-12-21 07:09:35 -0600

I was referring to one tutorial regarding laser scan message publishing related stuff. I found it could possibly be an error in section 4.2 Writing Code to Publish a LaserScan Message in the line 32

scan.time_increment = (1 / laser_frequency) / (num_readings);

In my opinion I should be this way:

scan.time_increment = (1 / laser_frequency);

Can someone think of it and confirm it. It is just my doubt that the written heuristic there is not really what scan.time_increment variable should mean.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-21 07:37:57 -0600

Eric Perko gravatar image

The tutorial is correct. From the message definition:

float32 time_increment   # time between measurements [seconds]

That means that it is the time between each reading, not the time between each complete scan (that's the scan_time field of LaserScan). Because it's the time between each reading in the scan, it gets divided by the total number of measurements per scan. Note that this does assume that the scanner has 0 time between completing one scan and starting another, so obviously it may be different for different actual sensors instead of this example for publishing.

edit flag offensive delete link more

Question Tools


Asked: 2011-12-21 07:08:23 -0600

Seen: 597 times

Last updated: Dec 21 '11