-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import hydra | ||
from omegaconf import DictConfig | ||
|
||
from lerobot.common.robot_devices.robots.utils import Robot | ||
|
||
def make_robot(cfg: DictConfig): | ||
|
||
def make_robot(cfg: DictConfig) -> Robot: | ||
robot = hydra.utils.instantiate(cfg) | ||
return robot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from stretch_body.gamepad_teleop import GamePadTeleop | ||
from stretch_body.robot import Robot as Stretch | ||
|
||
|
||
class LeRobotStretchTeleop(GamePadTeleop): | ||
"""Wrapper of stretch_body.gamepad_teleop.GamePadTeleop""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
|
||
class LeRobotStretch(Stretch): | ||
"""Wrapper of stretch_body.robot.Robot""" | ||
|
||
def __init__(self, teleoperate: bool = False, **kwargs): | ||
super().__init__() | ||
self.robot_type = "stretch" | ||
self.is_connected = False | ||
self.teleop = GamePadTeleop(robot_instance=False) if teleoperate else None | ||
|
||
def connect(self): | ||
self.is_connected = self.startup() | ||
|
||
def run_calibration(self): | ||
if not self.is_homed(): | ||
self.home() | ||
|
||
def teleop_step(self, record_data=False): | ||
if self.teleop is None: | ||
raise ValueError | ||
... | ||
|
||
def capture_observation(self): ... | ||
|
||
def send_action(self, action): ... | ||
|
||
def disconnect(self): | ||
self.stop() | ||
if self.teleop is not None: | ||
self.teleop.stop() | ||
|
||
def __del__(self): | ||
self.disconnect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_target_: lerobot.common.robot_devices.robots.stretch.LeRobotStretch | ||
robot_type: stretch | ||
teleoperate: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters