documentation

Model Tracker Command Reference

The following commands can be executed, if a tracking configuration with a modelTracker pipeline is loaded:

CommandName Parameter

Result

resetSoft None None

The resetSoft command resets the tracking to the initial pose. All data acquired during tracking will be kept.

resetHard None None

The resetHard command resets the tracking to the initial state. All data acquired during tracking will also be reset.

getInitPose None
{
"q": float[4],
"t": float[3]
}

The getInitPose command returns the current init pose. q is the rotation as a quaternion in the order [x, y, z, w].

setInitPose
{
"q": float[4],
"t": float[3]
}
None

The setInitPose command sets the initial tracking pose of the camera to the given InitPose. q is the rotation as a quaternion in the order [x, y, z, w].

setGlobalObjectPose
{
"q": float[4],
"t": float[3]
}
None

The setGlobalObjectPose command sets the pose of the tracking model to the given translation and rotation. This pose is interpreted relative to the world origin as defined by external SLAM (ARCore, ARKit, HoloLens, etc.). q is the rotation as a quaternion in the order [x, y, z, w].

setModelProperties
{
"name": string,
?"uri": string,
?"enabled": bool,
?"occluder": bool,
"transform" :
{
?"t": float[3],
?"q": float[4],
?"s": float[3]
}
}
None

The setModelProperties command sets the given model properties for the models specified by name. Every element starting with a ? is optional. If it isn't set, the value will not be changed by this command. The given parameter is called PartialNamedModelDefinition and is also used in the setMultipleModelProperties command.

setMultipleModelProperties
{
"models": PartialNamedModelDefinition[]
}
None

The setMultipleModelProperties command sets the given model properties to the corresponding models. It receives an array of partial model definitions extended with a mandatory name property (see also the setModelProperties command). The model with the given name will be changed according to the partial model definition. See also Model Parts Tracking.

setModelPropertiesForAll
{
?"uri": string,
?"enabled": bool,
?"occluder": bool,
"transform" :
{
?"t": float[3],
?"q": float[4],
?"s": float[3]
}
}
None

The setModelPropertiesForAll command sets the given model properties for all models in this tracker. The given parameter is a PartialModelDefinition and similar to the the one used in setModelProperties. See also Model Parts Tracking.

getModelProperties None
{
"info": NamedModelProperties[]
}

The getModelProperties command returns the model properties for all models loaded in the tracker. The given result is similar to the PartialNamedModelDefinition used in the setModelProperties command, except that all values are set. See also Model Parts Tracking.

addModel
{
"name": string,
?"uri": string,
?"enabled": bool,
?"occluder": bool,
"transform" :
{
?"t": float[3],
?"q": float[4],
?"s": float[3]
}
}
{
"addedModel": string
}

The addModel command adds a new model to the tracker. The name is also optional. If the name isn't set, a name will be generated. This command returns the name of the added model. See also Model Parts Tracking.

removeModel
{
"modelName": string
}
None

The removeModel command removes the model with the given name from the tracker. See also Model Parts Tracking.

removeAllModel None None

The removeAllModel command removes all models from the tracker. See also Model Parts Tracking.

set1DRotationConstraint
{
"upWorld":
{
"x": float,
"y": float,
"z": float
},
"up_model":
{
"x": float,
"y": float,
"z": float
},
"center_model":
{
"x": float,
"y": float,
"z": float
},
}
None

The set1DRotationConstraint command limits the number of possible poses as result of the tracking. It makes sure that the up-Vector of the model and the up-Vector of the world are aligned. When the model is initially rotated to fulfill the constraint, it will be rotated around center_model. Note: This feature can only be used when externalSlam is available or simulateExternalSLAM is switched on.

disableConstraints None None

The disableConstraints command removes all previously set constraints (e.g. via set1DRotationConstraint).

setWorkSpaces
WorkspaceConfiguration
None

The setWorkSpaces command sets the WorkSpace for AutoInit. For details on AutoInit see AutoInit with WorkSpaces (Beta).

setWorkSpacesFromFile
{
"uri": string
}
None

The setWorkSpacesFromFile command loads the WorkSpace for AutoInit from a given file. For details on AutoInit see AutoInit with WorkSpaces (Beta).

writeInitData
{
"uri": string
}
None

The writeInitData command stores the current initialization data to a given file. For details on these initialization data see Initialization: Fast Init & Re-initialization.

readInitData
{
"uri": string
}
None

The readInitData command loads previously saved initialization data from a given file. For details on these initialization data see Initialization: Fast Init & Re-initialization.

resetInitData None None

The resetInitData command resets all currently available initialization data. This will also reset the learned AutoInit data. For details on these initialization data see Initialization: Fast Init & Re-initialization.

The following JsonAndBinary commands can be executed, if a tracking configuration with a modelTracker pipeline is loaded:

CommandName Parameter BinaryData

Result

addModelData
{
"models": ModelDescription[]
}
ModelData
{
"addedModels": NameLicenseFeaturePair[]
}
The addModelData command deserializes the ModelData to a model for tracking and adds this data to the current ModelTracker. It returns an array of objects containing a model name and the license feature array corresponding to that model:
{
"name": string,
"licenseFeatures": string[]
}
See also Using Models from Unity Hierarchy for Tracking (Beta)