diff --git a/lerobot/common/utils/buffer.py b/lerobot/common/utils/buffer.py index fa6779ba..82946ede 100644 --- a/lerobot/common/utils/buffer.py +++ b/lerobot/common/utils/buffer.py @@ -547,7 +547,6 @@ class ReplayBuffer: repo_id=repo_id, fps=fps, root=root, - robot=None, # TODO: (azouitine) Handle robot robot_type=None, features=features, use_videos=True, @@ -588,11 +587,8 @@ class ReplayBuffer: else: frame_dict[f"complementary_info.{key}"] = val - # Add task field which is required by LeRobotDataset - frame_dict["task"] = task_name - # Add to the dataset's buffer - lerobot_dataset.add_frame(frame_dict) + lerobot_dataset.add_frame(frame_dict, task=task_name) # Move to next frame frame_idx_in_episode += 1 diff --git a/lerobot/scripts/rl/gym_manipulator.py b/lerobot/scripts/rl/gym_manipulator.py index cbb13149..b7b9780b 100644 --- a/lerobot/scripts/rl/gym_manipulator.py +++ b/lerobot/scripts/rl/gym_manipulator.py @@ -14,6 +14,28 @@ # See the License for the specific language governing permissions and # limitations under the License. + +""" +Robot Environment for LeRobot Manipulation Tasks + +This module provides a comprehensive gym-compatible environment for robot manipulation +with support for: +- Multiple robot types (SO100, SO101, Koch and Moss) +- Human intervention via leader-follower control or gamepad + +- End-effector and joint space control +- Image processing (cropping and resizing) + +The environment is built using a composable wrapper pattern where each wrapper +adds specific functionality to the base RobotEnv. + +Example: + env = make_robot_env(cfg) + obs, info = env.reset() + action = policy.select_action(obs) + obs, reward, terminated, truncated, info = env.step(action) +""" + import logging import time from collections import deque