OptiTrack Peripheral API
The OptiTrack Peripheral API is an open C++ API that can be used to create 'plugin' devices. Custom built plugin DLL's will allow you to initialize and synchronize external devices with the OptiTrack motion capture system in Motive. After building a custom plugin device using the API, the library must be placed in the \device
folder within the Motive install directory in order to initialize and integrate desired peripheral devices. For integrating AMTI and Bertec force plates and NI-DAQ devices, the existing BiomechDevicePlugin.dll that installs with the peripheral module can be utilized.Note: The OptiTrack Peripheral API is available in Motive versions 1.10 and above.The following features are supported by the Peripheral API:
Real-time synchronized data collection from peripheral hardware device and the OptiTrack motion capture system into Motive Take (TAK) files and the open standard C3D file format.
Motive UI access to device properties and event settings under the Devices pane, allowing the users to configure the device in Motive.
Real-time display of live device data in Motive's scope view in the Graph View pane.
Captured data review in Motive's 2D Graphing windows in the Graph View pane.
Contents
The Peripheral API folder is installed with the Motive software. It can be found in the Motive install directory, which is located in C:\Program Files\OptiTrack\Motive\PeripheralAPI
by default.
Folder | Contents |
---|---|
\example | Visual Studio Example Device project and source code showing Peripheral API usage. |
\include | API headers (include in your project) |
\lib | Peripheral API / Motive import library (link to your project) |
ClassDiagram | Class relationship diagram of Plugin Devices to Motive Plugin Library. |
Readme.txt | Peripheral API release notes. |
Requirements
The following components are required for using the OptiTrack Peripheral API.
Microsoft Windows 10 or higher.
Microsoft Visual Studio 2019 or higher.
If you plan to use a newer version of Microsoft Visual Studio, you may need to download Windows SDK 8.1 and the VC++ 2015.3v140 toolset (x86,x64).
Peripheral API Setup
Retarget Solution
Downloads/Installs
You can download the Windows SDK 8.1 from this link.
![](https://docs.optitrack.com/~gitbook/image?url=https%3A%2F%2F4243847686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FTSFWA3dBvgCMGQlNWsHE%252Fuploads%252FURByOODWGrMPh2iXcB9k%252Fimage.png%3Falt%3Dmedia%26token%3D6309f1c9-f642-4fed-ae1e-aaa8a4e0021d&width=768&dpr=4&quality=100&sign=2668c477&sv=1)
To download the v140 Toolset, you can modify your existing install of VS, or upon first downloading add the toolset from the Individual Components tab.
![](https://docs.optitrack.com/~gitbook/image?url=https%3A%2F%2F4243847686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FTSFWA3dBvgCMGQlNWsHE%252Fuploads%252FdZcZ0MHw6yhQSsVBboBl%252Fimage.png%3Falt%3Dmedia%26token%3D3a4803e5-0c95-47e2-b98b-f06036967e8d&width=768&dpr=4&quality=100&sign=1add76fd&sv=1)
Once you have the Windows SDK 8.1 and v140 Toolset downloaded, you'll need to retarget the OptiTrackPeripheralExample solution.
![](https://docs.optitrack.com/~gitbook/image?url=https%3A%2F%2F4243847686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FTSFWA3dBvgCMGQlNWsHE%252Fuploads%252FbYSWqytzN3iZEb5FAKIJ%252Fimage.png%3Falt%3Dmedia%26token%3D0a613382-26f5-46d7-b057-0fb571f687e6&width=768&dpr=4&quality=100&sign=262652e7&sv=1)
Retargeting Steps
In Visual Studio, right click Solution 'OptiTrackPeripheralExample', or whatever you named the copy as.
Select 'Retarget Solution'
For the Windows SDK Version dropdown, select 8.1.
For the Platform Toolset dropdown, select v140 or No Upgrade (if VS has already loaded v140 as the default).
Click OK
This should now be ready to build without errors.
Usage
The following guideline can be used to create and apply custom device plugin DLLs in Motive:
Copy the OptiTrackPeripheralExample project and modify the code in the lines where indicated in the sample.Edit the 'REQUIRED' and 'OPTIONAL' sections. Changes made in the .cpp files are reflected in the Devices and Properties panes.
Build the sample, which produces a plugin DLL. Copy this DLL to the
<Motive install folder>\devices
subfolder.If your plugin has external dependencies (e.g. driver / SDK dlls), make sure these are on your system path, or in the Motive install directory.
Launch Motive. Your device should appear in the Devices pane in Motive. If it does not, check the Motive Log pane for error notifications.
When a peripheral device is detected in Motive, real-time collected data can be monitored from the real-time plotting of the Graph View pane in the Live mode.
Class Diagram
![](https://docs.optitrack.com/~gitbook/image?url=https%3A%2F%2F4243847686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FTSFWA3dBvgCMGQlNWsHE%252Fuploads%252FZVjvIcOp8WUjfno3gjGn%252Fimage.png%3Falt%3Dmedia%26token%3De4ed3697-2d34-4b28-b679-909145106947&width=768&dpr=4&quality=100&sign=83b4d37a&sv=1)
Last updated