mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 02:59:50 +00:00
refactor(processor): phone processor is now an RobotActionProcessorStep
This commit is contained in:
@@ -22,7 +22,7 @@ from .converters import (
|
|||||||
transition_to_batch,
|
transition_to_batch,
|
||||||
transition_to_dataset_frame,
|
transition_to_dataset_frame,
|
||||||
)
|
)
|
||||||
from .core import EnvTransition, TransitionKey
|
from .core import EnvAction, EnvTransition, PolicyAction, RobotAction, TransitionKey
|
||||||
from .delta_action_processor import MapDeltaActionToRobotActionStep, MapTensorToDeltaActionDictStep
|
from .delta_action_processor import MapDeltaActionToRobotActionStep, MapTensorToDeltaActionDictStep
|
||||||
from .device_processor import DeviceProcessorStep
|
from .device_processor import DeviceProcessorStep
|
||||||
from .gym_action_processor import Numpy2TorchActionProcessorStep, Torch2NumpyActionProcessorStep
|
from .gym_action_processor import Numpy2TorchActionProcessorStep, Torch2NumpyActionProcessorStep
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
|
||||||
from lerobot.configs.types import FeatureType, PipelineFeatureType, PolicyFeature
|
from lerobot.configs.types import FeatureType, PipelineFeatureType, PolicyFeature
|
||||||
from lerobot.processor import ActionProcessorStep, ProcessorStepRegistry
|
from lerobot.processor import ProcessorStepRegistry, RobotAction, RobotActionProcessorStep
|
||||||
from lerobot.teleoperators.phone.config_phone import PhoneOS
|
from lerobot.teleoperators.phone.config_phone import PhoneOS
|
||||||
|
|
||||||
|
|
||||||
@ProcessorStepRegistry.register("map_phone_action_to_robot_action")
|
@ProcessorStepRegistry.register("map_phone_action_to_robot_action")
|
||||||
@dataclass
|
@dataclass
|
||||||
class MapPhoneActionToRobotAction(ActionProcessorStep):
|
class MapPhoneActionToRobotAction(RobotActionProcessorStep):
|
||||||
"""
|
"""
|
||||||
Maps calibrated phone pose actions to standardized robot action inputs.
|
Maps calibrated phone pose actions to standardized robot action inputs.
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ class MapPhoneActionToRobotAction(ActionProcessorStep):
|
|||||||
platform: PhoneOS
|
platform: PhoneOS
|
||||||
_enabled_prev: bool = field(default=False, init=False, repr=False)
|
_enabled_prev: bool = field(default=False, init=False, repr=False)
|
||||||
|
|
||||||
def action(self, act: dict) -> dict:
|
def action(self, act: RobotAction) -> RobotAction:
|
||||||
"""
|
"""
|
||||||
Processes the phone action dictionary to create a robot action dictionary.
|
Processes the phone action dictionary to create a robot action dictionary.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user