From 68986f6fc03708c1ac9175d479f1e4744a5680ca Mon Sep 17 00:00:00 2001 From: yutang Date: Thu, 19 Jun 2025 11:49:19 +0800 Subject: [PATCH] update some readme --- .../common/robot_devices/robots/configs.py | 16 +++---- .../common/robot_devices/robots/realman.py | 5 +- lerobot/common/utils/utils.py | 3 +- realman.md | 47 +++++++++++++++---- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/lerobot/common/robot_devices/robots/configs.py b/lerobot/common/robot_devices/robots/configs.py index 04362c787..8c4435e2f 100644 --- a/lerobot/common/robot_devices/robots/configs.py +++ b/lerobot/common/robot_devices/robots/configs.py @@ -701,7 +701,7 @@ class RealmanRobotConfig(RobotConfig): "joint_6": [6, "realman"], "gripper": [7, "realman"], }, - init_joint = {'joint': [90, -90, -90, -90, 90, -90, 1000]} + init_joint = {'joint': [90, -90, -90, 90, -90, 90, 10]} ) } ) @@ -721,13 +721,13 @@ class RealmanRobotConfig(RobotConfig): height=480, use_depth=False ), - "right": IntelRealSenseCameraConfig( - serial_number="405622075165", - fps=30, - width=640, - height=480, - use_depth=False - ), + # "right": IntelRealSenseCameraConfig( + # serial_number="405622075165", + # fps=30, + # width=640, + # height=480, + # use_depth=False + # ), "front": IntelRealSenseCameraConfig( serial_number="145422072751", fps=30, diff --git a/lerobot/common/robot_devices/robots/realman.py b/lerobot/common/robot_devices/robots/realman.py index 2ace37b2d..72719505e 100644 --- a/lerobot/common/robot_devices/robots/realman.py +++ b/lerobot/common/robot_devices/robots/realman.py @@ -43,6 +43,7 @@ class RealmanRobot: # build state-action cache self.joint_queue = deque(maxlen=2) + self.last_endpose = init_pose # build gamepad teleop if not self.inference_time: @@ -187,8 +188,10 @@ class RealmanRobot: before_write_t = time.perf_counter() # result = self.arm.rmarm.rm_movej_p(target_pose, 100, 0, 0, 0) - self.arm.rmarm.rm_movep_follow(target_pose) + if self.last_endpose != target_pose: + self.arm.rmarm.rm_movep_follow(target_pose) self.arm.rmarm.rm_set_gripper_position(action['gripper'], False, 2) + self.last_endpose = target_pose ret = self.arm.rmarm.rm_get_current_arm_state() target_joints = ret[1].get('joint', self.arm.init_joint_position) diff --git a/lerobot/common/utils/utils.py b/lerobot/common/utils/utils.py index 563a7b813..b72fde508 100644 --- a/lerobot/common/utils/utils.py +++ b/lerobot/common/utils/utils.py @@ -175,7 +175,8 @@ def say(text, blocking=False): cmd = ["say", text] elif system == "Linux": - cmd = ["spd-say", text] + # cmd = ["spd-say", text] + cmd = ["edge-playback", "-t", text] if blocking: cmd.append("--wait") diff --git a/realman.md b/realman.md index a26076db5..bad50b93a 100644 --- a/realman.md +++ b/realman.md @@ -8,6 +8,8 @@ conda activate lerobot Install 🤗 LeRobot: ```bash pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install edge-tts +sudo apt install mpv -y # pip uninstall numpy # pip install numpy==1.26.0 @@ -51,18 +53,19 @@ echo $HF_USER ```bash python lerobot/scripts/control_robot.py \ - --robot.type=piper \ + --robot.type=realman \ --robot.inference_time=false \ --control.type=record \ - --control.fps=30 \ + --control.fps=15 \ --control.single_task="move" \ - --control.repo_id=${HF_USER}/test \ + --control.repo_id=maic/test \ --control.num_episodes=2 \ --control.warmup_time_s=2 \ --control.episode_time_s=10 \ --control.reset_time_s=10 \ --control.play_sounds=true \ - --control.push_to_hub=false + --control.push_to_hub=false \ + --control.display_data=true ``` Press right arrow -> at any time during episode recording to early stop and go to resetting. Same during resetting, to early stop and to go to the next episode recording. @@ -104,22 +107,50 @@ python lerobot/scripts/train.py \ --wandb.enable=true ``` +# FT smolvla +python lerobot/scripts/train.py \ + --dataset.repo_id=maic/move_the_bottle_into_ultrasonic_device_with_realman_single \ + --policy.path=lerobot/smolvla_base \ + --output_dir=outputs/train/smolvla_move_the_bottle_into_ultrasonic_device_with_realman_single \ + --job_name=smolvla_move_the_bottle_into_ultrasonic_device_with_realman_single \ + --policy.device=cuda \ + --wandb.enable=false \ + --steps=200000 \ + --batch_size=16 + # Inference 还是使用control_robot.py中的record loop,配置 **--robot.inference_time=true** 可以将手柄移出。 ```bash python lerobot/scripts/control_robot.py \ - --robot.type=piper \ + --robot.type=realman \ --robot.inference_time=true \ --control.type=record \ --control.fps=30 \ - --control.single_task="move" \ - --control.repo_id=$USER/eval_act_jack \ + --control.single_task="move the bottle into ultrasonic device with realman single" \ + --control.repo_id=maic/move_the_bottle_into_ultrasonic_device_with_realman_single \ --control.num_episodes=1 \ --control.warmup_time_s=2 \ --control.episode_time_s=30 \ --control.reset_time_s=10 \ --control.push_to_hub=false \ - --control.policy.path=outputs/train/act_koch_pick_place_lego/checkpoints/latest/pretrained_model + --control.policy.path=outputs/train/act_move_the_bottle_into_ultrasonic_device_with_realman_single/checkpoints/100000/pretrained_model ``` + +```bash +python lerobot/scripts/control_robot.py \ +--robot.type=realman \ +--robot.inference_time=true \ +--control.type=record \ +--control.fps=30 \ +--control.single_task="move the bottle into ultrasonic device with realman single" \ +--control.repo_id=maic/eval_smolvla_move_the_bottle_into_ultrasonic_device_with_realman_single \ +--control.num_episodes=1 \ +--control.warmup_time_s=2 \ +--control.episode_time_s=60 \ +--control.reset_time_s=10 \ +--control.push_to_hub=false \ +--control.policy.path=outputs/train/smolvla_move_the_bottle_into_ultrasonic_device_with_realman_single/checkpoints/160000/pretrained_model \ +--control.display_data=true +``` \ No newline at end of file