Skip to content

standardize lerobot key#280

Merged
yhnsu merged 4 commits into
mainfrom
yhn/lerobot_key
May 26, 2026
Merged

standardize lerobot key#280
yhnsu merged 4 commits into
mainfrom
yhn/lerobot_key

Conversation

@yhnsu
Copy link
Copy Markdown
Collaborator

@yhnsu yhnsu commented May 25, 2026

Description

This PR standardizes the LeRobot key naming conventions across the EmbodiChain project to align with the official LeRobot dataset format. The changes ensure consistency between the codebase, tests, and documentation.

Changes

Core Code Changes

embodichain/data/enum.py

  • Added LeRobotKey enum class with all official LeRobot field keys:
    • OBS_STR, OBS_PREFIX, OBS_ENV_STATE, OBS_STATE, OBS_IMAGE, OBS_IMAGES
    • OBS_LANGUAGE, OBS_LANGUAGE_TOKENS, OBS_LANGUAGE_ATTENTION_MASK
    • OBS_LANGUAGE_SUBTASK, OBS_LANGUAGE_SUBTASK_TOKENS, OBS_LANGUAGE_SUBTASK_ATTENTION_MASK
    • ACTION, ACTION_PREFIX, ACTION_TOKENS, ACTION_TOKEN_MASK
    • REWARD, TRUNCATED, DONE, INFO

embodichain/lab/gym/envs/managers/datasets.py

  • Replaced hardcoded string literals with LeRobotKey enum values:
    • observation.state instead of observation.qpos/qvel/qf for proprio state
    • observation.images.{sensor_name} instead of sensor_name.color for camera images
    • action for action data
    • observation.{key}.{sub_key} pattern for nested features

Key Changes

Before After
observation.qpos observation.state
observation.qvel (removed - consolidated into state)
observation.qf (removed - not in standard LeRobot format)
sensor_name.color observation.images.{sensor_name}
Hardcoded strings LeRobotKey enum references

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

@yhnsu yhnsu requested a review from yuecideng May 25, 2026 03:35
@yhnsu yhnsu merged commit fef305e into main May 26, 2026
6 checks passed
@yhnsu yhnsu deleted the yhn/lerobot_key branch May 26, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants