# Data Export: CSV

## CSV Export

Captured tracking data can be exported in Comma Separated Values (CSV) format. This file format uses comma delimiters to separate multiple values in each row, which can be imported by spreadsheet software or a programming script. Depending on which data export options are enabled, exported CSV files can contain marker data, and data for Rigid Bodies, Trained Markersets, and/or Skeletons. Data for force plate,  NI-DAQs, and other devices will export to separate files if these devices are included in the *Take*.&#x20;

CSV export options are listed in the following charts:

General Export Options

<table><thead><tr><th width="177" align="center">Option</th><th>Description</th></tr></thead><tbody><tr><td align="center">Frame Rate</td><td>Number of samples included per second of exported data.</td></tr><tr><td align="center">Start Frame</td><td><p>Start frame of the exported data. Set to one of the following: </p><ul><li>The recorded first frame of the exported <em>Take</em> (the default option).</li><li>The start of the working range (or scope range) as configured under the <a href="../../motive-ui-panes/control-deck">Control Deck</a> in the <a href="../../motive-ui-panes/graph-view-pane">Graph</a> <a href="../../motive-ui-panes/graph-view-pane">View pane</a>.</li><li><em>Custom</em> to enter a specific frame number.</li></ul></td></tr><tr><td align="center">End Frame</td><td><p>End frame of the exported data. Set to one of the following: </p><ul><li>The recorded end frame of the exported <em>Take</em> (the default option).</li><li>The end of the working range (or scope range) as configured under the <a href="../../motive-ui-panes/control-deck">Control Deck</a> in the <a href="../../motive-ui-panes/graph-view-pane">Graph</a> <a href="../../motive-ui-panes/graph-view-pane">View pane</a>.</li><li><em>Custom</em> to enter a specific frame number. </li></ul></td></tr><tr><td align="center">Scale</td><td>Apply scaling to the exported tracking data.</td></tr><tr><td align="center">Units</td><td>Set the measurement units to use for exported data.</td></tr><tr><td align="center">Axis Convention</td><td>Sets the axis convention on exported data. This can be set to a custom convention or select preset conventions for Entertainment or Measurement. </td></tr><tr><td align="center">X Axis<br>Y Axis<br>Z Axis</td><td>Allows customization of the axis convention in the exported file by determining which positional data to be included in the corresponding data set.</td></tr></tbody></table>

CSV Export Options

<table><thead><tr><th width="177">CSV Options</th><th>Data Included When Enabled</th></tr></thead><tbody><tr><td>Header information</td><td>Detailed information about capture data is included as a header in exported CSV files. See <a href="#csv-header">CSV Header</a> for specifics. </td></tr><tr><td>Markers</td><td>X/Y/Z reconstructed 3D positions for each marker in exported CSV files.</td></tr><tr><td>Unlabeled Markers</td><td>Includes tracking data of all of the <em>unlabeled</em> makers to the exported CSV file along with other labeled markers. To view only the <em>labeled</em> marker data, turn off this export setting.</td></tr><tr><td>Rigid Body Bones</td><td>The exported CSV file will contain 6 Degrees of Freedom (6 DoF) data for each rigid body from the Take. This includes orientations (pitch, roll, and yaw) in the chosen <strong>rotation type</strong> as well as 3D positions (x,y,z) of the rigid body center.</td></tr><tr><td>Rigid Body Constraints</td><td>3D position data for the location of each Marker Constraint of rigid body assets. This is distinct from the actual marker location. Compared to the positions of the raw marker positions included within the <em>Markers</em> columns, the Rigid Body Constraints show the <em>solved</em> positions of the markers as affected by the rigid body tracking but not affected by occlusions.</td></tr><tr><td>Skeleton and Markerset Bones</td><td>The exported CSV files will include 6 DoF data for each bone segment of skeletons and trained markersets in exported Takes. 6 DoF data contain orientations (pitch, roll, and yaw) in the chosen rotation type, and also 3D positions (x,y,z) for the center of the bone. All skeleton and markerset assets must be solved to export this data.</td></tr><tr><td>Bone Constraints</td><td>3D position data for the location of each Marker Constraint of bone segments in skeleton and trained markerset assets. Compared to the real marker positions included within the <em>Markers</em> columns, the Bone Markers show the <em>solved</em> positions of the markers as affected by the skeleton tracking but not affected by occlusions.</td></tr><tr><td>Exclude Fingers</td><td>Exported skeletons will not include the fingers, if they are tracked in the <em>Take</em> file. </td></tr><tr><td>Asset Hip Name</td><td>When selected, the hip bone data is labeled as Asset_Name:Asset_Name (e.g., Skeleton:Skeleton). When unselected, the exported data will use the classic Motive naming convention of Asset_Name:Hip (e.g., Skeleton:Hip). </td></tr><tr><td>Rotation Type</td><td>Rotation type determines whether <strong>Quaternion</strong> or <strong>Euler</strong> Angles are used for orientation convention in exported CSV files. For Euler rotation, right-handed coordinate system is used and all different orders (XYZ, XZY, YXZ, YZX, ZXY, ZYX) of elemental rotation are available. More specifically, the XYZ order indicates pitch is degree about the X axis, yaw is degree about the Y axis, and roll is degree about the Z axis.</td></tr><tr><td><p>Use <a href="#world-coordinates">World </a></p><p><a href="#world-coordinates">Coordinates</a></p></td><td>This option determines whether exported data will be based on world (global) or local coordinate systems.</td></tr><tr><td>Device Data</td><td>Exports separate CSV files for recorded device data. This includes force plate data and analog data from NI-DAQ devices. A CSV file is exported for each device included in the <em>Take</em>.</td></tr></tbody></table>

![Tracking data export dialogue window in Motive. CSV export is selected and corresponding options are displayed.](https://content.gitbook.com/content/uHClgoIWDmmoXSr2eD9q/blobs/en3k7mcqOq2URz7h4qqb/image.png)

### Coordinate Systems

Coordinates for exported data are either global to the volume or local to the asset.&#x20;

#### **Global or World Coordinates**

Defines the position and orientation in respect to the global coordinate system of the calibrated capture volume. The global coordinate system is the origin of the ground plane, set with a calibration square during the [Calibration](https://docs.optitrack.com/v3.1/motive/calibration) process.

#### **Local Coordinates**

Defines the bone position and orientation in respect to the coordinate system of the parent bone.&#x20;

Local coordinate axes can be set to visible from [Application Settings](https://docs.optitrack.com/v3.1/motive-ui-panes/settings) or in the [skeleton properties](https://docs.optitrack.com/v3.1/motive-ui-panes/properties-pane/properties-pane-skeleton). The Bone rotation values in the Local coordinate space can be used to roughly represent the joint angles, however, for precise analysis, joint angles should be computed through a biomechanical analysis software using the exported capture data (C3D).

{% hint style="info" %}
In a skeleton, the hip is always the top-most parent of the segment hierarchy.&#x20;
{% endhint %}

### Physical Markers vs Marker Constraints During Occlusion

Rigid Body markers, trained markerset markers and Skeleton bone markers are referred to as[ Marker ](https://docs.optitrack.com/v3.1/data-recording#marker-constraints-rigid-body-markers-and-bone-markers)\
[Constraints](https://docs.optitrack.com/v3.1/data-recording#marker-constraints-rigid-body-markers-and-bone-markers). They appear as transparent spheres within a Rigid Body, or a Skeleton, and each sphere reflect the position that a Rigid Body, or a Skeleton, expects to find a 3D marker. When the asset definitions are created, it is assumed that the markers are in fixed positions relative to one another and that these relative positions do not shift over the course of capture.

In the CSV file, Rigid Body markers have a physical marker column and a Marker Constraints column.&#x20;

When a marker is occluded in Motive, the Marker Constraints will display the solved position for where the marker should be in the CSV file. The actual physical marker will display a blank cell or null value since Motive cannot account for its actual location due to its occlusion.

<figure><img src="https://2867085706-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuHClgoIWDmmoXSr2eD9q%2Fuploads%2FEyC8eLGeDIwHhZVGNko7%2FData%20Export%20-%20CSV%20Occluded%20marker%20MARKUP.png?alt=media&#x26;token=5d9f2b17-56ac-4e68-8107-7bbe39e1cf3a" alt=""><figcaption><p>How Rigid Body Markers and Markers appear in a CSV file.</p></figcaption></figure>

### CSV Header

When the header is disabled, this information is excluded from the CSV files. Instead, the file will have frame IDs in the first column, time data on the second column, and the corresponding mocap data in the remaining columns.

CSV Headers

<table><thead><tr><th width="137" align="center">Row</th><th>What Information is Displayed</th></tr></thead><tbody><tr><td align="center">1st row</td><td>General information about the Take and export settings:  Format version of the CSV export, name of the TAK file, the captured frame rate, the export frame rate, capture start time, capture start frame, number of total frames, total exported frames, rotation type, length units, and coordinate space type.</td></tr><tr><td align="center">2nd row</td><td>Empty</td></tr><tr><td align="center">3rd row</td><td>Displays which data type is listed in each corresponding column. Data types include raw marker, Rigid Body, Rigid Body marker, bone, bone marker, or unlabeled marker. Read more about <a href="../../data-recording#marker-types-in-motive">Marker Types</a>.</td></tr><tr><td align="center">4th row</td><td>Includes marker or asset labels for each corresponding data set.</td></tr><tr><td align="center">5th row</td><td>Displays marker or asset ID.</td></tr><tr><td align="center">6th and 7th rows</td><td>Shows which data is included in the column: rotation or position and orientation on X/Y/Z.</td></tr></tbody></table>

![](https://content.gitbook.com/content/uHClgoIWDmmoXSr2eD9q/blobs/3AlJgAjUnAPgSSwyLCOW/image.png)

{% hint style="info" %}
**TIP: Occlusion in the marker data**

When there is an occlusion of a marker, the CSV file will contain blank cells, which can interfere when running a script to process the CSV data.&#x20;

We recommend optimizing the system setup to reduce occlusions. To omit unnecessary frame ranges with frequent marker occlusions, select the frame range with the most complete tracking results.&#x20;

Another solution is to use [Fill Gaps](https://docs.optitrack.com/v3.1/motive/data-editing) to interpolate missing trajectories in post-processing.
{% endhint %}

### Force Plate Data / Analog Data

For *Takes* containing force plates ([AMTI](https://docs.optitrack.com/v3.1/movement-sciences/movement-sciences-hardware/amti-force-plate-setup) or [Bertec](https://docs.optitrack.com/v3.1/movement-sciences/movement-sciences-hardware/bertec-force-plate-setup)) or data acquisition ([NI-DAQ](https://docs.optitrack.com/v3.1/movement-sciences/movement-sciences-hardware/ni-daq-setup)) devices, additional CSV files are exported for each connected device. For example, if you have two force plates and a NI-DAQ device in the setup, a total 4 CSV files will be created when you export the tracking data from Motive. Each of the exported CSV files will contain basic properties and settings at its header, including device information and sample counts. Also, mocap frame rate to device sampling rate ratio is included since force plate and analog data are sampled at higher sampling rates.

{% hint style="info" %}
Since device data is usually sampled at a higher rate than the camera system, the camera samples are collected at the center of the corresponding device data samples that were collected. For example, if the device data has 9 sub-frames for each camera frame sample, the camera tracking data will be recorded at every 5th frame of device data.
{% endhint %}

* **Force Plate Data**: Each of the force plate CSV files will contain basic properties such as platform dimensions and mechanical-to-electrical center offset values. The mocap frame number, force plate sample number, forces (Fx/Fy/Fz), moments (Mx, My, Mz), and location of the center of pressure (Cx, Cy, Cz) will be listed below the header.
* **Analog Data**: Each of the analog data CSV files contains analog voltages from each configured channel.
