mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-25 13:40:00 +00:00
update record example
This commit is contained in:
+19
-13
@@ -218,9 +218,9 @@ lerobot-record \
|
|||||||
from lerobot.cameras.opencv import OpenCVCameraConfig
|
from lerobot.cameras.opencv import OpenCVCameraConfig
|
||||||
from lerobot.datasets.lerobot_dataset import LeRobotDataset
|
from lerobot.datasets.lerobot_dataset import LeRobotDataset
|
||||||
from lerobot.utils.feature_utils import hw_to_dataset_features
|
from lerobot.utils.feature_utils import hw_to_dataset_features
|
||||||
from lerobot.robots.so_follower import SO100Follower, SO100FollowerConfig
|
from lerobot.robots.so_follower import SO101Follower, SO101FollowerConfig
|
||||||
from lerobot.teleoperators.so_leader.config_so_leader import SO100LeaderConfig
|
from lerobot.teleoperators.so_leader.config_so_leader import SO101LeaderConfig
|
||||||
from lerobot.teleoperators.so_leader.so_leader import SO100Leader
|
from lerobot.teleoperators.so_leader.so_leader import SO101Leader
|
||||||
from lerobot.common.control_utils import init_keyboard_listener
|
from lerobot.common.control_utils import init_keyboard_listener
|
||||||
from lerobot.utils.utils import log_say
|
from lerobot.utils.utils import log_say
|
||||||
from lerobot.utils.visualization_utils import init_rerun
|
from lerobot.utils.visualization_utils import init_rerun
|
||||||
@@ -233,23 +233,25 @@ EPISODE_TIME_SEC = 60
|
|||||||
RESET_TIME_SEC = 10
|
RESET_TIME_SEC = 10
|
||||||
TASK_DESCRIPTION = "My task description"
|
TASK_DESCRIPTION = "My task description"
|
||||||
|
|
||||||
|
def main():
|
||||||
# Create robot configuration
|
# Create robot configuration
|
||||||
robot_config = SO100FollowerConfig(
|
robot_config = SO101FollowerConfig(
|
||||||
id="my_awesome_follower_arm",
|
port="/dev/tty.usbmodem5AB90687491",
|
||||||
|
id="my_follower_arm",
|
||||||
cameras={
|
cameras={
|
||||||
"front": OpenCVCameraConfig(index_or_path=0, width=640, height=480, fps=FPS) # Optional: fourcc="MJPG" for troubleshooting OpenCV async error.
|
"wrist": OpenCVCameraConfig(index_or_path=0, width=640, height=480, fps=30),
|
||||||
},
|
"top": OpenCVCameraConfig(index_or_path=1, width=640, height=480, fps=30)
|
||||||
port="/dev/tty.usbmodem58760434471",
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
teleop_config = SO100LeaderConfig(
|
teleop_config = SO101LeaderConfig(
|
||||||
id="my_awesome_leader_arm",
|
port="/dev/tty.usbmodem5AB90689011",
|
||||||
port="/dev/tty.usbmodem585A0077581",
|
id="my_leader_arm",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialize the robot and teleoperator
|
# Initialize the robot and teleoperator
|
||||||
robot = SO100Follower(robot_config)
|
robot = SO101Follower(robot_config)
|
||||||
teleop = SO100Leader(teleop_config)
|
teleop = SO101Leader(teleop_config)
|
||||||
|
|
||||||
# Configure the dataset features
|
# Configure the dataset features
|
||||||
action_features = hw_to_dataset_features(robot.action_features, "action")
|
action_features = hw_to_dataset_features(robot.action_features, "action")
|
||||||
@@ -329,6 +331,10 @@ log_say("Stop recording")
|
|||||||
robot.disconnect()
|
robot.disconnect()
|
||||||
teleop.disconnect()
|
teleop.disconnect()
|
||||||
dataset.push_to_hub()
|
dataset.push_to_hub()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
```
|
```
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user