# support_plane_calibration

Python API: `depthai_nodes.message.support_plane_calibration`

Support plane calibration controls and results.

## Classes

| Name | Description |
| --- | --- |
| [`CalibrationOutcome`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-CalibrationOutcome) | How a calibration attempt ended. |
| [`SupportPlaneCalibrationControl`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl) | A control message for `SupportPlaneCalibrator` carrying one command. |
| [`SupportPlaneCalibrationResult`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationResult) | The end of a calibration attempt. |
| [`SupportPlaneVerificationResult`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult) | How a supplied plane fares against gravity and the current point cloud. |

### class `CalibrationOutcome`

```python
class CalibrationOutcome(str, Enum)
```

How a calibration attempt ended.

`SUCCEEDED` attempts found at least one candidate plane, `FAILED` attempts hit the attempt cap (`max_calibration_attempts` in the
calibrator's config) without one, and `CANCELLED` attempts were stopped.

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `CANCELLED` | `str` |  |
| `FAILED` | `str` |  |
| `SUCCEEDED` | `str` |  |

### class `SupportPlaneCalibrationControl`

```python
class SupportPlaneCalibrationControl(dai.Buffer)
```

A control message for `SupportPlaneCalibrator` carrying one command.

Create controls with
[start](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-start),
[stop](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-stop),
[reset](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-reset)
and
[verify](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-verify).
Like DepthAI's `DynamicCalibrationControl`, each control carries one command.

Args

| Name | Description |
| --- | --- |
| `command` | One of the [Commands](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands). |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `command` is not one of the [Commands](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands). |

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `Command` | `TypeAlias` | Any of the [Commands](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands). |

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`command`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-command) | `Command` | The command this control carries. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-__init__) | Create a control carrying `command`. |
| [`reset`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-reset) | Create a control that allows a new attempt after a finished one. |
| [`start`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-start) | Create a control that begins a calibration attempt. |
| [`stop`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-stop) | Create a control that cancels the running attempt. |
| [`verify`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-verify) | Create a control that asks for a plane verification. |

Classes

| Name | Description |
| --- | --- |
| [`Commands`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands) | The commands a calibration control can carry. |

#### property `command`

```python
command: Command
```

The command this control carries.

#### method `__init__`

```python
def __init__(command: Command)
```

Create a control carrying `command`.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `command` | `Command` | One of the [Commands](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands). | required |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `command` is not one of the [Commands](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands). |

#### class method `reset`

```python
def reset() -> SupportPlaneCalibrationControl
```

Create a control that allows a new attempt after a finished one.

Returns

| Type | Description |
| --- | --- |
| `SupportPlaneCalibrationControl` | A control carrying [Commands.Reset](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Reset). |

#### class method `start`

```python
def start() -> SupportPlaneCalibrationControl
```

Create a control that begins a calibration attempt.

Returns

| Type | Description |
| --- | --- |
| `SupportPlaneCalibrationControl` | A control carrying [Commands.Start](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Start). |

#### class method `stop`

```python
def stop() -> SupportPlaneCalibrationControl
```

Create a control that cancels the running attempt.

Returns

| Type | Description |
| --- | --- |
| `SupportPlaneCalibrationControl` | A control carrying [Commands.Stop](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Stop). |

#### class method `verify`

```python
def verify(plane: SupportPlane) -> SupportPlaneCalibrationControl
```

Create a control that asks for a plane verification.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `plane` | `SupportPlane` | The support plane to check. | required |

Returns

| Type | Description |
| --- | --- |
| `SupportPlaneCalibrationControl` | A control carrying [Commands.Verify](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Verify). |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `plane` is not a [SupportPlane](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane.md#support_plane-Classes-SupportPlane). |

#### class `Commands`

```python
class Commands
```

The commands a calibration control can carry.

Classes

| Name | Description |
| --- | --- |
| [`Reset`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Reset) | Allow a new attempt after the previous one succeeded or failed. |
| [`Start`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Start) | Begin an attempt unless one is running or awaits reset. |
| [`Stop`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Stop) | Cancel the running attempt and return to idle without reset. |
| [`Verify`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationControl-Commands-Verify) | Verify a plane on the next point cloud without affecting any attempt. |

##### class `Reset`

```python
class Reset
```

Allow a new attempt after the previous one succeeded or failed.

##### class `Start`

```python
class Start
```

Begin an attempt unless one is running or awaits reset.

##### class `Stop`

```python
class Stop
```

Cancel the running attempt and return to idle without reset.

##### class `Verify`

```python
class Verify
```

Verify a plane on the next point cloud without affecting any attempt.

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `plane` is not a [SupportPlane](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane.md#support_plane-Classes-SupportPlane). |

Attributes

| Name | Type | Description |
| --- | --- | --- |
| `plane` | `SupportPlane` | The support plane to check. |

### class `SupportPlaneCalibrationResult`

```python
class SupportPlaneCalibrationResult(dai.Buffer)
```

The end of a calibration attempt.

A result has candidates exactly when calibration succeeded.

Args

| Name | Description |
| --- | --- |
| `outcome` | How the attempt ended. |
| `candidates` | Support plane candidates. |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If an argument has the wrong type. |
| `ValueError` | If the result has candidates and did not succeed, or succeeded without candidates. |

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`candidates`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationResult-candidates) | `tuple[SupportPlaneCandidate, ...]` | Support plane candidates; empty unless calibration succeeded. |
| [`outcome`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationResult-outcome) | `CalibrationOutcome` | How the attempt ended. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneCalibrationResult-__init__) | Create a result and check that its fields are consistent. |

#### property `candidates`

```python
candidates: tuple[SupportPlaneCandidate, ...]
```

Support plane candidates; empty unless calibration succeeded.

#### property `outcome`

```python
outcome: CalibrationOutcome
```

How the attempt ended.

#### method `__init__`

```python
def __init__(
    outcome: CalibrationOutcome,
    candidates: list[SupportPlaneCandidate] | tuple[SupportPlaneCandidate, ...],
)
```

Create a result and check that its fields are consistent.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `outcome` | `CalibrationOutcome` | How the attempt ended. | required |
| `candidates` | `list[SupportPlaneCandidate] | tuple[SupportPlaneCandidate, ...]` | Support plane candidates. | required |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `outcome` is not a [CalibrationOutcome](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-CalibrationOutcome), or `candidates` is not a list or tuple of [SupportPlaneCandidate](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane.md#support_plane-Classes-SupportPlaneCandidate). |
| `ValueError` | If the result has candidates and did not succeed, or succeeded without candidates. |

### class `SupportPlaneVerificationResult`

```python
class SupportPlaneVerificationResult(dai.Buffer)
```

How a supplied plane fares against gravity and the current point cloud.

The plane is accepted when it passes the level test and enough of the sampled point cloud lies on it.

Args

| Name | Description |
| --- | --- |
| `plane` | The checked support plane, as supplied. |
| `gravity_angle_deg` | Tilt of the plane from horizontal, in degrees, from 0 to 90. |
| `accepted` | Whether the plane was accepted. |
| `on_plane_ratio` | Share of sampled valid points on the plane, from 0 to 1, or `None` when too few were sampled to measure. |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If an argument has the wrong type. |
| `ValueError` | If an argument is out of range, or `accepted` is `True` with no `on_plane_ratio`. |

Properties

| Name | Type | Description |
| --- | --- | --- |
| [`accepted`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult-accepted) | `bool` | Whether the plane passed the level test with enough of the cloud on it. |
| [`gravity_angle_deg`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult-gravity_angle_deg) | `float` | Tilt of the plane from horizontal, in degrees, from 0 to 90. |
| [`on_plane_ratio`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult-on_plane_ratio) | `float | None` | Share of sampled valid points on the plane, or `None` if not measured. |
| [`plane`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult-plane) | `SupportPlane` | The checked support plane, as supplied. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane_calibration.md#support_plane_calibration-Classes-SupportPlaneVerificationResult-__init__) | Create a verification result. |

#### property `accepted`

```python
accepted: bool
```

Whether the plane passed the level test with enough of the cloud on it.

The plane is within `max_gravity_angle_deg` of level, below the camera within any configured camera height range, and has a
measured on-plane ratio of at least `min_on_plane_ratio`.

#### property `gravity_angle_deg`

```python
gravity_angle_deg: float
```

Tilt of the plane from horizontal, in degrees, from 0 to 90.

#### property `on_plane_ratio`

```python
on_plane_ratio: float | None
```

Share of sampled valid points on the plane, or `None` if not measured.

A point is on the plane within the calibrator's `check_distance_mm`. `None` means too few valid points were sampled to measure.
This is not a candidate's inlier ratio.

#### property `plane`

```python
plane: SupportPlane
```

The checked support plane, as supplied.

#### method `__init__`

```python
def __init__(
    plane: SupportPlane,
    gravity_angle_deg: float,
    accepted: bool | np.bool_,
    on_plane_ratio: float | None,
)
```

Create a verification result.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `plane` | `SupportPlane` | The checked support plane, as supplied. | required |
| `gravity_angle_deg` | `float` | Tilt of the plane from horizontal, in degrees. | required |
| `accepted` | `bool | np.bool_` | Whether the plane passed the level test and had enough of the point cloud on it. A numpy `bool_` is stored as `bool`. | required |
| `on_plane_ratio` | `float | None` | The on-plane ratio from 0 to 1, or `None` when not measured. | required |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If `plane` is not a [SupportPlane](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/support_plane.md#support_plane-Classes-SupportPlane), `gravity_angle_deg` is not a real number, `accepted` is not a boolean, or `on_plane_ratio` is neither `None` nor a real number. |
| `ValueError` | If `gravity_angle_deg` is not finite, `on_plane_ratio` is not finite or outside 0 to 1, or `accepted` is `True` with no `on_plane_ratio`. |
