# Robot - Sensor Sync

To see correctly synchronised 3D data from moving sensor user needs to setup synchronisation.

## Prerequisites

Pose synchronisation is currently supported only in setups where the robot controller (RoboKit) and sensor controller (SenseKit) are running on the same embedded computer.

## Overview

To setup pose synchronisation user needs to:

1. Enable pose synchronisation using SenseKit firmware settings in AMAS.
2. Perform eye-in-hand calibration (with pose) in AMAS.

The first step adds pose retrieved from the robot to the 3D data sent to AMAS. For example, we want the pose of the end-effector for the sensor mounted on the end-effector joint.

The second step enables the rendering of the 3D data with respect to the pose and calibrates the sensor position with respect to where it is mounted.

## Details

### Enabling pose sync in SenseKit firmware settings

In a typical scenario, the sensor is mounted on the last robot's joint with the end-effector.

We want the pose of this joint with respect to the robot base to be sent with the 3D data.

Setup the SenseKit firmware settings `Pose Sync Settings` as described in [sensekit-addition-and-configuration](https://extend-robotics.gitbook.io/user-guide/amas-vr-application/manage-multiple-devices/sensekit-addition-and-configuration "mention") with:

* `Reference Frame` set to your robot base (typically `link_base`)
* `Relative Frame` set to joint where sensor is mounted on robot (typically `link5`, `link6` or `link7`)

{% hint style="info" %}
Example: for arm with 7 joints like xArm 7 and sensor mounted with end effector, reference frame `link_base` and relative frame `link7` should be setup.
{% endhint %}

{% hint style="info" %}
Reminder: reboot the SenseKit after changing firmware settings
{% endhint %}

### Performing eye-in-hand calibration (with pose)

In the previous step, we ensured that the pose of the robot joint that the camera is mounted on will be sent with 3D data. We still need to calibrate where the sensor is with respect to this joint.

Follow the [sensekit-to-robot-calibration](https://extend-robotics.gitbook.io/user-guide/amas-vr-application/manage-multiple-devices/the-configuration/sensekit-to-robot-calibration "mention")with:

* Calibration board at some fixed position near the robot arm
* Mount type `End Effector with Pose`&#x20;

Perform the calibration.

{% hint style="info" %}
At the beginning of calibration, it may be helpful to enable 2D video feed from the camera. To enable 2D video feed, see [sensekit-addition-and-configuration](https://extend-robotics.gitbook.io/user-guide/amas-vr-application/manage-multiple-devices/sensekit-addition-and-configuration "mention") Set the mode to `Point Cloud + Video`
{% endhint %}

{% hint style="info" %}
After taking 4 samples with the calibration board, initial calibration should be available and further calibration becomes simpler as 3D data will be aligned.
{% endhint %}
