Table of Contents
OptiTrack Point Cloud
Gives the position of markers tracked by the OptiTrack camera system.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Devices/Third-Party/NaturalPoint/OptiTrack')Description
The OptiTrack Point Cloud block uses the OptiTrack Motive API (formerly OptiTrack Tracking Tools) to read the 3-dimensional position of IR markers detected by the OptiTrack camera system.
Helpful Hints
If you are unable to start the Motive software after running a model with the this block, typeclear mex
in the MATLAB console to release the Motive software
and retry.
Installation Requirements
OptiTrack Motive Installation
In order to use the OptiTrack Point Cloud block on 64-bit platforms, the OptiTrack Motive version 1.10.0 Final x64 software or later must be installed (version 1.10.0, 2.0.1, 2.1.1, 2.1.2, 2.2.0 have been tested to work). In order to use the OptiTrack Point Cloud block on 32-bit platforms, the OptiTrack Motive version 1.9.0 Final x86 software to 1.10.0 Final x86 must be installed The software is not included with QUARC and may be provided with the camera system or downloaded from the OptiTrack website.
Make sure you install the recommended and supported version of Motive as other versions may not utilize the same axis conventions.
System Path Configuration
The OptiTrack directories must be added to the system Path
environment variable. For example, if
the Motive is installed under C:\Program Files\OptiTrack, the following paths should be added to the system's Path
environment variable: C:\Program Files\OptiTrack\Motive\lib,
and C:\Program Files\OptiTrack\Motive.
Note that the computer will have to be rebooted after adding the directories to the Path
environment variable before this block can be used.
System Environment Variable
The following environment variable must be created and set with the value as indicated:
Variable name | Variable value |
---|---|
QT_QPA_PLATFORM_PLUGIN_PATH | %NPTRACKINGTOOLS_LIB%\..\plugins\platforms\ |
Note that the computer will have to be rebooted after adding the environment variable before this block can be used.
QUARC Model URI Configuration
On some systems, it is possible that the OptiTrack Motive API may take longer to load and initialize. When this happens, it would trigger a timeout error message from Simulink. When using the shared memory (shmem) protocol for the model URI, it is recommended that a timeout option be specified in the MEX-file arguments (under Model Configuration Parameters) to increase the timeout threshold value (default value is 5 seconds) to avoid triggering the timeout error. The MEX-file arguments can be accessed through Simulation->Model Configuration Parameters->Code Generation->Interface. The following shows an example MEX-file arguments string setting the timeout threshold value to 10 seconds for the model URI: '-w -d %d -uri %u', 'shmem://%m:1?timeout=10'
Camera Set-Up and Calibration
The OptiTrack Motive software is used for calibrating the cameras, defining the workspace coordinate frame, and defining trackables. Once calibrated, a calibration file (.cal) must be saved to the computer and referenced in this block's parameters. Refer to the Motive user manual for instructions on setting up the camera system and calibrating the cameras.
Input Ports
This block has no input ports.
Output Ports
xyz
A vector containing 3*n
elements, where n
is the number of markers
specified in the block parameters. Each group of 3 elements represents the xyz coordinates
of a marker; e.g., the output vector [x_1, y_1, z_1, x_2, y_2, z_2]
contains the
xyz
coordinates (x_1, y_1, z_1)
and (x_2, y_2, z_2)
for markers 1
and 2, respectively. If a marker is not detected in the current frame its xyz marker position holds its
previous value.
num_markers
A scalar integer output indicating the number of markers currently detected.
is_tracking
A boolean vector indicating the detection status of each marker. The vector contains n
boolean elements, where n
is the number of markers specified in the block parameters.
If element i (i = 1, .., n)
is 0 (false) then marker i
is not detected in the
current frame and its xyz position is not guaranteed to be valid. If element i
is 1 (true)
then marker i
is detected in the current frame and its xyz position is valid.
Parameters and Dialog Box
Calibration file
The file path to the calibration file generated from the OptiTrack Motive software (see the Motive user manual for instructions on setting up the OptiTrack system and calibration). The browse button (...) can be used to navigate and select the calibration file.
Number of markers
The maximum number of markers to output from this block.
Sample time
The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.
A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered or Enabled Subsystem, or in a referenced model.
To use the fundamental sampling time of the model, set the sample time to qc_get_step_size, which is a QUARC function that returns the fundamental sampling time of the model.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
||
No |
No |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
No |
No |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
No |
No |
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.