A mobile robot can paint two copies of the same wall on a map even if its range sensor is accurate. The problem can be time, not distance: projecting an old reading with the robot’s newest pose puts the return in the wrong place. This lesson uses an offline warehouse cart example to show how to look up the right transform and measure the effect of choosing the wrong one.
What you will learn
By the end, you should be able to distinguish measurement time, receipt time and transform time; identify the roles of lidar, base, odometry and map frames; compute the translation error from a timing mismatch; and choose what to do when a transform is missing. Before starting, review robot coordinate frames and be comfortable converting milliseconds to seconds.
Use the pose from when the ray was measured
An acquisition timestamp identifies when a reading was taken. Receipt time records when another component received it, which can be later because of buffering or transport. A transform relates coordinates between two frames at a specified time. The ROS 2 LaserScan message definition defines the header stamp as the time of the first ray. The time increment gives the interval between rays. Treating the entire scan as instantaneous can be an approximation, especially when the base turns during a scan.
The scanner has a frame fixed relative to the cart’s body, base_link. The body pose in odom changes as the cart moves. ROS REP 105 describes odom as continuous but subject to drift, while map is a global reference that can jump when localization corrects its pose. Work in odom for this short local calculation. The ROS 2 tf2 Buffer implementation documents that requesting time zero returns the latest available transform, not necessarily the transform for a saved scan. This matters downstream in occupancy-grid mapping.
A straight-line worked example
Assume the scanner is aligned with the cart’s forward axis. At the first ray’s acquisition time, the scanner origin is at x = 1.20 m in odom and the ray measures a wall 2.00 m ahead, so the return projects to x = 3.20 m. At 0.60 m/s the cart moves 0.072 m in 120 ms. Using that later pose to project the same ray places the return at x = 3.272 m, or 7.2 cm too far forward. This is a toy model with constant speed, no turning and a stationary wall. It is not a general error bound for scans collected while turning.
The size of this particular error is speed times the difference between the pose and acquisition timestamps. Here is the same calculation at four offsets:

The following Python 3 exercise checks the numbers without ROS, connected hardware or a motor command:
from decimal import Decimal as D
speed_m_per_s = D("0.60")
for lag_ms in (0, 50, 120, 200):
offset_cm = speed_m_per_s * D(lag_ms) / 1000 * 100
print(f"{lag_ms:3} ms -> {offset_cm:4.1f} cm")
The expected offsets are 0.0, 3.0, 7.2 and 12.0 cm, in order. Repeating the calculation at different speeds helps distinguish a time mismatch from a fixed offset in the sensor mount. A turning platform can show both translation and rotation error, so check more than a single straight run before drawing conclusions.
What to do with a missing transform
Log the message timestamp, source frame, requested target frame and lookup result. If transform data for that timestamp are still arriving, a bounded wait may be appropriate in offline replay. If the transform cannot be resolved within the configured window, report the gap rather than silently substituting the newest pose. Compare clock sources before blaming latency: mismatched clocks can produce a constant offset or a growing difference. This complements robot state estimation and is a separate check from path tracking.
Use saved data or synthetic inputs for this exercise. It does not validate a sensor used for safeguarding or authorize changes to a live robot. Follow the facility’s approved procedures; OSHA’s robotics technical manual treats verification and validation as part of the application’s risk assessment.
Practice
- At 0.80 m/s and a 50 ms pose offset, what is the straight-line error?
- If a scan takes 40 ms between its first and last ray, how far does a cart at 0.60 m/s move during that time?
- Why can a map correction resemble a bad timestamp? What would you check first?
- A scan is older than the transform buffer’s retained data. Why not fall back to the latest transform?
Answers
- 4.0 cm: 0.80 m/s multiplied by 0.050 s is 0.040 m.
- 2.4 cm: 0.60 m/s multiplied by 0.040 s. The first and last rays did not come from the same point along the path.
- A global correction can jump even when odom is continuous. Inspect the acquisition and transform times, then compare the same return in odom before blaming the sensor.
- The latest pose can misplace the old ray. Record the missing time and use the replay’s documented drop or reprocessing rule instead.
Editor’s Note: We volunteer daily to ensure the credibility of the information on this platform is Verifiably True. If you would like to support to help further secure the integrity of our research initiatives, please scan the QR code below

For mobile scanning, open the article on another display and scan the QR code with a Bitcoin wallet. The voluntary donation amount is 5,000 sats. Verify the receiving address 3C9o19EH5HSiwEPyCTmEKzxhNCbo2X6TTb before sending.
BitcoinVersus.Tech publishes technology and financial journalism for informational purposes and does not provide financial, investment, or legal advice.

Leave a Reply