# Using the emulator

AR 51 Mocap Studio Emulator mode replays recorded GR51 motion files and streams them over the LAN as if a live mocap system were running — letting Unity, Unreal, and C++ SDK developers build and test against real skeleton and object-detection data with no cameras connected.

---

<YouTube id="lQWKELwYEV4" title="AR 51 Mocap Studio — Using the Emulator" />

## Introduction

This guide provides detailed instructions on how to use the AR 51 Mocap Studio as an Emulator.

In this mode of operations, Mocap Studio mimics the behaviour of a live system.

This makes it perfect for development teams to develop applications that interact with the AR 51 SDK.

The guide covers starting mocap studio, activating OMS and CVS, and loading animation files.

:::warning
## Prerequisites

* Make sure Mocap Studio is installed on a computer.

* Make sure you have a GR51 motion file available <a href="/downloads/running_take001_2023-10-19_17-16-32_2023-10-19_17-16-47.gr51" download>running.gr51</a>, <a href="/downloads/Bclapping003_2023-10-19_13-56-23_2023-10-19_13-56-32.gr51" download>clapping.gr51</a>.

* Ensure that the client computer is connected to the same network as the Mocap Studio.

When mocap studio is *not* in the same local network it will fail to communicate with AR 51's mocap server.

:::

## Starting the Mocap Studio Emulator

### Launch Mocap Studio:

1. Open the Mocap Studio application.

2. Put the application in full-screen mode for better visibility.

### Locate Indicators

On the top right corner, you will see two indicators: 

1. *OMS (Operating Management System)*: Detects components within the local network.

2. *CVS (Computer Vision Service)*: Streams skeleton information and object detection.

![Using the emulator — No connectivity](./img/mocap_studio_emulator/1.no_connectivity.png)

### Ensure OMS is Active

* If the OMS indicator is green, it means OMS is already active

* If it is gray, double-click the icon. A prompt will notify you to start a new OMS. Select "Yes" to activate it.

![Using the emulator — Are you sure oms](./img/mocap_studio_emulator/3.are_you_sure_oms.png)

:::warning
### Ensure the CVS is Active

1. Make sure that the CVS indicator is gray <br/>

![Using the emulator — Connectivity connected](./img/mocap_studio_emulator/2.connectivity_connected.png)

2. Double-click the CVS icon.

3. Confirm by clicking "OK" to start a new CVS instance.

If the indicator is already green, this means that another computer is currently the active CVS. You should find the second CVS and close it before activating a new CVS.

:::

### Loading a pre-recorded animation 

Open a new Mocap Studio and Load a File:

1. Click the file import button.  <br/>

![Using the emulator — File import](./img/mocap_studio_emulator/4.file_import.png)

2. The system should open a new window.

3. Locate your pre-recorded file (*.gr51) and load it.  <br/>

![Using the emulator — Choose file windows](./img/mocap_studio_emulator/5.choose_file_windows.png)

4. You should see a progress bar for the loading process

5. Once loaded you should see an animation playing inside Mocap Studio

## Emulator is Active

### Check Status on A Second Client 

<YouTube id="NX4U1L26ls4" title="AR 51 Mocap Studio — Emulator Broadcasting to a Client" />

* At this point "Mocap Studio" is acting as a system emulator. 

* At this mode, it is streaming mocap recordings to all other client that are connected to the same local network.

* To view the mocap broadcast, you can use another client.

* The client can be the same machine or a different one.

* Here is a partial list of supported clients:

  1. Another Mocap Studio

  2. Unity3D Editor with AR 51 SDK. 

  3. A compiled program that was created with Unity and AR 51 SDK (i.e. oculus quest sdk)

  4. Unreal Engine with AR 51 SDK.

  5. A C++ client that is running AR 51 SDK.

![Using the emulator — Mocap studio side by side](./img/mocap_studio_emulator/6.mocap_studio_side_by_side.png)

## Controlling the Emulator

### Changing the content that is being broadcast

You can choose a different pre-recorded animation to change the content.

Note, any change in the emulator's content is propagated to all other clients in the network.

### Scrub Through the Animation

Use the time slider to navigate through the recorded animation.

### Recording Panel, Playback and Export

1. You can use Mocap Studio Record function to record a subset of original animation file.  <br/>

<video aria-label="Using the emulator — Mocap resize" autoPlay loop muted playsInline>
  <source src={require('./img/mocap_studio_emulator/7.mocap_resize.mp4').default} type="video/mp4" />
</video>

2. After you recorded the original gr51 again you should see a second animation on the animation panel

3. This new animation should have the export icon enabled (not grayed out).

4. You can press on the export icon to export the animation.


## Related pages

- [Unity SDK overview](/docs/unity-sdk/overview)
- [Unreal SDK overview](/docs/unreal-sdk/overview)
- [Exporting data](/docs/mocap-studio/exporting-data)
