From 5b46dc0b6a031df25ea60bb45e8e4343f41b623f Mon Sep 17 00:00:00 2001 From: Simon Alibert Date: Sun, 23 Mar 2025 19:26:10 +0100 Subject: [PATCH] Add is_connected in robots and teleops --- lerobot/common/robots/robot.py | 4 ++++ lerobot/common/teleoperators/teleoperator.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lerobot/common/robots/robot.py b/lerobot/common/robots/robot.py index 8b68c09f..a263a043 100644 --- a/lerobot/common/robots/robot.py +++ b/lerobot/common/robots/robot.py @@ -37,6 +37,10 @@ class Robot(abc.ABC): def camera_features(self) -> dict[str, dict]: pass + @abc.abstractproperty + def is_connected(self) -> bool: + pass + @abc.abstractmethod def connect(self) -> None: """Connects to the robot.""" diff --git a/lerobot/common/teleoperators/teleoperator.py b/lerobot/common/teleoperators/teleoperator.py index 3b60372e..743bd2c6 100644 --- a/lerobot/common/teleoperators/teleoperator.py +++ b/lerobot/common/teleoperators/teleoperator.py @@ -31,6 +31,10 @@ class Teleoperator(abc.ABC): def feedback_feature(self) -> dict: pass + @abc.abstractproperty + def is_connected(self) -> bool: + pass + @abc.abstractmethod def connect(self) -> None: """Connects to the teleoperator."""