mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 02:59:50 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
committed by
Adil Zouitine
parent
ecda7482c7
commit
6d4e983197
@@ -165,6 +165,7 @@ from lerobot.processor.converters import (
|
|||||||
```
|
```
|
||||||
|
|
||||||
**`to_transition_teleop_action`** - Converts teleoperation device actions to EnvTransitions:
|
**`to_transition_teleop_action`** - Converts teleoperation device actions to EnvTransitions:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Use case: Phone, gamepad, or other teleop device control
|
# Use case: Phone, gamepad, or other teleop device control
|
||||||
phone_action = {"x": 0.1, "y": -0.2, "gripper": 0.8}
|
phone_action = {"x": 0.1, "y": -0.2, "gripper": 0.8}
|
||||||
@@ -173,6 +174,7 @@ transition = to_transition_teleop_action(phone_action)
|
|||||||
```
|
```
|
||||||
|
|
||||||
**`to_transition_robot_observation`** - Converts robot sensor data to EnvTransitions:
|
**`to_transition_robot_observation`** - Converts robot sensor data to EnvTransitions:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Use case: Live robot observation during inference
|
# Use case: Live robot observation during inference
|
||||||
robot_obs = {
|
robot_obs = {
|
||||||
@@ -184,6 +186,7 @@ transition = to_transition_robot_observation(robot_obs)
|
|||||||
```
|
```
|
||||||
|
|
||||||
**`to_output_robot_action`** - Extracts robot-executable actions from EnvTransitions:
|
**`to_output_robot_action`** - Extracts robot-executable actions from EnvTransitions:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Use case: Converting model outputs back to robot commands
|
# Use case: Converting model outputs back to robot commands
|
||||||
model_transition = {ACTION: {"action.joint_1": 0.2, "action.joint_2": 0.1}}
|
model_transition = {ACTION: {"action.joint_1": 0.2, "action.joint_2": 0.1}}
|
||||||
@@ -192,6 +195,7 @@ robot_action = to_output_robot_action(model_transition)
|
|||||||
```
|
```
|
||||||
|
|
||||||
**`to_dataset_frame`** - Converts transitions to dataset-compatible format:
|
**`to_dataset_frame`** - Converts transitions to dataset-compatible format:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# Use case: Saving processed data or creating training batches
|
# Use case: Saving processed data or creating training batches
|
||||||
features = {
|
features = {
|
||||||
|
|||||||
Reference in New Issue
Block a user