The base class for all types of TrackingManager. More...
Inherits MonoBehaviour, Visometry.VisionLib.SDK.Core.IParameterHandler, and Visometry.VisionLib.SDK.Core.Details.ISceneValidationCheck.
Inherited by Visometry.VisionLib.SDK.Core.AsynchronousTrackingManager, and Visometry.VisionLib.SDK.Core.SynchronousTrackingManager.
Data Structures | |
class | WorkerNotFoundException |
Public Types | |
enum | ImageStream |
Public Member Functions | |
bool | ActiveInBackend () |
bool | AddCameraCalibrationDB (string uri) |
Adds the camera calibration DataBase using the URI. It will not be loaded at this point but only the possibility to add it will be checked. The loading of the actual database happens when starting the tracking pipe! More... | |
delegate void | CalibratedImageAction (CalibratedImage calibratedImage) |
Delegate for OnCalibratedImage events. More... | |
delegate void | ExtrinsicDataAction (ExtrinsicData extrinsicData) |
Delegate for OnExtrinsicData events. More... | |
DeviceInfo | GetDeviceInfo () |
Returns the device info, when the worker object has been initialized. You can call this function in order to get useful system information before starting the tracking pipe You might use this structure for retrieving the available cameras in the system. More... | |
string | GetDeviceType () |
Returns the type of the loaded device pipeline. Works for tracking configurations loaded from a vl-file or vl-string. More... | |
LicenseInformation | GetLicenseInformation () |
async Task< T > | GetParameterAsync< T > (string parameterName) |
Texture2D | GetStreamTexture (ImageStream streamType) |
bool | GetTrackerInitialized () |
This variable stores the state of the trackerInitialized variable before it is Disabled. More... | |
TrackerRuntimeParameters | GetTrackerRuntimeParameters () |
string | GetTrackerType () |
Returns the type of the loaded tracking pipeline. Works for tracking configurations loaded from a vl-file or vl-string. More... | |
bool | GetTrackerType (out string trackerType) |
Returns the type of the loaded tracking pipeline. Works for tracking configurations loaded from a vl-file or vl-string. More... | |
bool | GetTrackingRunning () |
Worker | GetWorker () |
Returns the owned Worker object. More... | |
bool | HasWorker () |
Check if the Worker has already been created. If you depend on the Worker, you can register to the OnWorkerCreated event, if this function returns false. More... | |
delegate void | ImageAction (Image image) |
Delegate for OnImage events. More... | |
delegate void | IntrinsicDataAction (IntrinsicData intrinsicData) |
Delegate for OnIntrinsicData events. More... | |
delegate void | IssueTriggeredAction (Issue issue) |
Delegate for OnIssueTriggered events. More... | |
void | PauseTracking () |
Pause the tracking. More... | |
async Task | PauseTrackingAsync () |
Pause the tracking. | |
delegate void | PerformanceInfoAction (PerformanceInfo state) |
Delegate for OnPerformanceInfo events. More... | |
void | ResetAnchorTransformListener (string anchorName) |
void | ResetTrackingHard () |
Reset the tracking and all key frames. More... | |
void | ResetTrackingSoft () |
Reset the tracking. More... | |
void | ResumeTracking () |
Resume the tracking. More... | |
async Task | ResumeTrackingAsync () |
Resume the tracking. | |
void | SetFPS (int newFPS) |
Sets the frame rate of the tracking algorithm. This might limit the performance consumed by VisionLib. More... | |
async Task | SetFPSAsync (int newFPS) |
Sets target number of frames per second for the tracking thread. | |
void | SetImageSourceEnabled (bool newValue) |
Task< WorkerCommands.CommandWarnings > | SetParameterAsync (string parameterName, string parameterValue) |
void | SetWaitForEvents (bool wait) |
Set waitForEvents to the given value. More... | |
virtual void | StartTracking (string filename) |
Start the tracking using a vl-file. More... | |
void | StartTrackingFromString (string trackingConfig, string projectDir, string overrideParameter=null) |
Start the tracking using a tracking configuration as string. More... | |
virtual void | StopTracking () |
Stop the tracking (releases all tracking resources). More... | |
delegate void | TrackingStatesAction (TrackingState state) |
Delegate for OnTrackingStates events. More... | |
bool | ActiveInBackend () |
Task< T > | GetParameterAsync< T > (string parameterName) |
Task< WorkerCommands.CommandWarnings > | SetParameterAsync (string parameterName, string parameterValue) |
Static Public Member Functions | |
static EventWrapper< SimilarityTransform > | AnchorTransform (string anchorName) |
static async void | CatchCommandErrors (Task task, MonoBehaviour caller=null) |
This function should be used when awaiting a Task created anywhere within the vlUnitySDK. It will await the Task while treating all VisionLib specific errors which might arise from calling a command. Using this function also preserves the call stack, so you will still be able to identify the function which causes the logged error. More... | |
static async void | CatchCommandErrors (Task< WorkerCommands.CommandWarnings > task, MonoBehaviour caller=null) |
This function should be used when awaiting a Task created anywhere within the vlUnitySDK. It will await the Task while treating all VisionLib specific errors which might arise from calling a command. Using this function also preserves the call stack, so you will still be able to identify the function which causes the logged error. More... | |
static bool | DoesTrackerExistAndIsInitialized () |
Returns true if the tracker is initialized. If no instance of the tracking manager exists (yet / anymore) this will More... | |
static bool | DoesTrackerExistAndIsRunning () |
Returns true if the tracker is running. If no instance of the tracking manager exists (yet / anymore) this will More... | |
static void | EmitEvents (Frame frame) |
static void | InvokeOnTrackerResetHard () |
static void | InvokeOnTrackerResetSoft () |
Data Fields | |
string | calibrationDataBaseURI |
LicenseFile | licenseFile |
Path to the license file. | |
VLSDK.LogLevel | logLevel = VLSDK.LogLevel.Warning |
VisionLib log level. More... | |
int | targetFPS = 30 |
Target number of frames per second for the tracking thread. More... | |
bool | waitForEvents = false |
Whether to wait for tracking events. More... | |
Protected Member Functions | |
virtual void | Awake () |
void | CreateLogger () |
abstract void | CreateWorker () |
virtual void | Initialize () |
virtual void | OnDestroy () |
virtual void | OnDisable () |
virtual void | OnEnable () |
void | PauseTrackingInternal () |
Pause the tracking. Does not modify the trackingRunning variable. More... | |
abstract void | RegisterListeners () |
abstract void | RegisterTrackerListeners () |
async Task | ResetTrackingHardAsync () |
async Task | ResetTrackingSoftAsync () |
abstract bool | ShouldShowMark () |
abstract bool | TryAddDebugImageListener () |
abstract bool | TryRemoveDebugImageListener () |
void | UnregisterAllAnchorTransformListeners () |
abstract void | UnregisterListeners () |
abstract void | UnregisterTrackerListeners () |
virtual void | Update () |
abstract void | UpdateAnchorTransformListeners () |
Static Protected Member Functions | |
static void | EmitOnCalibratedDepthImageWhenValid (CalibratedImage calibratedImage) |
static void | EmitOnCameraTransform (ExtrinsicData extrinsicData) |
static void | EmitOnDebugImage (Image debugImage) |
static void | EmitOnExtrinsicData (ExtrinsicData extrinsicData) |
static void | EmitOnImage (Image image) |
static void | EmitOnIntrinsicData (IntrinsicData intrinsicData) |
static void | EmitOnPerformanceInfo (PerformanceInfo performanceInfo) |
static void | EmitOnTrackingStatesWhenValid (TrackingState state) |
static void | TriggerIssue (Issue issue) |
static void | TriggerWarnings (WorkerCommands.CommandWarnings warnings, MonoBehaviour caller=null) |
Protected Attributes | |
Dictionary< string, IDisposable > | anchorTransformListeners |
bool | trackerInitialized = false |
Worker | worker = null |
object | workerLock = new object() |
bool | worldFromCameraTransformListenerRegistered = false |
Static Protected Attributes | |
static SingletonObjectReference< TrackingManager > | instance |
Properties | |
static TrackingManager | Instance [get] |
Get a reference to the TrackingManager in the scene. More... | |
Worker | Worker [get] |
Get a reference to the Worker owned by a TrackingManager. More... | |
Events | |
static CalibratedImageAction | OnCalibratedDepthImage |
Event with the current calibrated depth image. This Event will be emitted for each tracking frame. | |
static ExtrinsicDataAction | OnCameraTransform |
Event with the current extrinsic data slam. This Event will be emitted for each tracking frame. | |
static ImageAction | OnDebugImage |
Event with the current debug image. This Event will be emitted for each tracking frame, if debugLevel is at least 1 | |
static ExtrinsicDataAction | OnExtrinsicData |
Event with the current extrinsic data. This Event will be emitted for each tracking frame. | |
static ImageAction | OnImage |
Event with the current tracking image. This Event will be emitted for each tracking frame. | |
static IntrinsicDataAction | OnIntrinsicData |
Event with the current intrinsic data. This Event will be emitted for each tracking frame. | |
static IssueTriggeredAction | OnIssueTriggered |
Event which will be emitted if an Issue was triggered | |
static PerformanceInfoAction | OnPerformanceInfo |
Event with the current tracking performance. This Event will be emitted for each tracking frame. | |
static VLSDK.VoidDelegate | OnTrackerInitialized |
Event which will be emitted after the tracking configuration was loaded. | |
static VLSDK.VoidDelegate | OnTrackerInitializing |
Event which will be emitted once after calling the StartTracking function. | |
static VLSDK.VoidDelegate | OnTrackerPaused |
Event which will be emitted after the tracking was paused. | |
static VLSDK.VoidDelegate | OnTrackerResetHard |
Event which will be emitted after a hard reset was executed. | |
static VLSDK.VoidDelegate | OnTrackerResetSoft |
Event which will be emitted after a soft reset was executed. | |
static VLSDK.VoidDelegate | OnTrackerRunning |
Event which will be emitted once after the tracking was stopped or paused and is now running again. | |
static VLSDK.VoidDelegate | OnTrackerStopped |
Event which will be emitted after the tracking was stopped or the initialization of the tracker has failed. | |
static TrackingStatesAction | OnTrackingStates |
Event with the current tracking state of all tracked objects. This Event will be emitted for each tracking frame. | |
static VLSDK.VoidDelegate | OnWorkerCreated |
Event which will be emitted once after the worker has been created. | |
The base class for all types of TrackingManager.
|
inline |
Implements Visometry.VisionLib.SDK.Core.IParameterHandler.
|
inline |
Adds the camera calibration DataBase using the URI. It will not be loaded at this point but only the possibility to add it will be checked. The loading of the actual database happens when starting the tracking pipe!
true
, if camera calibration DB was added, false
otherwise.uri | URI pointing to the camera calibration to be merged. |
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.CalibratedImageAction | ( | CalibratedImage | calibratedImage | ) |
Delegate for OnCalibratedImage events.
calibratedImage | CalibratedImage. |
|
inlinestatic |
This function should be used when awaiting a Task created anywhere within the vlUnitySDK. It will await the Task while treating all VisionLib specific errors which might arise from calling a command. Using this function also preserves the call stack, so you will still be able to identify the function which causes the logged error.
task | Task which should be awaited. |
caller | MonoBehaviour which should be referenced, when selecting error message in the log. |
|
inlinestatic |
This function should be used when awaiting a Task created anywhere within the vlUnitySDK. It will await the Task while treating all VisionLib specific errors which might arise from calling a command. Using this function also preserves the call stack, so you will still be able to identify the function which causes the logged error.
task | Task which should be awaited. |
caller | MonoBehaviour which should be referenced, when selecting error message in the log. |
|
inlinestatic |
Returns true if the tracker is initialized. If no instance of the tracking manager exists (yet / anymore) this will
also return false and not throw an exception.
|
inlinestatic |
Returns true if the tracker is running. If no instance of the tracking manager exists (yet / anymore) this will
also return false and not throw an exception.
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.ExtrinsicDataAction | ( | ExtrinsicData | extrinsicData | ) |
Delegate for OnExtrinsicData events.
extrinsicData | ExtrinsicData. |
|
inline |
Returns the device info, when the worker object has been initialized. You can call this function in order to get useful system information before starting the tracking pipe You might use this structure for retrieving the available cameras in the system.
|
inline |
Returns the type of the loaded device pipeline. Works for tracking configurations loaded from a vl-file or vl-string.
|
inline |
Implements Visometry.VisionLib.SDK.Core.IParameterHandler.
|
inline |
This variable stores the state of the trackerInitialized variable before it is Disabled.
Some MonoBehaviours request the trackerInitialized state in their OnEnable function. If OnEnable is called for several GameObjects, the execution order can not be influenced. This is especially the case when recompiling during play mode. For this reason, we store the trackerInitialized state in this variable and set trackerInitialized to false in OnDisable. In OnEnable, we reset the value of trackerInitialized back to the original value. This way, any MonoBehaviour re-enabled before the TrackingManager will assume the TrackingManager as uninitialized. At the moment, if the scripts are recompiled, TrackingManager will be uninitialized afterwards.
|
inline |
Returns the type of the loaded tracking pipeline. Works for tracking configurations loaded from a vl-file or vl-string.
|
inline |
Returns the type of the loaded tracking pipeline. Works for tracking configurations loaded from a vl-file or vl-string.
trackerType | loaded tracker type |
|
inline |
Returns the owned Worker object.
|
inline |
Check if the Worker has already been created. If you depend on the Worker, you can register to the OnWorkerCreated event, if this function returns false.
true
, if the Worker can be used, false
otherwise. delegate void Visometry.VisionLib.SDK.Core.TrackingManager.ImageAction | ( | Image | image | ) |
Delegate for OnImage events.
image | API.Native.Image. |
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.IntrinsicDataAction | ( | IntrinsicData | intrinsicData | ) |
Delegate for OnIntrinsicData events.
intrinsicData | IntrinsicData. |
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.IssueTriggeredAction | ( | Issue | issue | ) |
Delegate for OnIssueTriggered events.
issue | Issue |
|
inline |
Pause the tracking.
This function will be performed asynchronously.
|
inlineprotected |
Pause the tracking. Does not modify the trackingRunning
variable.
This function will be performed asynchronously.
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.PerformanceInfoAction | ( | PerformanceInfo | state | ) |
Delegate for OnPerformanceInfo events.
state | PerformanceInfo with information about the performance. |
|
inline |
Reset the tracking and all key frames.
This function will be performed asynchronously.
|
inline |
Reset the tracking.
This function will be performed asynchronously.
|
inline |
Resume the tracking.
This function will be performed asynchronously.
|
inline |
Sets the frame rate of the tracking algorithm. This might limit the performance consumed by VisionLib.
This function will be performed asynchronously.
newFPS | Number of frames per second |
|
inline |
Implements Visometry.VisionLib.SDK.Core.IParameterHandler.
|
inline |
Set waitForEvents to the given value.
See waitForEvents for further information.
|
inlinevirtual |
Start the tracking using a vl-file.
The type of the tracker will be derived from the vl-file.
Reimplemented in Visometry.VisionLib.SDK.Core.SynchronousTrackingManager.
|
inline |
Start the tracking using a tracking configuration as string.
trackingConfig | Tracking configuration as string |
projectDir | Directory |
overrideParameter |
|
inlinevirtual |
Stop the tracking (releases all tracking resources).
Reimplemented in Visometry.VisionLib.SDK.Core.SynchronousTrackingManager.
delegate void Visometry.VisionLib.SDK.Core.TrackingManager.TrackingStatesAction | ( | TrackingState | state | ) |
Delegate for OnTrackingStates events.
state | TrackingState with information about the currently tracked objects. |
|
protected |
|
staticprotected |
VLSDK.LogLevel Visometry.VisionLib.SDK.Core.TrackingManager.logLevel = VLSDK.LogLevel.Warning |
VisionLib log level.
Available log levels:
Log level N will disable all log messages with a level > N.
int Visometry.VisionLib.SDK.Core.TrackingManager.targetFPS = 30 |
Target number of frames per second for the tracking thread.
The tracking will run as fast as possible, if the value is zero or less.
Higher values will result in a smoother tracking experience, but the battery will be drained faster.
bool Visometry.VisionLib.SDK.Core.TrackingManager.waitForEvents = false |
Whether to wait for tracking events.
If true
, the Update member function will wait until there is at least one tracking event. This will limit the speed of the Unity update cycler to the speed of the tracking, but the tracking will feel more smooth, because the camera image will be shown with less delay.
If false
, the speed of the tracking and the Unity update cycle are largely separate. Due to the out of sync update rates, the camera might be shown with a slight delay.
|
staticget |
Get a reference to the TrackingManager in the scene.
Usage:
var thisScenesTrackingManager = TrackingManager.Instance;
|
get |
Get a reference to the Worker owned by a TrackingManager.
Usage for direct access to the Worker in the current scene via the TrackingManager's static Instance property:
var thisScenesWorker = TrackingManager.Instance.Worker;
Usage for access via a reference to a specific TrackingManager:
var worker = someTrackingManager.Worker;