Overview
TheITracker interface is the base class for all tracker plugins. Trackers are responsible for capturing head pose data from various sources including cameras, hardware devices, and network sources.
Interface Definition
Methods
start_tracker()
QFrame*
Qt frame widget for displaying video preview. Can be
nullptr if no preview needed.module_status
Returns
status_ok() on success, or error(message) on failure.- Called once when tracking is started
- Initialize hardware, open cameras, start threads
- Set up video preview widget if frame is provided
- Return error status if initialization fails
data()
double*
Output array of 6 doubles:
[TX, TY, TZ, Yaw, Pitch, Roll]. Must be filled by implementation.- Called at ~250Hz from the tracking pipeline thread
- Fill the data array with current pose
- Use mutex protection for thread-safe access
- Don’t perform heavy computation here
- Use a background thread for processing
TX(data[0]): X translation in centimeters (left: negative, right: positive)TY(data[1]): Y translation in centimeters (down: negative, up: positive)TZ(data[2]): Z translation in centimeters (backward: negative, forward: positive)Yaw(data[3]): Rotation around Y axis in degrees (left: negative, right: positive)Pitch(data[4]): Rotation around X axis in degrees (down: negative, up: positive)Roll(data[5]): Rotation around Z axis in degrees (left: negative, right: positive)
center()
bool
true: Use current pose as center (identity transform)false: Use default center behavior (current pose as offset)
- Called from UI thread when user presses center hotkey
- Store current pose as center reference
- Return
falseto use default centering (recommended) - Return
trueto make identity the center pose
status_ok() and error()
const QString&
Error message to display to user
Dialog Interface
register_tracker()
ITracker*
Pointer to the running tracker instance. Can be
nullptr.- Called from UI thread when tracker starts
- Store pointer for runtime interaction (if needed)
- Can query tracker state or update preview
- Default implementation does nothing
unregister_tracker()
- Clear any stored tracker pointers
- Stop accessing tracker data
- Default implementation does nothing
Complete Example
Threading Best Practices
Use Background Threads for Processing
Use Background Threads for Processing
Use Atomic Flags for Simple State
Use Atomic Flags for Simple State
See Also
- Protocol Interface - Output tracking data
- Filter Interface - Process tracking data
- Metadata - Plugin metadata requirements