Debugging Augmented- and Mixed Reality projects with VisionLib can include several levels, such as checking errors in the configuration file setup, troubleshoot runtime issues related to scripting, or debugging and tweaking of the tracking results. As such, debugging, troubleshooting and optimization can involve:
For any debugging related to the tracking, make sure to set these parameters in the configuration file:
Name | Description | Examples |
---|---|---|
debugLevel | Parameter to enable debug functionality. Should be declared and set to ´1´ | "debugLevel": 1 |
showLineModel | Parameter to render and display the Line Model. | "showLineModel": true |
Using debugLevel
you're able to access the debug image and display it e.g. inside your Unity project. For details to the debugLevel
look it up in the detail reference.
With showLineModel
you can control, whether or not VisionLib will render the line model it uses for tracking. Displaying it is very handy, when you use a pre-defined initialization pose (which is the default setup).
The line model will be displayed in different colors according to the current tracking state.
During development, the line model helps to find errors in your tracking setup, e.g. when your Tracking Parameters or the metric you've used in your configuration setup aren't appropriate to track your object.
On a UX level, listening to tracking states is a good practice and increases your app's UX, as you can either trigger custom massages and events that guide your users.
While the line model rendering is primarily designed for debugging purposes, you can also use it as part of your UI and e.g. change the appearance of it, or only show it when tracking is lost by using showLineModelLost
instead of showLineModel
, and you can change the line model's color (there is a brief how-to on this in the tracking states article).
You can explore and test all mentioned options using VisionLib's do-it-yourself tracking target kit. With it, you can create a physical 3D object from paper and download a corresponding 3D model as tracking reference.
In general, we recommend to use VisLab for the debugging of tracking objectives. It helps finding errors in the configuration files, enables to tweak essential tracking parameters in real-time, and is a good tool to quickly track custom objects and test their suitability for model tracking.
For a quick test use the do-it-yourself target, run the tool on your desktop, connect a USB or use the built-in camera (if available) and reference your license file:
Target
panel.Expert Mode
and select the Debug
option.normal
or laPlace threshold
.normalThreshold
: slide it slowly all the way up from its default 0.3
to see how the Line Model changes accordingly.laplaceThreshold
and slide it slowly all the way up from its default 1.0
.When debugging in Unity, we recommend to use the VisionLib's example scenes from the Unity SDK.
AdvancedModelTracking
scene and reference your license file in the VLTrackingConfiguration
component on the VLTracking
GameObject.debugLevel
and showLineModel
set in the config file as mentioned earlier).When you load configuration files in Unity, VisionLib will raise issues and give hints, if errors occur. Also, watch the output on the console.
If you look for the VLTracking
GameObject in the hierarchy of the AdvancedModelTracking
example scene, you can find a VLNotifications
GameObject. Here, we have three components that listen to tracking events and -states during runtime.
Since they are part of the demo UI of the scene, they will be built with your app and give helpful information, once you've deployed and run it on a mobile device:
Debug On
button in the AdvancedModelTracking
scene), VisionLib will render a UI element plotting realtime information of the tracking engine, such as the tracking state or Quality.While we use the VLNotifications
GameObject in all example scenes, not all of the prior mentioned components are present everywhere. In case of debuggig functionality, the AdvancedModelTracking
is the most elaborate one, where you can either load and test your custom tracking configuration, or as a developer, learn how VisionLib's VL components, scripts and prefabs are connected and used.
Feel free to add these elements to your own scenes as you see fit. Please note, that if you don't want to use VisionLib's notifications in your final, release-ready, application, make sure to disable these debug components, set debugLevel: 0
and remove other development-relevant items before deployment.