# テレオペレーター

テレオペレーターは、ロボットが追従するためのアクションを生成します。リーダーアーム、ゲームパッド、キーボード、スマートフォンなど、これらすべてが`Teleoperator`インターフェースを実装しているため、このインターフェースに対して書かれた録画スクリプトは、どの入力デバイスでも動作します。

セットアップガイドについては[Phone teleoperation](../phone_teleop)と[Isaac Teleop](../isaac_teleop)を、録画ワークフローについては[Imitation Learning for Robots](../il_robots)を参照してください。コアセット以外のコミュニティ管理デバイスについては、[Third-Party Robots & Teleoperators](../third_party_robots)を参照してください。独自のテレオペレーターを追加するには、[Bring Your Own Hardware](../integrate_hardware)を参照してください。

## テレオペレーター[[lerobot.teleoperators.Teleoperator]]

#### lerobot.teleoperators.Teleoperator[[lerobot.teleoperators.Teleoperator]]

```python
lerobot.teleoperators.Teleoperator(config: TeleoperatorConfig)
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L32)

**パラメータ:**

config_class (RobotConfig) : このテレオペレーターに期待される設定クラスです。

name (str) : このテレオペレータータイプを識別するために使用される一意の名前。

LeRobot互換のすべてのテレオペレーションデバイス用のベース抽象クラスです。

このクラスは、物理的なテレオペレーターとのインタラクションのための標準化されたインターフェースを提供します。使用可能にするには、サブクラスはすべての抽象メソッドとプロパティを実装する必要があります。

#### 接続[[lerobot.teleoperators.Teleoperator.connect]]

```python
connect(calibrate: bool = True)
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L125)

**パラメータ:**

calibrate (bool) : True の場合、接続後にキャリブレーションが未実施または再キャリブレーションが必要な場合、テレオペレーターを自動的にキャリブレーションします（これはハードウェアに依存します）。

テレオペレーターとの通信を確立します。

#### 切断[[lerobot.teleoperators.Teleoperator.disconnect]]

```python
disconnect()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L224)

テレオペレーターから切断し、必要なクリーンアップを実行します。

#### 設定[[lerobot.teleoperators.Teleoperator.configure]]

```python
configure()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L190)

テレオペレーターに、一度きりの設定または実行時の設定を適用します。これには、モーターパラメータ、制御モード、または初期状態の設定が含まれます。

#### キャリブレーション[[lerobot.teleoperators.Teleoperator.calibrate]]

```python
calibrate()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L142)

適用可能な場合、テレオペレーターをキャリブレーションしてください。適用されない場合は、何もしなくて構いません。

このメソッドは、必要なデータ（モーターオフセットなど）を収集し、`calibration`辞書を適切に更新する必要があります。

#### get_action[[lerobot.teleoperators.Teleoperator.get_action]]

```python
get_action()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L198)

**戻り値:** `RobotAction`

テレオペレーターの現在のアクションを表すフラットな辞書です。その構造は、`observation_features`と一致する必要があります。

テレオペレーターから現在のアクションを取得します。

#### フィードバックを送信[[lerobot.teleoperators.Teleoperator.send_feedback]]

```python
send_feedback(feedback: dict)
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L209)

**パラメータ:**

feedback (dict[str, Any]) : Dictionary representing the desired feedback. Its structure should match :pymeth:`feedback_features`.

**戻り値:** dict[str, Any]

モーターに実際に送信されるアクションは、速度の安全制限などによってクリップまたは修正される可能性があります。

テレオペレーターにフィードバックアクションのコマンドを送信します。

#### action_features[[lerobot.teleoperators.Teleoperator.action_features]]

```python
action_features()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L90)

テレオペレーターによって生成されるアクションの構造と型を記述する辞書です。その構造（キー）は、`get_action` が返すものの構造と一致する必要があります。辞書の値は、単純な値の場合はその値の型を指定します。例えば、単一の固有受容値（関節の目標位置/速度）の場合は `float` となります。

注: このプロパティは、ロボットが接続されているかどうかに関係なく、呼び出すことができる必要があります。

#### feedback_features[[lerobot.teleoperators.Teleoperator.feedback_features]]

```python
feedback_features()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L103)

ロボットが期待するフィードバックアクションの構造と型を記述する辞書です。その構造（キー）は、`send_feedback`に渡されるものと一致する必要があります。辞書の値は、単純な値の場合はその値の型を指定します。例えば、単一の固有受容値（関節の目標位置/速度）の場合は`float`です。

注: このプロパティは、ロボットが接続されているかどうかに関係なく、呼び出すことができる必要があります。

#### is_connected[[lerobot.teleoperators.Teleoperator.is_connected]]

```python
is_connected()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L116)

テレオペレーターが現在接続されているかどうか。`False`の場合、:pymeth:`get_action`または:pymeth:`send_feedback`を呼び出すとエラーが発生するはずです。

#### is_calibrated[[lerobot.teleoperators.Teleoperator.is_calibrated]]

```python
is_calibrated()
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/teleoperator.py#L136)

テレオペレーターが現在キャリブレーション済みかどうか。該当しない場合は常に`True`である必要があります。

## TeleoperatorConfig[[lerobot.teleoperators.TeleoperatorConfig]]

#### lerobot.teleoperators.TeleoperatorConfig[[lerobot.teleoperators.TeleoperatorConfig]]

```python
lerobot.teleoperators.TeleoperatorConfig(id: str | None = None, calibration_dir: pathlib.Path | None = None)
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/config.py#L23)

## make_teleoperator_from_config[[lerobot.teleoperators.make_teleoperator_from_config]]

#### lerobot.teleoperators.make_teleoperator_from_config[[lerobot.teleoperators.make_teleoperator_from_config]]

```python
lerobot.teleoperators.make_teleoperator_from_config(config: TeleoperatorConfig)
```

[ソース](https://github.com/huggingface/lerobot/blob/v0.7.0/src/lerobot/teleoperators/utils.py#L36)

