Table of Contents

Diagnosis and repair: Content jitter and drift in applications

"Virtual content is drifting," "Objects are shaking," "Position is unstable"—these are common issues developers often encounter in AR applications. Unstable content can severely disrupt immersion and even lead to a poor user experience.

This article will help you understand the causes of content jitter and drift and provide a systematic approach for troubleshooting and optimization.

Distinguish between "normal jitter" and "abnormal drift"

First, we need to establish reasonable expectations. Achieving high-precision AR tracking on mobile devices is inherently challenging. The following scenarios fall within the normal range and cannot be completely eliminated but can be optimized:

  • Minor high-frequency jitter:

    • Manifestation: Virtual objects exhibit millimeter-level, subtle shaking.
    • Cause: This is caused by the physical noise of device sensors, the precision limits of visual tracking algorithms, and slight hand tremors while holding the device.
    • Example: When observing up close (e.g., placing a virtual object on a table and leaning in to examine it), this minor jitter is normal.
  • Brief drift:

    • Manifestation: When the user moves or rotates the device quickly, the virtual object deviates from its position briefly (0.5–1 second) before recovering.
    • Cause: During rapid motion, the device’s SLAM system experiences accumulated errors from the IMU (inertial measurement unit) and delays in visual positioning, leading to temporary positional drift.
    • Example: In dynamic scenarios, this is acceptable. If the object quickly "snaps back" to the correct position, the system is functioning effectively.

The following scenarios, however, are abnormal issues that require investigation and fixes:

  • Persistent, significant positional drift: The virtual object slowly and continuously deviates from its intended position without recovering or taking too long to recover.
  • Severe jumping or flickering: The virtual object jumps dramatically on the screen or appears and disappears intermittently.
  • Inconsistent relative position to real objects: The virtual object cannot stably "anchor" to real objects.
Note

Additionally, a key point to note:
For devices operating in 0DoF, 3DoF, or 5DoF modes, their "adhesion" and "realism" are inherently weaker than 6DoF devices. When users move quickly, turn, or go up/down stairs, virtual objects cannot follow perfectly.
Therefore, phenomena like objects "floating in mid-air" or "positional offsets" in these modes are fundamental limitations of the device’s capabilities, not the "content jumping or drifting" faults discussed here.
For differences in experiences across various xDoF modes, refer to the introduction in Navigation Best Practices.

Systematic troubleshooting process

Please follow the sequence below for troubleshooting, starting with the most likely causes.

Step one: External environment and hardware factors (no code modification required)

  1. Physical environment check:

    • Texture richness
      Is your test environment too monotonous? Large areas of plain white walls, smooth floors, and glass surfaces can cause visual positioning to fail or produce errors.
    • Dynamic objects
      Are there a large number of moving objects in the environment (e.g., crowds, moving vehicles)? Dynamic objects can interfere with visual positioning, but this issue is often temporary.
    • Scene confusion
      Are there highly confusing scenes in the environment (e.g., elevator entrances at different locations)? Visually similar areas can affect positioning, potentially causing the positioning result to jump back and forth between similar areas. Such issues can be mitigated by setting appropriate prior information in advance.
  2. Device hardware check:

    • Device overheating
      Does the device become severely overheated after prolonged operation? Overheating can cause CPU/GPU throttling, affecting the tracking performance of the device's SLAM system, and is the most common cause of persistent drift.
    • Device performance
      On some older devices, due to hardware limitations and component accuracy, scale drift is more likely to occur, causing virtual content to drift as well. You can try switching to a different device for comparative testing to determine if the issue is caused by the device's inherent limitations.

Step two: Map and positioning quality analysis (using external tools)

  1. Use mega toolbox:

    • Run mega toolbox at the same location and observe the stability of its positioning.
    • If toolbox positioning also drifts/jumps: The issue lies in the map itself or the current environment is unsuitable for positioning.
    • If toolbox positioning is stable: The issue lies in your application. Proceed to step three.
  2. Use PC to simulate EIF data playback:

    • Play back the EIF data recorded on-site.
    • If playback also drifts/jumps: It indicates the scene itself is unsuitable for positioning, or there is an issue with the map itself, or the motion tracking of the device used to record the EIF has scale drift.
    • If playback is stable: It indicates the scene itself is positioning-friendly, and the issue may lie in factors such as your application causing device overheating or throttling during real-time operation.

Step three: Apply internal logic checks

  1. Pose update:

    • Have you applied unnecessary additional smoothing to the pose data (such as excessive Lerp or SmoothDamp), which can instead cause latency and drift.
    • Typically, directly using the original Pose returned by Mega is the most stable.
  2. Coordinate system matching:

    • Confirm that the node relationships between your virtual objects, scene camera, and MegaTracker are correct, and that the local transform values of the nodes under MegaBlocks themselves have not been modified.
    • Incorrect node settings can lead to improper coordinate system transformations, causing unpredictable behavior in content rendering.

Special reminder: Visual overlay issues with OST head-mounted displays

After completing the troubleshooting of positioning and rendering logic, if you are using an OST (optical see-through) head-mounted display, there is a special case to consider.

Even if the device itself has good 6DoF motion tracking capabilities, you may still encounter issues where the "alignment" between virtual objects and physical space is not ideal. This is usually not a malfunction of the Mega positioning service but an inherent phenomenon caused by the optical principles of OST devices, such as optical alignment errors or eye calibration differences.

For a detailed explanation and judgment methods regarding such issues, please refer to the OST device-specific instructions.

Summary and best practices

After the previous troubleshooting, you should have identified the root cause of content jittering or drifting. For your quick review and action, we have summarized common problem symptoms, possible causes, and best practices in the table below. Based on your troubleshooting results, locate the corresponding solution in the table.

Problem type Possible cause Best practice
Minor jitter Sensor noise, algorithm limits Such minor jitter is normal and generally requires no excessive attention
Drift after rapid movement SLAM delay, algorithm correction Guide users to move the device smoothly. If it cannot recover quickly, additional attention is needed
Persistent large-scale drift SLAM failure, device differences Cross-validate by switching devices
Severe jumping/flashing Confusing scene, unfriendly positioning Set auxiliary prior information or guide users
Inconsistent relative position with real objects Positioning/map error, code logic error Test from multiple perspectives and observe the virtual object's position to fix potential code errors

If your issue persists after the above troubleshooting and fixes, please submit a detailed report via Issue reporting with screen recordings, EIF data recordings, and detailed logs.