OptiTrack MATLAB Plugin
An overview of the samples available in the OptiTrack MATLAB plugin.
Last updated
Was this helpful?
An overview of the samples available in the OptiTrack MATLAB plugin.
Last updated
Was this helpful?
OptiTrack provides a wrapper class (natnet.m) for using real-time streamed NatNet data in MATLAB applications. Using this class, you can easily connect/disconnect to the server, receive the tracking data, and parse each component.
The Matlab-NatNet wrapper class is a wrapper for the NatNet assembly and provides a simplified interface for managing the native members in MATLAB. The class definition and supporting code should be placed within the MATLAB PATH. The implementation automatically disposes running connections when ending a streaming session, along with basic object management. In order to use the Matlab wrapper class, the NatNetML assembly must be loaded into the MATLAB session. This is handled automatically and the first time the class is used the user is prompted to find the NatNetML.dll file in the Windows file browser. A reference to this location is used in future MATLAB sessions.
The MATLAB Plugin provides Samples of Code for MATLAB users to connect to Motive via NatNet streaming. It provides support for streaming in all assets by iteration. It additionally provides examples of listeners, graphing, and data via streaming ID.
The first time you run any of the samples the system will prompt for a DLL. This is the NatNetML.dll that comes packaged with the product.
Load the NatNetML.dll file into MATLAB when prompted, then press play.
The OptiTrack Sample for Rigid Body Graphing supports streaming in from a rigid body asset, and obtaining graphing data. This works to provide an example of how a user may use real time graphing from MATLAB in our software.
The OptiTrack Sample for all asset types polling supports streaming in from each given Asset including: rigid bodies, NIDAQ, trained markersets, skeleton data, marker data, force plate data, and camera data. This provides example code for drawing each type of data out of Motive.
The OptiTrack Sample for Rigid Body Marker data takes in a streaming ID of a Rigid Body in Motive, and then obtains all marker data from the rigid body. This will enable users to see how to poll individual marker data from an asset into MATLAB.
The OptiTrack Sample for Rigid Body Pose Data takes in a streaming ID, and then polls for associated Rigid Body data including its position and orientation within the software itself. This is the twin streaming ID example for MATLAB.