> ## Documentation Index
> Fetch the complete documentation index at: https://docs.almond.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# almond_axol.zed

> Enumerate locally connected ZED cameras and manage the ZED X daemon.

Helpers for the ZED cameras attached to the host machine over GMSL. Requires `pyzed` — install it with `axol zed.install` (see [`zed.install`](/cli/zed-install)). The cameras themselves are opened by the LeRobot wrappers in [`almond_axol.lerobot.camera`](/api/lerobot#zedcamera).

```python theme={null}
from almond_axol.zed import ZedDevice, list_zed_devices, restart_zed_daemon, stereo_serials
```

## `list_zed_devices()`

Enumerates the ZED cameras currently visible to the SDK — both mono (ZED-X One, `sl.CameraOne`) and stereo (ZED X, `sl.Camera`) — and returns a list of `ZedDevice` dicts sorted by serial number:

```python theme={null}
from almond_axol.zed import list_zed_devices

for dev in list_zed_devices():
    print(dev["serial"], dev["model"], dev["kind"])
# 41234567 ZED XM mono
# 41234568 ZED XM mono
# 41234569 ZED X  stereo
```

| Key      | Type  | Description                                                           |
| -------- | ----- | --------------------------------------------------------------------- |
| `serial` | `int` | Camera serial number — what you pass to `ZedCameraConfig(serial=...)` |
| `model`  | `str` | SDK model name (e.g. `ZED XM`, `ZED X`)                               |
| `kind`   | `str` | `"mono"` (ZED-X One) or `"stereo"` (ZED X)                            |

## `stereo_serials()`

Returns the serial numbers of the connected **stereo** (ZED X) cameras as a `set[int]`. This is how the SDK auto-detects whether a configured camera is stereo from its serial alone — so teleop and the [control panel](/guides/control-panel#cameras) never make the operator flag it by hand:

```python theme={null}
from almond_axol.zed import stereo_serials

if 41234569 in stereo_serials():
    ...  # open it as a stereo ZED X (both eyes)
```

Best-effort: any enumeration failure (`pyzed` missing, daemon down) returns an empty set, in which case callers treat every camera as mono.

## `restart_zed_daemon()`

Restarts the `zed_x_daemon` systemd service and blocks \~5 s while it re-enumerates the GMSL links. The daemon only scans for cameras when it starts, so a camera plugged in **after boot** stays invisible to the SDK until the daemon restarts — call this (or use the **Restart daemon** button in the [control panel's Cameras settings tab](/guides/control-panel#cameras)) before opening cameras when in doubt.

```python theme={null}
from almond_axol.zed import restart_zed_daemon

restart_zed_daemon()  # raises RuntimeError if systemctl fails
```

Runs `systemctl restart zed_x_daemon` via passwordless `sudo` when not root (raises `RuntimeError` if that fails — e.g. headless without sudo rights).
