Best practices for navigation scenarios
In navigation scenarios, providing a smooth and precise user experience is crucial. EasyAR Mega offers multiple xDoF modes to accommodate different device capabilities and environmental requirements. Understanding the differences between these modes and selecting them based on platform characteristics is key to building excellent navigation applications.
Tip
Recommended reading: Experience differences on different devices.
Correctly selecting tracking modes
Building upon Mega localization, we can choose different tracking modes based on the sensor capabilities provided by the device and application requirements to enhance the navigation experience.
For phones equipped with ARKit or ARCore, you only need to use the default 6DoF tracking mode combined with Mega spatial localization to achieve stable, smooth continuous path navigation, providing the best user navigation experience.
However, for mid-to-low-end devices where ARKit or ARCore support is unclear or which are widely used among the user base, selecting the appropriate xDoF mode is critical. Different xDoF working modes directly affect the terminal's tracking performance.
For such devices, you need to test and select their working modes in the following order of priority:
Inertial navigation / 5DoF mode
- Description: It utilizes the device's sensors to achieve 5DoF tracking through EasyAR's built-in inertial navigation algorithm, providing relatively stable and smooth continuous path navigation.
- Behavior: When the user walks, virtual path indicators (such as arrows on the ground) remain stably attached to the ground. Even if the user briefly shakes or changes orientation, the indicators won't jump significantly. However, during elevation changes (like climbing stairs), virtual content will no longer adhere and may float in the air or sink below ground.
- Requirements: Requires devices with high-quality gyroscopes and accelerometers.
- Applicable scenarios: Most indoor and outdoor navigation scenarios, serving as the primary fallback option when 6DoF is unavailable.
3DoF mode
- Description: When the device lacks an accelerometer but has a gyroscope, it can fall back to 3DoF mode.
- Behavior: In 3DoF mode, navigation indicators rotate according to the device's orientation (pitch, yaw, roll). However, when the user translates (moves forward, backward, or sideways), the position of indicators in space does not update. It functions like a compass, always pointing in the correct direction but not moving with the user's footsteps on the map.
- Requirements: The device must at least have a gyroscope.
- Applicable scenarios: Serves as a fallback when 5DoF is unavailable. Suitable for simple directional guidance but not for complex navigation requiring precise path following.
0DoF mode
- Description: This is the most basic mode, suitable for almost all devices but offering the most limited user experience.
- Behavior: In 0DoF mode, the device cannot perceive any movement or rotation. Navigation indicators are fixed at a specific position on the screen (e.g., an arrow in the center), indicating only the relative direction of the target (e.g., the target is to your left front).
- Requirements: No special sensor requirements.
- Applicable scenarios: Serves as the final fallback option or for simple "direction finding" functionality, similar to a compass in traditional navigation.
Experience comparison summary:
| Tracking mode | Behavior during user movement | User experience | Recommendation |
|---|---|---|---|
| 6DoF | Virtual paths stably follow all user movements in real space | Best, strong immersion, precise | ⭐⭐⭐⭐⭐ |
| 5DoF (inertial) | Virtual paths stably follow user movement but fail during elevation changes | Second best, primary fallback when 6DoF fails | ⭐⭐⭐⭐ |
| 3DoF | Path indicators rotate with device orientation but don't follow user movement | Average, can indicate direction but lacks spatial following | ⭐⭐⭐ |
| 0DoF | Indicators fixed on screen, showing only target direction | Basic, provides only directional information | ⭐ |
Special notes for WeChat Mini Program platform
Important note: The Mega WeChat MiniProgram Plugin for the WeChat Mini Program platform has not yet fully released support for 5DoF (inertial), 3DoF, and 0DoF functionality.
In WeChat Mini Programs, the currently supported navigation experience is primarily 6DoF mode.
- Current behavior: After a user initiates Mega-based navigation in a mini program, if the device itself does not support 6DoF mode, the
ARSessionwill fail to start and report an error on the terminal. - Development recommendation: When planning navigation features on WeChat Mini Programs, design with 6DoF mode as the prerequisite. Check the WeChat official documentation for the list of supported devices, or use our API to check device support.
const easyarPlugin: easyar.EasyARWechatMiniprogramPlugin = requirePlugin("easyar-wechat-miniprogram") as easyar.EasyARWechatMiniprogramPlugin;
if (easyarPlugin.isMegaTrackerSupported() === false) {
const message = `The current device does not support VK v1 and v2. Please refer to the official WeChat documentation: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/plane.html`;
wx.showModal({
title: "Device not supported",
content: message,
showCancel: false,
});
console.error(message);
}
Alternative solutions for WeChat Mini Program platform
For developers needing to implement navigation applications with full device support in WeChat Mini Programs, we strongly recommend using our SightPlus AR Navigation product.
This navigation product is a solution specifically optimized for the mini program ecosystem, offering the following advantages:
- Out-of-the-box: No complex Mega SDK integration required; quick access through simple API calls.
- Wide compatibility: Broadly compatible with various terminal devices, supporting almost all devices from 0DoF to 6DoF.
- Complete functionality: Supports advanced navigation features like full path planning, off-route correction, turn prompts, and digital human guidance.
- Comprehensive support: Comes with complete supporting tools including information management, road network deployment, POI adjustment, and routing services.
- Optimized experience: Deeply optimized for WeChat Mini Program performance and interaction characteristics, ensuring a smooth user experience.
How to get started?
Visit the AR Navigation official page to learn how to quickly integrate and use our navigation product to build your mini program application.
Best practices summary
- When developing apps on Android/iOS devices or on head-mounted devices supporting 6DoF, prioritize using Mega + 6DoF mode for the best navigation experience. Based on the actual device conditions, downgrade to 5DoF, 3DoF, or 0DoF to maximize device compatibility.
- On the WeChat Mini Program platform, currently only devices supporting 6DoF mode can run the application, or you can directly integrate SightPlus AR Navigation to achieve full device support and rich product features.