FLO Mobility

Why Do Good Sensors Fail at Localization?

Gautham Ramkumar
•
Why Do Good Sensors Fail at  Localization?

A guide to pipeline timestamp synchronization, and how small timing choices between stages add error that no single component reports.

A localization system can be built from good sensors and still localize badly.

We saw this on our own robots. The RTK receiver reported a fixed solution, the lidar registered cleanly against the map, and the IMU was well mounted. At standstill, the fused pose agreed with RTK to within a few centimetres. While driving, the error grew to 10 to 20 cm, and it was largest in turns. No component reported a fault.

Our robots move material on operating industrial sites, on roads shared with people and machines, so we needed to account for that error. Part of it came from the expected places: calibration, the map and the site. A larger part than we expected came from how the pipeline assigned a time to each measurement.

How Does a Sensor Fusion Pipeline Work?

A common structure for a localization stack is one driver and one preprocessing stage per sensor, all feeding a shared estimator. GNSS is filtered and converted to a local frame. Lidar is downsampled and registered against a map. IMU data is transformed into the robot frame. Each stage is usually validated on its output: the value, the coordinate frame and the rate.

The estimator then places each measurement at the time in its header. It has no other information about when the measurement was taken.

That timestamp can be set at every stage, and each stage may set it differently. A driver may stamp on the arrival of the bytes, a filter may publish its latest estimate, and a relay may stamp on send. Each choice is locally reasonable and passes a unit test. Timestamp compensation between stages is easy to overlook, because an error in it causes no failure. It degrades the pose slightly, and the errors from several stages accumulate.

Diagram illustrating GNSS and LiDAR sensor data processing stages and timestamp synchronization in a robot localization pipeline.Figure 1. The two paths this post follows. Green is the moment the robot was actually at the measured position. Orange is the time the fusion is told.

The size of the effect follows from a first-order model. A measurement that is d seconds older than its stamp, taken at speed v, is displaced by about v·d along the direction of travel. At 1.2 m/s, roughly walking pace, 100 ms of latency is 12 cm. The sections below take the sensors in turn, using mainly one 39-minute drive recorded on one of our sites.

Why Can GNSS Positions Have Timestamp Errors?

GNSS is a useful starting point because it carries its own time reference. Each sentence from the receiver includes the epoch of the fix in UTC, independent of when the host receives it.

In our stack, the fix passed through three stages before it reached the estimator. The serial driver parsed the sentence, a filter fused it with odometry, and a republishing node sent the filter's latest output on a timer, stamped with the send time. The position that reached the estimator was therefore labelled with the current time, but it described an earlier state.

The receiver epochs let us measure that latency directly. We assume the republished position is d seconds older than its stamp, compare it with the RTK fix at the corresponding epoch, and sweep d.
Graph showing GNSS positioning error against RTK measurements at different assumed timestamp delays, with improved accuracy at 160 milliseconds.Figure 2. Taken at face value, the republished position is 20.0 cm RMS from the RTK reference, and 28.8 cm at the 95th percentile. Treat it as 160 ms old and that falls to 4.7 and 8.2 cm. The sensor did not change, only the clock we read it against.

Figure 3 shows the residuals at one corner. At every fix, the stamped position lies behind the RTK fix along the direction of travel. The error is systematic rather than random, so averaging over time in the filter does not remove it.

Robot trajectory comparison showing RTK ground truth, uncorrected GNSS positions and positions corrected for a 160 ms delay.Figure 3. The grey lines join each RTK fix to the position that carried the same stamp. Shifted by 160 ms, the green rings land on the fixes.

The correction was to make the republishing node carry the timestamp of the underlying data instead of the send time. Where accuracy matters most, such as georeferencing a map, we pair measurements on the receiver epoch and bypass the chain.

How Can You Distinguish GNSS Latency from Antenna Offset Errors?

Latency has a second effect that is easy to misread.

At constant forward speed, a 160 ms latency and an antenna mounted 19 cm further forward than the robot description states produce the same error: a constant along-track offset. Calibrating either one removes the residual on that drive. If the wrong one is chosen, the error returns when the speed changes.

The two terms can be separated because they scale differently. A lever-arm error is independent of speed, while a latency error is proportional to it. Regressing the along-track error on speed gives the lever arm as the intercept and the latency as the slope, provided the drive covers a range of speeds.

Scatter plot showing the relationship between robot speed and GNSS positioning error, identifying timestamp latency and antenna offset.Figure 4. The intercept, 21 cm, is where the antenna is actually mounted. The slope, 0.17 s, is the delay, and it agrees with the sweep in Figure 2. This only works because the drive covers a wide range of speeds.

On a second robot, both errors were present: a GNSS latency of about 250 ms, and an antenna position in the robot description that disagreed with the RTK estimate. Either one alone fitted the error on a constant-speed drive. A single correction would have fitted that drive and failed on the next, so we estimated and corrected the two separately.

Why Does LiDAR Timestamp Synchronization Matter During a Scan?

The lidar has a related problem. It does not capture a scan at a single instant. Our sensor sweeps for 100 ms per scan, and each point carries its own timestamp, but the message carries one stamp: the time of the first point.

LiDAR point cloud showing measurements captured at different timestamps during a 100-millisecond scan.Figure 5. The message stamp is the first point. The last point is 100 ms later, and the robot moved about 9 cm in between.

The scan matcher registers the full cloud against the map and returns one pose. That pose corresponds to some instant within the sweep, not to the first point. In our pipeline it was closest to the middle of the sweep, but it was published with the first point's stamp, about 50 ms early, on every scan.

We offset the stamp by half a sweep and replayed the logs against RTK. The RMS error of the fused pose while moving fell from 7.5 to 4.2 cm, from a single configuration change. It was the largest single improvement in that round of work.

Deskewing the cloud with IMU data does not remove the need for this choice. The deskewed cloud still represents one instant, and the stamp has to be that instant.

How Do Incorrect IMU Timestamps Affect Localization Accuracy?

The IMU problem was in the spacing of the stamps rather than their offset. One of our IMUs runs at 100 Hz, so its messages should be 10 ms apart. The mean interval is 10 ms, but each message is stamped when the host reads it from the serial buffer, and the host reads in bursts.
Comparison of timestamp intervals between a 200 Hz LiDAR IMU and a 100 Hz serial IMU, highlighting irregular measurement gaps.Figure 6. Left: the lidar's built-in IMU at 200 Hz, with gaps clustered near 5 ms. Right: a serial IMU at 100 Hz, stamped on arrival, with three quarters of its gaps under a millisecond. Integrated at face value, these stamps make the rotation appear discontinuous.

How Does System Clock Synchronization Affect Robot Localization?

Every stamp discussed so far is read from the host's system clock. Correct timestamps therefore start with a correct system time, and this is easy to take for granted.

Many embedded computers have no battery-backed real-time clock, so they boot with whatever time they last saved. Robots on industrial sites often start with weak or no network connectivity, so time synchronization may take a while to reach a good source. Until it does, the clock can be wrong by a noticeable margin, and the correction can arrive as a step in the middle of operation.

We observed this after one cold boot. The robot's clock ran a few hundred milliseconds ahead until time synchronization corrected it with a step, during a run. In the logs, the step coincides with timestamps moving backwards and a gap of several seconds in scan matching. A step of this kind affects every sensor at once, and no amount of per-sensor compensation can correct it.

The stack now waits for time synchronization to settle before it starts. Before tuning any of the offsets above, it is worth confirming that the system time itself is right.

How Do Small Timing Errors Accumulate Across Sensors?

Each of these errors is small on its own. At walking pace, a 50 ms lidar offset is 6 cm and a 160 ms GNSS latency is about 19 cm. Burst-stamped IMU data adds jitter to the heading. A clock step after boot shifts every stamp at once. Individually, each falls within the range that is often attributed to sensor noise.

Their combined effect is larger, because a fusion filter assumes that measurements with the same stamp describe the same state. With these offsets, it combines measurements of different states, and the sensors appear to disagree with each other. A common response to persistent disagreement is to increase the measurement covariances. That lowers the weight of every measurement, including the correct ones, and the pose becomes less accurate everywhere. The error is then attributed to the sensors, while its source is the pipeline.

What Does GNSS Timestamp Delay Look Like During Robot Motion?

Figure 7 replays 22 seconds of live GPS data from the same drive, exactly as the robot received it, through a U-turn where RTK holds a fix every second. The top panel shows where the robot is on the site map, reconstructed from its lidar scans, with the path through the turn in white. The two panels below follow the robot, heading up. On the left, the live GPS position without correction trails the RTK ground truth along the direction of travel, by about 20 cm. On the right, the same data corrected for 160 ms stays within a few centimetres of it.

Figure 7. Live GPS data, replayed as recorded, through a turn with continuous RTK ground truth.

How Much Can Timestamp Corrections Improve Localization Accuracy?

Each row is a drive replayed offline with one timing change enabled and disabled. No row involves a new sensor.

Table showing improvements in robot localization accuracy after correcting GNSS latency, LiDAR timestamps and sensor synchronization, with RMS error reduced from 20 cm to 4.7 cm.How Can Robotics Engineers Prevent Timestamp Synchronization Errors?

None of these corrections required new hardware or a new algorithm. The errors were in code that worked, passed review and published correct values with incorrect times. We now follow a few practices:

  • Before the stack starts, we confirm that the system time is synchronized and stable.

  • For every input to the estimator, we document which stage sets the stamp and which physical instant it represents.

  • Before a new sensor is connected to the estimator, we plot the distribution of intervals between its stamps. It takes a minute and has found problems more than once.

  • We measure latency rather than assume it. The same GNSS chain had a latency of 150 ms on one robot, 250 ms on a second and 300 ms on a third, so we now estimate it online and store it with each map.

  • When an error scales with speed, we check timing before adjusting covariances.

At standstill, a latency produces no position error at all, which is why the pose in the opening looked correct until the robot moved. These errors become visible over long runs with changing speed, turns and sensor outages, and that is where we now look for them first.

How Were the Localization Errors Measured?

  • The GNSS figures use one 39-minute drive: 1,398 RTK-fixed epochs while moving forward. The reference is each RTK fix at the epoch the receiver reports in UTC. Reference and filtered stream come from the same receiver, so Figures 2 to 4 measure the pipeline's delay relative to that epoch, not absolute accuracy. Arrival times also include any offset of the host clock.

  • Figure 2 minimizes the 2D error with the antenna offset fixed to the robot description. Figure 4 fits along-track error against speed with the offset left free. 95% intervals from resampling 30 s blocks are 0.15 to 0.19 s for the delay and 18.8 to 23.0 cm for the offset. The two estimates are correlated. The scatter shows every second epoch.

  • The lidar offset and the rows of the table are offline replays of recorded robot logs. Each one was run with and without the one timing change and compared against RTK, or against the lidar trajectory where the table says so. Revisit numbers are within one drive.

  • The half-sweep offset is what worked in our pipeline. Where a scan matcher's pose sits in time depends on the matcher, the scene and the motion.

  • The site map is rotated and re-centred, and coordinates and times are relative.


If you work on problems like these, we would like to hear from you.