Overview
Environment processors bridge the gap between:- Simulation environments: Each with their own observation format
- LeRobot format: Standardized observation structure expected by policies
- Image preprocessing (rotation, format conversion)
- State extraction and concatenation
- Feature renaming and reorganization
LIBERO Environment
Process LIBERO environment observations:lerobot/processor/env_processor.py:26 for the implementation.
What LIBERO Processor Does
- Rotates images 180 degrees to match HuggingFaceVLA camera convention:
- Flattens robot state from nested dict to single vector:
- Updates feature shapes in
transform_features():
Isaac Lab Arena Environment
Process Isaac Lab Arena observations:lerobot/processor/env_processor.py:156 for the implementation.
What Isaac Lab Processor Does
- Converts images from (B, H, W, C) uint8 to (B, C, H, W) float32:
- Selectively extracts and concatenates state based on
state_keys:
- Renames features to LeRobot convention:
observation.camera_obs.<name>→observation.images.<name>observation.policy→observation.state
Configuration
tuple[str, ...]
required
Keys to extract from
obs["policy"] and concatenate into state vector. Order matters!tuple[str, ...]
required
Camera names to extract from
obs["camera_obs"]Custom Environment Processor
Create a processor for your custom environment:Handling Multi-Dimensional States
Some environments provide multi-dimensional state arrays that need flattening:Testing Environment Processors
Always test with realistic environment data:Integration with Environments
Use environment processors in your gym environment:Best Practices
1. Match Environment Conventions
Understand your environment’s data format:2. Preserve Batch Dimension
Always maintain batch dimension:3. Document State Ordering
Clearly document concatenation order:API Reference
LiberoProcessorStep
Seelerobot/processor/env_processor.py:26
(observation) -> dict
Process LIBERO observation to LeRobot format
IsaaclabArenaProcessorStep
Seelerobot/processor/env_processor.py:156
tuple[str, ...]
Keys to extract from policy observation
tuple[str, ...]
Camera names to extract from camera observation
(observation) -> dict
Process Isaac Lab observation to LeRobot format