mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-30 18:31:25 +00:00
imports and comments
This commit is contained in:
@@ -22,7 +22,7 @@ import time
|
||||
from lerobot.utils.robot_utils import precise_sleep
|
||||
|
||||
from ..context import RolloutContext
|
||||
from . import RolloutStrategy, infer_action
|
||||
from .core import RolloutStrategy, infer_action
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -28,10 +28,12 @@ from lerobot.utils.constants import OBS_STR
|
||||
from lerobot.utils.feature_utils import build_dataset_frame
|
||||
from lerobot.utils.robot_utils import precise_sleep
|
||||
|
||||
from ..inference import InferenceEngine
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from lerobot.rollout.configs import RolloutStrategyConfig
|
||||
from lerobot.rollout.context import RolloutContext
|
||||
from lerobot.rollout.inference import InferenceEngine
|
||||
from ..configs import RolloutStrategyConfig
|
||||
from ..context import RolloutContext
|
||||
from ..inference import InferenceEngine
|
||||
|
||||
|
||||
class RolloutStrategy(abc.ABC):
|
||||
@@ -54,7 +56,6 @@ class RolloutStrategy(abc.ABC):
|
||||
Call this from ``setup()`` to avoid duplicating the engine
|
||||
construction across every strategy.
|
||||
"""
|
||||
from lerobot.rollout.inference import InferenceEngine
|
||||
|
||||
self._interpolator = ActionInterpolator(multiplier=ctx.cfg.interpolation_multiplier)
|
||||
self._engine = InferenceEngine(
|
||||
|
||||
@@ -21,6 +21,7 @@ import logging
|
||||
import time
|
||||
from threading import Event as ThreadingEvent
|
||||
|
||||
from lerobot.common.control_utils import is_headless
|
||||
from lerobot.datasets import VideoEncodingManager
|
||||
from lerobot.utils.constants import ACTION, OBS_STR
|
||||
from lerobot.utils.feature_utils import build_dataset_frame
|
||||
@@ -44,8 +45,6 @@ class HighlightStrategy(RolloutStrategy):
|
||||
2. Live recording continues until the save key is pressed again.
|
||||
3. The episode is saved and the ring buffer resumes capturing.
|
||||
|
||||
All actions flow through ``robot_action_processor`` before reaching
|
||||
the robot, supporting EE-space recording with joint-space robots.
|
||||
"""
|
||||
|
||||
config: HighlightStrategyConfig
|
||||
@@ -173,7 +172,6 @@ class HighlightStrategy(RolloutStrategy):
|
||||
|
||||
def _setup_keyboard(self) -> None:
|
||||
"""Set up keyboard listener for the save key."""
|
||||
from lerobot.common.control_utils import is_headless
|
||||
|
||||
if is_headless():
|
||||
logger.warning("Headless environment — highlight save key unavailable")
|
||||
|
||||
@@ -17,17 +17,13 @@
|
||||
"""Policy deployment engine with pluggable rollout strategies.
|
||||
|
||||
``lerobot-rollout`` is the single CLI for running trained policies on
|
||||
real robots. It uses a **Strategy Pattern** to provide completely
|
||||
isolated, mutually exclusive execution loops:
|
||||
real robots.
|
||||
|
||||
--strategy.type=base 24/7 autonomous rollout (no recording)
|
||||
--strategy.type=sentry Continuous recording with auto-upload
|
||||
--strategy.type=highlight Ring buffer + keystroke save
|
||||
--strategy.type=dagger Human-in-the-loop (DAgger/RaC)
|
||||
|
||||
All strategies accept ``--rtc.enabled=true`` for asynchronous inference
|
||||
with slow VLA models (Pi0, Pi0.5, SmolVLA).
|
||||
|
||||
Usage examples::
|
||||
|
||||
# Base mode (sync inference)
|
||||
@@ -92,6 +88,7 @@ from lerobot.teleoperators import ( # noqa: F401
|
||||
so_leader,
|
||||
unitree_g1 as unitree_g1_teleop,
|
||||
)
|
||||
from lerobot.utils.import_utils import register_third_party_plugins
|
||||
from lerobot.utils.utils import init_logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -123,8 +120,6 @@ def rollout(cfg: RolloutConfig):
|
||||
|
||||
|
||||
def main():
|
||||
from lerobot.utils.import_utils import register_third_party_plugins
|
||||
|
||||
register_third_party_plugins()
|
||||
rollout()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user