How To Use the Trackable Base Class

In Vuforia Engine, the concept of a target is represented through the definition of two main classes, Trackable and TrackableResult.

A Trackable is the base class used to identify all real-world objects that Vuforia Engine can detect and track in 3D space. The trackable class defines the basic properties for a given target object, such as its name, type, ID, and user-defined data. Specific trackable subtypes define further attributes that are applicable to specific types of objects.

Vuforia Engine analyzes the video frames captured by the camera, and tries to match elements that are visible in the current video frame with one or more targets in a predefined set. When a match is found, a TrackableResult object is created and passed to the application through the State object at each frame.

Trackable parameters

Trackable type

  • An enum that represents one of the following types of trackable:
    • UNKNOWN_TYPE: a trackable of unknown type
    • OBJECT_TARGET: a trackable of ObjectTarget type
    • IMAGE_TARGET: a trackable of ImageTarget type
    • CYLINDER_TARGET: a trackable of CylinderTarget type
    • MULTI_TARGET: a trackable of MultiTarget type
    • MODEL_TARGET: a trackable of ModelTarget type
    • VUMARK_TARGET: a trackable of VuMarkTarget type
    • VUMARK_TEMPLATE: a trackable of VuMarkTemplate type
    • AREA_TARGET: a trackable of AreaTarget type

Trackable name

  • A string that uniquely identifies the trackable in the database of targets
  • Maximum string length: 64 characters
  • Allowed character set: a-z, A-Z, 0-9,[ - _ .]

User data

  • Property that represents generic user-defined data associated with the trackable

TrackableResult instance contains a reference to the matching target, a status, and a pose matrix. The pose matrix represents the current 3D position and orientation of the trackable with respect to the camera reference frame. Vuforia Engine defines a TrackableResult subtype for each of the following trackable subtypes.

TrackableResult parameters

Trackable
result type

  • An enum that represents the type of trackable result; each type matches a corresponding type of the Trackable class:
    • UNKNOWN_TYPE: a trackable result of unknown type
    • OBJECT_TARGET_RESULT: a result for a trackable of ObjectTarget type
    • IMAGE_TARGET_RESULT: a result for a trackable of ImageTarget type
    • CYLINDER_TARGET_RESULT: a result for a trackable of CylinderTarget type
    • MULTI_TARGET_RESULT: a result for a trackable of MultiTarget type
    • MODEL_TARGET_RESULT: a result for a trackable of ModelTarget type
    • VUMARK_TARGET_RESULT: a result for a trackable of VuMarkTarget type
    • AREA_TARGET_RESULT: a result for a trackable of AreaTarget type

Trackable

  • The trackable that this result refers to.

For detailed information on the TrackableResult statuses, please refer to Interpreting Tracking State API Results.

Configure the Trackable in the Unity Editor via the DefaultTrackableEventHandler. Choose if the target should render content when it is "Tracked", "Extended Tracked" or also when only a "Limited" pose is available. This allows for per-trackable configuration of extended tracked poses. See Using the Device Tracker in Unity for more information.

If a trackable is reported with status "Limited", only an inaccurate pose is available. It should only be taken into consideration if close alignment of virtual content and real-world object is not required.

Trackable result pose data

Vuforia Engine uses right-handed coordinate systems. Each image target define a local coordinate system with (0,0,0) in the center (middle) of the target. Then +X goes to the right, +Y goes up, and +Z points out of the trackable (in the direction from which it can be seen), as illustrated in the following figure.

The origin of the local coordinate system of a multi-target is defined by its components. The image-target parts of the multi-target are transformed relative to this origin. The reported pose of the MultiTargetResult is the position of this origin, independent from which individual part is tracked within the multi-target. This feature allows a geometric object (for example, a box) to be tracked continuously with the same coordinates, even if other image target parts are visible in the camera view.