Diagnosis and repair: content jitter and drift issues in applications
"Virtual content is drifting," "objects are shaking," "position instability"—these are common problems developers encounter in AR applications. Content instability can severely disrupt immersion and lead to poor user experiences.
This article will help you understand the causes of content jitter and drift, and provide a systematic troubleshooting and optimization approach.
Distinguishing "normal jitter" from "abnormal drift"
First, we need to establish reasonable expectations. Achieving high-precision AR tracking on mobile devices is inherently challenging. The following situations 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: caused by physical noise in device sensors, precision limits of visual tracking algorithms, and subtle hand tremors while holding the device.
- Example: this subtle jitter is normal when observing closely (e.g., placing a virtual object on a table and leaning in to view it).
Temporary drift:
- Manifestation: when users move or rotate the device rapidly, virtual objects briefly deviate (0.5-1 second) before recovering.
- Cause: during rapid motion, cumulative errors in the device's IMU (inertial measurement unit) and delays in visual positioning cause temporary drift.
- Example: acceptable in dynamic scenes if objects quickly "snap back" to the correct position.
The following situations are abnormal issues requiring troubleshooting and repair:
- Persistent, significant position drift: virtual objects slowly and continuously deviate from their intended position without recovery.
- Severe jumping or flickering: virtual objects jump significantly on-screen or appear/disappear intermittently.
- Inconsistent relative position to real objects: virtual objects fail to stay "anchored" to real-world surfaces.
Note
Additionally, note a key point:
Devices operating in 0DoF, 3DoF, or 5DoF modes inherently have weaker "integration" and "realism" than 6DoF devices. When users move quickly, turn, or climb stairs, virtual objects cannot follow perfectly.
Thus, phenomena like content "floating in air" or "position shifts" in these modes are fundamental device limitations, not the "content jitter/drift" faults discussed here.
For differences between xDoF modes, refer to navigation best practices.
Systematic troubleshooting process
Follow these steps sequentially, starting with the most likely causes.
Step 1: external environment and hardware factors (no code modification needed)
Physical environment check:
- Texture richness
Is your test environment too monotonous? Large areas of plain walls, smooth floors, or glass surfaces cause visual positioning failures. - Dynamic objects
Are there many moving objects (e.g., crowds, vehicles)? Dynamic objects interfere with visual positioning, though usually temporarily. - Scene confusion
Are there highly similar areas (e.g., identical elevator lobbies)? Visually ambiguous regions affect positioning, causing tracking to "jump" between zones. Pre-setting appropriate prior information can mitigate this.
- Texture richness
Device hardware check:
- Device overheating
After prolonged use, does the device overheat? Overheating triggers CPU/GPU throttling, degrading the device's SLAM performance—a common cause of persistent drift. - Device performance
Older devices with limited hardware capabilities and sensor precision are more prone to scale drift. Test with different devices to verify if limitations are device-specific.
- Device overheating
Step 2: map and positioning quality analysis (using external tools)
Use mega toolbox:
- Run Mega Toolbox at the same location and observe positioning stability.
- If Toolbox drifts/jumps: the issue lies in the map itself or the environment being unsuitable for positioning.
- If Toolbox is stable: the problem is in your application. Proceed to step three.
Simulate EIF data on PC:
- Replay EIF data recorded onsite.
- If playback drifts/jumps: the scene is unsuitable for positioning, the map has issues, or the device used for recording had motion tracking scale drift.
- If playback is stable: the environment is positioning-friendly; issues likely stem from your application (e.g., device overheating/throttling during real-time operation).
Step 3: application internal logic check
Pose updates:
- Avoid unnecessary smoothing (e.g., excessive
LerporSmoothDamp), which introduces latency and drift. - Typically, using Mega's raw Pose directly is most stable.
- Avoid unnecessary smoothing (e.g., excessive
Coordinate system matching:
- Ensure correct node relationships between virtual objects, scene cameras, and
MegaTracker. Never modifylocal transformvalues of nodes underMegaBlocks. - Incorrect node setups cause erroneous coordinate conversions, leading to unpredictable rendering.
- Ensure correct node relationships between virtual objects, scene cameras, and
Special note: OST headset visual alignment issues
After troubleshooting positioning and rendering logic, OST (optical see-through) headset users must consider an additional scenario.
Even with robust 6DoF tracking, virtual objects may appear poorly aligned with physical space. This is typically not a Mega positioning fault, but an inherent limitation of OST optics (e.g., optical calibration errors or eye-tracking discrepancies).
For details, see OST device specifics.
Summary and best practices
After troubleshooting, you should identify the root cause of jitter/drift. For quick reference, we summarize common issues, causes, and solutions below.
| Issue type | Possible cause | Best practice |
|---|---|---|
| Minor jitter | Sensor noise, algorithm limits | Normal; generally ignore |
| Drift after rapid movement | SLAM latency, algorithm correction | Guide users to move steadily. Investigate if recovery is slow |
| Persistent large-scale drift | SLAM failure, device variance | Cross-validate with other devices |
| Severe jumping/flickering | Ambiguous scenes, poor positioning | Set prior information or guide users |
| Inconsistent relative position | Positioning/map errors, code logic | Multi-angle testing; fix code errors |
If issues persist after these steps, submit a detailed report via issue reporting with screen recordings, EIF data, and logs.