
    j                     R    d Z ddlmZmZ ddlmZ erddlmZ  G d de          ZdS )z4Abstract base class for teleoperation input methods.    )ABCabstractmethod)TYPE_CHECKING)RobotControllerc                   P   e Zd ZdZeedefd                        Zedd            Zedd            Z	edd	            Z
eedefd
                        ZddZddZdddZdddefdZdddefdZdddefdZedefd            Zedefd            Zedefd            ZdS )TeleopInterfacezShared interface for all teleoperation input methods.

    To add a new input method, subclass this, implement all abstract methods,
    and instantiate it from the CLI or calling code.
    returnc                     dS )z@Short identifier used in metadata (e.g. 'leader', 'spacemouse').N selfs    :/home/robot-lab/cameron/raiden_fork/raiden/control/base.pynamezTeleopInterface.name             robot_controllerr   Nc                     dS )zQDevice-specific setup after robots are ready (attach hardware, warm up IK, etc.).Nr   r   r   s     r   setupzTeleopInterface.setup   r   r   c                     dS )zStart the control loop threads.Nr   r   s     r   startzTeleopInterface.start   r   r   c                     dS )zStop the control loop threads.Nr   r   s     r   stopzTeleopInterface.stop   r   r   c                     dS )z9Status message printed when teleoperation becomes active.Nr   r   s    r   bannerzTeleopInterface.banner"   r   r   c                     dS )zOpen session-level peripherals (footpedal, etc.).

        Called once per session before the first episode.  Default: no-op.
        Nr   r   s    r   openzTeleopInterface.open+   r   r   c                     dS )z_Close session-level peripherals.

        Called once at session end.  Default: no-op.
        Nr   r   s    r   closezTeleopInterface.close1   r   r   c                     || _         dS )a  Notify the interface whether a recording episode is active.

        When a controller is provided (episode started), footpedal left calls
        ``robot_controller.soft_pause()`` instead of firing a trigger event.
        Pass None when the episode ends.  Default: no-op.
        N)_recording_controllerr   s     r   set_active_recordingz$TeleopInterface.set_active_recording7   s     &6"""r   c                     dS )zReturn True on a trigger event (button press, footpedal left, etc.).

        Used as: start/stop recording in recorder, record-pose in calibration.
        Default: never triggers.
        Fr   r   s     r   pollzTeleopInterface.poll@   s	     ur   c                     dS )zGReturn True if the user signalled a success outcome (footpedal middle).Fr   r   s     r   poll_successzTeleopInterface.poll_successH       ur   c                     dS )zWReturn True if the user signalled a failure outcome (footpedal right / failure button).Fr   r   s     r   poll_failurezTeleopInterface.poll_failureL   r'   r   c                     dS )z9True if this mode requires leader arms to be initialised.Fr   r   s    r   uses_leaderszTeleopInterface.uses_leadersP   s	     ur   c                     | j         S )zTrue if recording should start on a leader-arm button press.

        False means keyboard / Enter key is used instead.
        r+   r   s    r   waits_for_button_startz&TeleopInterface.waits_for_button_startU   s       r   c                     | j         S )z?True if leader-arm buttons can be used to mark success/failure.r-   r   s    r   supports_verdict_buttonz'TeleopInterface.supports_verdict_button]   s       r   )r   r   r	   N)r	   N)N)__name__
__module____qualname____doc__propertyr   strr   r   r   r   r   r   r   r"   boolr$   r&   r)   r+   r.   r0   r   r   r   r   r   
   s         Oc O O O ^ XO ` ` ` ^` . . . ^. - - - ^- H H H H ^ XH      6 6 6 6 6%6 4    -> 4    -> 4     d    X ! ! ! ! X! ! ! ! ! X! ! !r   r   N)	r4   abcr   r   typingr   raiden.robot.controllerr   r   r   r   r   <module>r;      s    : : # # # # # # # #             8777777V! V! V! V! V!c V! V! V! V! V!r   