# MultiDeviceCalibrationResult

The `MultiDeviceCalibrationResult` message is the single output of a
[MultiDeviceCalibration](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/multi_device_calibration.md)
run. It is pure data: the node never applies it to a device or a pipeline. You decide whether to store it, seed the next run with
it or hand it to `Pipeline.setMultiDeviceCalibration()`.

| Field | Meaning |
| --- | --- |
| `passed` (`bool`) | `True` when the solver succeeded and returned a pose for every registered device. |
| `graph` (`list[MultiDeviceExtrinsics]` or `None`) | One edge per non-reference device, from that device's local origin to the
origin of the reference device, with translations in meters. Present only when `passed` is `True`. |
| `dataConfidence` (`float`) | Quality score of the collected samples between 0.0 and 1.0. Stays 0.0 when the solver was not
reached. |
| `sampsonError` (`float`) | Sampson error of the estimated calibration over the samples, lower is better. Stays 0.0 when the
solver was not reached. |
| `info` (`str`) | Why the run did not pass. Empty on success. |
| `getHandler()` (`MultiDeviceCalibrationHandler` or `None`) | The graph wrapped in a handler for saving (`toJsonFile()`),
querying and seeding the next run. |

```python
result = resultQueue.get(timedelta(minutes=3))
if result is not None and result.passed:
    result.getHandler().toJsonFile("multi_device_calibration.json")
    for edge in result.graph:
        print(edge.fromDeviceId, "->", edge.extrinsics.toDeviceId, edge.extrinsics.translation)
```

> **Beta API**
> Part of the [Beta](https://docs.luxonis.com/software-v3/depthai/examples/beta-features.md) multi-device calibration API added in DepthAI v3.11.0.

## Examples of functionality

 * [Multi-device calibration
   example](https://github.com/luxonis/depthai-core/blob/main/examples/python/MultiDeviceCalibration/multi_device_calibration.py)
 * [Calibration with constraints
   example](https://github.com/luxonis/depthai-core/blob/main/examples/python/MultiDeviceCalibration/multi_device_calibration_constraints.py)

## Reference

### dai::beta::MultiDeviceCalibrationResult

Kind: struct

Final result of running multi-device calibration.

Includes: the estimated cross-device calibration graph (only when the run passed); metrics evaluating the reliability of the
estimate and the quality of the data used to compute it; a human-readable description of why a run did not pass The calibration
graph is a snapshot and is never applied to a device or pipeline by the node. Use getHandler() to resolve it or store it on a
pipeline with Pipeline::setMultiDeviceCalibration .

#### std::optional< std::vector< MultiDeviceExtrinsics > > graph

Kind: variable

Validated, meter-normalized cross-device calibration edges.

One edge per non-reference device, mapping that device's local origin to the local origin of the reference device. Present only
when passed is true.

#### bool passed

Kind: variable

True if the calibration completed and graph holds a pose for every registered device.

False when data collection or the solver failed; info explains why.

#### double dataConfidence

Kind: variable

Quality score of the input data.

A normalized value between 0.0 and 1.0 indicating how much you can trust the collected samples. Remains 0.0 when the solver was
not reached.

#### double sampsonError

Kind: variable

Sampson error of the estimated calibration over the collected samples.

Lower is better. Remains 0.0 when the solver was not reached.

#### std::string info

Kind: variable

Human-readable result description.

Explains why passed is false; empty when the calibration passed.

#### MultiDeviceCalibrationResult()

Kind: function

#### MultiDeviceCalibrationResult(std::string information)

Kind: function

#### ~MultiDeviceCalibrationResult()

Kind: function

#### std::optional< MultiDeviceCalibrationHandler > getHandler()

Kind: function

Build a MultiDeviceCalibrationHandler from the calibration graph. return: The handler when the result carries a graph, or
std::nullopt when it does not.

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

#### DEPTHAI_SERIALIZE(MultiDeviceCalibrationResult, graph, passed, dataConfidence, sampsonError, info)

Kind: function

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
