> For the complete documentation index, see [llms.txt](https://docs.optitrack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.optitrack.com/v3.0/developer-tools/natnet-sdk/natnet-rebroadcastmotivedata-sample.md).

# NatNet: RebroadcastMotiveData Sample

Rebroadcast Motive Data sample. This is a sample NatNet application that receives tracking data from a NatNet Server (Motive) and redistributes it in other formats.

Currently, there are two supported protocols in this sample; Unity and LightCraft. The Unity protocol repackages mocap data into XML packets and delivers it to the unity game engine. The LightCraft protocol takes definitions for a single Rigid Body and sends them over a *serial port* in a format called the Spydercam protocol. The LightCraft protocol in addition to being a demonstration of serial port communication, it allows Motive and Previzion to be completely compatible, using Mocap data to track the Previzion camera.

**Unity Protocol**

Rebroadcasts data into a XML format compatible for unity.

**Previzion Protocol**

Rebroadcasts data via Spyder Cam protocol which

## Requirements

The following third-party library must be linked in order to build and run this sample application

* Asio library (<http://think-async.com/>) : Required for communicating tracking data through serial port communication.

## Build

* Download the asio C++ library.
* In the RebroadcastMotiveData VS project, link the downloaded library.
* Build the sample project.

## Running the Sample

You can run the app from the command line with appropriate input arguments. For example: `RebroadcastMotiveData.exe 127.0.0.1 127.0.0.1 unity` There are total four arguments that can be inputed when running the sample application.

* argument 1: IP address of the server, Motive, machine
* argument 2: When streaming to unity, input the IP address of the local machine. When streaming to the lightcraft protocol, input local serial port name (e.g. COM1)
* argument 3: Protocol type \[unity/lightcraft]
* argument 4 (optional): Input test, to run in the test mode.

![Rebroadcasting tracking data onto unity. Click image to enlarge.](https://2498944597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yEhrhQepNQfhsDzAh6n%2Fuploads%2Fgit-blob-74c5d0e32a458ad00031b542c1aa1894376932b5%2Fimage.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.optitrack.com/v3.0/developer-tools/natnet-sdk/natnet-rebroadcastmotivedata-sample.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
