PST SDK
5.2.0.0-0eac0f6
|
Main PST SDK class implementing tracker communication. More...
Public Member Functions | |
delegate void | OnTrackerDataCallback (TrackerData trackerData, ErrorStatus errorStatus) |
A delegate defining the signature of the callback function used to retrive tracking data. More... | |
Tracker () | |
Tracker constructor. More... | |
Tracker (string path) | |
Tracker constructor. More... | |
Tracker (string path, string configFile) | |
Tracker constructor. More... | |
Tracker (string path, string configFile, string dbFile) | |
Tracker constructor. More... | |
Tracker (string path, string configFile, string dbFile, string grabberName) | |
Tracker constructor. More... | |
string[] | GetUncalibratedCameraUrls (bool silent=false) |
Check if cameras of the connected PST Tracker are calibrated. More... | |
string | GetVersionInfo () |
Get version information of the SDK. More... | |
string | GetConfigPath () |
Get the path to the current configuration directory. More... | |
void | AddTrackerListener (OnTrackerDataCallback onTrackerDataCallback) |
Add a listener for tracker data. More... | |
void | RemoveTrackerListener (OnTrackerDataCallback onTrackerDataCallback) |
Remove a listener for tracker data. More... | |
void | StartTracker () |
Start tracking. More... | |
void | PauseTracker () |
Pause tracking. More... | |
StatusMessage | Systemcheck () |
Check if the tracker is running correctly. More... | |
void | SetFramerate (double fps) |
Set tracker frame rate. More... | |
double | GetFramerate () |
Get current frame rate. More... | |
float[] | GetSupportedFramerates () |
Get array of available frame rates. More... | |
void | SetExposure (double exposure) |
Set the exposure time. More... | |
double | GetExposure () |
Get the current exposure time. More... | |
void | GetExposureRange (ref double min, ref double max) |
Get the allowed exposure range. More... | |
void | EnableFiltering () |
Enable filtering of the tracking results. More... | |
void | DisableFiltering () |
Disable filtering of the tracking results. More... | |
void | SetPositionFilter (double value) |
Set the strength of the position filter. More... | |
void | SetOrientationFilter (double value) |
Set the strength of the orientation filter. More... | |
void | EnableTremorFilter () |
Enable the tremor filter. More... | |
void | DisableTremorFilter () |
Disable the tremor filter. More... | |
void | EnableImageTransfer () |
Enable image transfer from the PST Tracker. More... | |
void | DisableImageTransfer () |
Disable image transfer from the PST Tracker. More... | |
Image | GetImage () |
Retrieve images from the connected PST Tracker. More... | |
TargetStatus[] | GetTargetList () |
Get TargetStatuses object containing all tracking targets and their status. More... | |
Target | GetTargetInfo (string targetName) |
Get basic tracking target information. More... | |
void | SetTargetStatus (string targetName, bool active) |
Set status of a single tracking Target. More... | |
bool | GetTargetStatus (string targetName) |
Get status of a single tracking Target. More... | |
TargetMarker[] | GetTargetMarkers (string targetName) |
Get 3D marker positions of stored tracking Target. More... | |
void | SetTargetId (string targetName, int id) |
Set the id of the tracking target. More... | |
void | SetReference (float[] creference, bool relative=false) |
Set the reference system in which tracking results are reported More... | |
void | SetDefaultReference () |
Reset the reference system to the default reference system. More... | |
float[] | GetReference () |
Gets the transformation matrix for the current reference system. More... | |
void | Dispose () |
Dispose method. More... | |
Static Public Member Functions | |
static void | Shutdown () |
Shutdown the tracking system, stopping tracking. More... | |
static void | EnableSharedMemory () |
Enable shared memory communication layer. More... | |
static void | DisableSharedMemory () |
Disable shared memory communication layer. More... | |
static void | EnableRestServer (string serverAddress="localhost", string serverPort="7278", int eventStreamRetryTimeout=3000) |
Enable a REST Server using the HTTP protocol on a local area network. More... | |
static void | DisableRestServer () |
Disable the REST server communication layer. More... | |
static void | EnableLogging () |
Write plug-in status information to the standard error stream. More... | |
static string | GetSDKVersion () |
Retrieve the SDK version string. More... | |
This class implements the main PST SDK functionality. Examples on how to use this class and how to get data from the PST Tracker can be found in the Examples section.
|
inline |
Construct Tracker object using default values and initialize connected PST tracker.Camera calibration information is checked during initialization. When calibration files for the connected tracker can not be found, a message with download links will be printed to the command line.
TrackerException | General Tracker error. |
NotInitializedException | Tracker was not initialized correctly. |
|
inline |
Construct Tracker object setting the configuration path and initialize connected PST tracker.Camera calibration information is checked during initialization. When calibration files for the connected tracker can not be found, a message with download links will be printed to the command line.
path | Path to the configuration directory to be used for storing camera calibrations, target database and configuration files.Use "" for default. (default: "%PROGRAMDATA%\PS-Tech\PST Iris") |
TrackerException | General Tracker error. |
NotInitializedException | Tracker was not initialized correctly. |
|
inline |
Construct Tracker object using a config path and config file name and initialize connected PST tracker.Camera calibration information is checked during initialization. When calibration files for the connected tracker can not be found, a message with download links will be printed to the command line.
path | Path to the configuration directory to be used for storing camera calibrations, target database and configuration files.Use "" for default. (default: "%PROGRAMDATA%\PS-Tech\PST Iris") |
configFile | Name of the server configuration file.Use "" for default. (default: "server.cfg").> |
TrackerException | General Tracker error. |
NotInitializedException | Tracker was not initialized correctly. |
|
inline |
Construct Tracker object using a config path, config file name and models database path and initialize connected PST tracker.Camera calibration information is checked during initialization. When calibration files for the connected tracker can not be found, a message with download links will be printed to the command line.
path | Path to the configuration directory to be used for storing camera calibrations, target database and configuration files.Use "" for default. (default: "%PROGRAMDATA%\PS-Tech\PST Iris") |
configFile | Name of the server configuration file.Use "" for default. (default: "server.cfg").> |
dbFile | Name of the tracking target database file.Use "" for default. (default: "models.db"). |
TrackerException | General Tracker error. |
NotInitializedException | Tracker was not initialized correctly. |
|
inline |
Construct Tracker object using a config path, config file name, models database path and grabber file name and initialize connected PST tracker.Camera calibration information is checked during initialization. When calibration files for the connected tracker can not be found, a message with download links will be printed to the command line.
path | Path to the configuration directory to be used for storing camera calibrations, target database and configuration files.Use "" for default. (default: "%PROGRAMDATA%\PS-Tech\PST Iris") |
configFile | Name of the server configuration file.Use "" for default. (default: "server.cfg").> |
dbFile | Name of the tracking target database file.Use "" for default. (default: "models.db"). |
grabberName | Name of the grabber plugin to be used.Can contain absolute or relative path to xml config file.Set to "default" to use auto-detect. (default: "default") |
TrackerException | General Tracker error. |
NotInitializedException | Tracker was not initialized correctly. |
|
inline |
Register a callback function to receive tracking information from the connected PST Tracker.
onTrackerDataCallback | A function whose signature matches the PSTech.pstsdk.Tracker.OnTrackerDataCallback() delegate and should be called when the Tracker has new data available. |
|
inline |
Switch off filtering of the tracking results using the double exponential-based prediction filter (DESP).
|
inline |
Disable transferring grayscale image data from the PST Tracker. When using a standard PST Iris or PST Base tracker, the frame rate of the tracker will be restored to the frame rate that was set before enabling image transfer.
|
inlinestatic |
Disable the REST server communication layer. If a REST server is running, the connections will be closed and the REST server will be destroyed. If no REST server is running a call to DisableRestServer() does nothing.
|
inlinestatic |
Disable the shared memory-based communication layer. The PST-Client application will no longer be able to connect to the PST Tracker.
|
inline |
Disables the tremor filter. The tremor filter will no longer be used to filter the estimated target pose.
|
inline |
This function should always be called before terminating an application using the PST Tracker. See the "Safe tracker termination" section for more information.
|
inline |
Switch on filtering of the tracker results using a double exponential-based prediction filter(DESP). This will result in smoother tracking with less noise.It can have a small impact on tracker accuracy.
|
inline |
Enable transferring grayscale image data from the PST Tracker. After enabling image transfer, call GetImage() in order to receive the captured images. When no calls are made to GetImage() for more than 4 seconds, image transfer will be automatically disabled. Note that for the standard PST Iris and standard PST Base trackers, enabling image transfer will result in a reduced framerate of 30 fps. The frame rate will be restored to the original setting after image transfer is disabled.
|
inlinestatic |
Provides information about the status of the tracker plug-in. Information is written to the standard error stream. Useful when debugging.
|
inlinestatic |
Enable a REST Server that uses the HTTP protocol to enable access to the PST Tracker over a local area network. Parameters from the tracker can be accessed using GET requests. Tracking results and image can be streamed using an Event-stream based communication pipeline. The state of the tracker and parameters can be set through POST calls. If a REST server is aleady running, calling EnableRestServer() will terminate the current server and restart it with the new parameters. More information on how to use the REST server can be found in the REST documentation.
serverAddress | The IP address on which the REST server should be accessible. |
serverPort | The port number on which the REST server should be accessible. |
eventStreamRetryTimeout | Timeout in milliseconds before an eventstream attempt to reconnect to the server automatically. |
HttpException | The REST server failed to initialize properly. A possible cause could be an invalid IP address or port number. |
NotInitializedException | A Tracker object must have been initialized before enabling the REST server. |
|
inlinestatic |
Enable a shared memory-based communication layer. Enabling shared memory will allow the PST-Client application to connect to the SDK. This will allow receiving tracking data and setting parameters using the PST-Client application. Note that a PST-Client that is connected in this way will not be updated when settings are changed through the SDK. This could cause instabilities in the PST software.It is recommended to only use this function when setting up a PST Tracker (e.g.adding tracking targets or retrieving calibration data). When using a tracker in normal operation, it is recommended to choose to use either the PST-Client application or the SDK and not mix usage.
NotInitializedException | A Tracker object must have been initialized before enabling shared memory. |
|
inline |
Enables the tremor filter. This filter greatly reduces the noise levels of the estimated target pose. However, using the filter introduces latency to the tracking results received and lowers tracking accuracy.This filter is mainly useful when using the PST Tracker in an interaction-type setting. When the PST Tracker is used for measurement purposes, enabling the tremor filter is not recommended.
|
inline |
Retrieves the full path to the configuration directory currently being used by the PST Tracker. The default path is "%PROGRAMDATA%\PS-Tech\PST Iris". The configuration directory contains the target model database, server configuration, reference file and tracker calibration information.
OutOfMemoryException | Failed to allocate memory. |
|
inline |
Get the current exposure time as set on the PST Tracker.
|
inline |
Get the minimum and maximum exposure value that can be set with the current frame rate. The maximum exposure value differs for different frame rates and PST Trackers. In general, lower frame rates allow for higher exposures and higher frame rates have a lower maximum exposure value. After changing the frame rate it is advised to check the currently allowed range before changing exposure values.
min | The minimum exposure value that can be set. |
max | The maximum exposure value that can be set. |
|
inline |
Get the current frame rate as set on the PST Tracker.
|
inline |
Retrieve images from the PST Tracker when image transfer has been enabled. When image transfer has not been enabled by calling EnableImageTransfer() before calling this method, Image.image will be an empty vector. Note that image transfer will be automatically disabled when no call to this method is made for 4 seconds.
OutOfMemoryException | Failed to allocate memory. |
ImageRetrievalException | Image retrieval failed. |
|
inline |
Tracking results are reported relative to a predefined right-handed Cartesian coordinate system, called the reference system. The default reference system is located at 1 meter from the PST Tracker.It is oriented such that the Z-axis points away from the PST tracker and the X-axis is parallel to the PST tracker.The transformation matrix defining the reference system is a row-major 4x4 homogeneous transformation matrix.
|
inlinestatic |
Retrieves the SDK version information as a string. The SDK version can differ from the internal tracker version which can be retrieved using GetVersionInfo.
|
inline |
Get a vector containing all frame rates that are available for the currently connected PST Tracker. The range of available frame rates differs for different types of PST Trackers. When using SetFramerate() to set a new frame rate, the frame rate of the PST Tracker will be set to the value provided by this function nearest to the value supplied to SetFramerate().
OutOfMemoryException | Failed to allocate memory. |
|
inline |
Retrieves the name, uuid and id for the requested tracking target.
targetName | The name of the tracking target. |
NotFoundException | The requested data could not be found. |
|
inline |
Retrieves the list of all tracking targets defined in the tracking target database and returns them as a array of TargetStatus objects.
OutOfMemoryException | Failed to allocate memory. |
|
inline |
Gets a list of the 3D positions of the markers making up the specified tracking Target. The returned positions are relative to the tracking Target origin.
targetName | Name of the tracking Target to get the marker positions of. |
OutOfMemoryException | Failed to allocate memory. |
NotFoundException | The requested data could not be found. |
|
inline |
Retrieves the status of a single tracking Target. Tracking targets can be either active (true) or inactive (false).
targetName | The name of the tracking Target to get the status of. |
NotFoundException | The requested data could not be found. |
|
inline |
Check for calibration information of the cameras of the connected PST Tracker. When not all calibration information can be retrieved, download urls for the uncalibrated cameras will be returned. Furthermore, a message will be shown at the command line specifying which files are missing and where they can be downloaded.
silent | Set to true in order to disable printing of missing calibration information. (default: false) |
OutOfMemoryException | Failed to allocate memory. |
|
inline |
Retrieves version information of the PST Server used by the SDK.
OutOfMemoryException | Failed to allocate memory. |
delegate void PSTech.Pstsdk.Tracker.OnTrackerDataCallback | ( | TrackerData | trackerData, |
ErrorStatus | errorStatus | ||
) |
A delegate defining the signature of the callback function used to receive tracking data from the Tracker object when it becomes available. By defining a callback function with this signature and adding it to the Tracker object using PSTech.pstsdk.Tracker.AddListener(), tacking data can be received and processed.
trackerData | Tracking information retrieved from tracker. |
errorStatus | Return OK on success or ErrorStatus. |
|
inline |
Pause the tracking system, stop producing tracking results and enter low-power mode. Tracking can be resumed with a subsequent call to StartTracker().
|
inline |
Remove a callback function receiving tracking information from the connected PST Tracker.
onTrackerDataCallback | A function whose signature matches the PSTech.pstsdk.Tracker.OnTrackerDataCallback() delegate and should be called when the Tracker has new data available. |
|
inline |
Resets the currently set reference system to the default reference system. The default system is defined by a 4x4 identity matrix. This places the origin of the reference system 1 meter away from the PST Tracker.It is oriented such that the Z-axis points away from the PST tracker and the X-axis is parallel to the PST tracker.
|
inline |
/// Set the PST Tracker exposure time to the supplied time.This adjusts both the shutter speed of the PST Tracker and the time the IR illumination panel will be turned on.
exposure | Exposure time in seconds. |
OutOfRangeException | The supplied value is outside of the accepted range. |
NotSupportedException | Exposure could not be set on the Tracker. |
|
inline |
Set the PST Tracker frame rate to the value available for the connected PST Tracker nearest to the supplied value.
fps | The new frame rate to be set. |
NotSupportedException | Framerate could not be set on the Tracker. |
|
inline |
Set the strength of the double exponential-based prediction filter (DESP) that filters the estimated positions of the tracked tracking targets. The supplied filtering value should be between 0 (no filtering) and 0.99 (maximum filtering).
value | Filtering strength to be used in range [0, 0.99]. |
|
inline |
Set the strength of the double exponential-based prediction filter (DESP) that filters the estimated positions of the tracked tracking targets. The supplied filtering value should be between 0 (no filtering) and 0.99 (maximum filtering).
value | Filtering strength to be used in range [0, 0.99]. |
|
inline |
The reference system is defined by a homogeneous transformation matrix (a row-major 4x4 matrix) representing a right-handed Cartesian coordinate system.The function checks if a valid, orthogonal transformation matrix has been supplied. When an invalid matrix has been supplied, it will not be applied.To check if the function was successful, please use GetReference() and compare the result.As an optional parameter, the reference system can be set relative to the current reference system. When this option is used, the current reference system is transformed using the supplied transformation matrix. Otherwise, the current reference system is replaced by the supplied reference system.
creference | The transformation matrix for the new reference system. |
relative | When set to true, the current transformation matrix is transformed using the supplied transformation matrix. |
|
inline |
This function changes the id of the tracking target. This id is mainly used when connecting to the PST Tracker through VRPN.
targetName | The name of the tracking target to change the id of. |
id | The new id of the tracking target. |
NotFoundException | The requested data could not be found. |
|
inline |
Sets the status of a single tracking Target to active (true) or inactive (false).
targetName | The name of the tracking Target to set the status of. |
active | New status of the tracking Target. |
NotFoundException | The requested data could not be found. |
|
inlinestatic |
|
inline |
Start the tracking system and produce tracking results.
|
inline |
Perform a system check, checking if the PST Tracker has been initialized correctly and if the system is running properly. In order to get continuous feedback on the status of the PST Tracker it is recommended to implement regular polling of this function. This way, issues that will not cause the software to crash (e.g. a camera disconnect) can be handled.