ModelSetTrackingManager
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Modelset Tracking Manager
The ModelsetTrackingManager is a component of the MultiSet SDK that enables the tracking of real-world objects. It works by capturing an image from the device's camera, sending it to the MultiSet backend for analysis against a specified ModelSet, and then aligning a digital objectSpace GameObject to match the position and orientation of the detected object.
This manager is designed to detect and track specific real-world objects that have been pre-configured in the MultiSet system as a "ModelSet". It handles the full lifecycle of object tracking, including automatic tracking initiation, capturing non-blurry images, making API requests, and positioning a corresponding virtual object in the AR scene. It also includes functionality to automatically restart the tracking process if the AR session's tracking quality degrades. A series of UnityEvent callbacks are provided to allow for custom logic to be executed at key points during the tracking process.
This section details the publicly accessible fields of the ModelsetTrackingManager that you can configure in the Unity Editor or via script.
Property
Type
Description
modelsetCode
string
The unique identifier for the ModelSet that you want to track. This code is obtained from the MultiSet developer portal and is required for the manager to function.
autoTracking
bool
If set to true, the manager will automatically attempt to start the object tracking process as soon as the SDK is authenticated.
restartTracking
bool
If enabled, the manager will automatically try to re-track the object if the AR session's tracking state becomes limited or is lost.
showAlert
bool
If true, a simple toast message will be displayed on the screen to provide immediate feedback on the success or failure of an object tracking attempt.
captureDelay
float
The delay in seconds before the manager captures a frame for tracking after StartFrameTracking() is called. This can be useful to allow the camera to focus or to wait for user positioning.
confidenceCheck
bool
To enable confidence chcek on ModelSet tracking response
_confidenceThreshold
float
Confidence filter value ranging between 0 and 1
ObjectTrackingInit
UnityEvent
A UnityEvent that is invoked when the object tracking process is initiated via the StartFrameTracking() method.
ObjectTrackingRequested
UnityEvent
A UnityEvent that is invoked just before the captured image is sent to the MultiSet API for tracking.
ObjectTrackingSuccess
UnityEvent
A UnityEvent that is invoked when an object is successfully tracked and the pose has been applied to the objectSpace GameObject.
ObjectTrackingFailure
UnityEvent
A UnityEvent that is invoked when the object tracking process fails (e.g., the object was not found in the frame or a network error occurred).
This section describes the publicly accessible methods of the ModelsetTrackingManager.
StartFrameTracking()
Manually initiates the object tracking process.
public void StartFrameTracking()
Description When you call this method, the manager will invoke the ObjectTrackingInit event and then start a coroutine. After the specified captureDelay, it will attempt to capture a frame from the AR camera and begin the tracking request. This is the primary method to call if you have autoTracking disabled and wish to trigger tracking based on a specific event or user action.