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
\devicefolder 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.
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\PeripheralAPIby default.
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).
- 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.
- Once you have the Windows SDK 8.1 and v140 Toolset downloaded, you'll need to retarget the OptiTrackPeripheralExample solution.
- 1.In Visual Studio, right click Solution 'OptiTrackPeripheralExample', or whatever you named the copy as.
- 2.Select 'Retarget Solution'
- 3.For the Windows SDK Version dropdown, select 8.1.
- 4.For the Platform Toolset dropdown, select v140 or No Upgrade (if VS has already loaded v140 as the default).
- 5.Click OK
- 6.This should now be ready to build without errors.
The following guideline can be used to create and apply custom device plugin DLLs in Motive:
- 1.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.Edit the 'REQUIRED' and 'OPTIONAL' sections. Click image to enlarge.Changes made in the .cpp files are reflected in the Devices and Properties panes.
- 2.Build the sample, which produces a plugin DLL. Copy this DLL to the
<Motive install folder>\devicessubfolder.
- 3.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.
Click image to enlarge