Overview
TheGr00tSimPolicyWrapper adapts the Gr00tPolicy to work with existing GR00T simulation environments that use flat observation/action keys (e.g., "video.camera_name", "state.joint_positions", "action.joints").
Class definition
gr00t/policy/gr00t_policy.py
Constructor
Gr00tPolicy
required
The
Gr00tPolicy instance to wrapbool
default:"True"
Whether to enforce strict validation
Methods
get_action
Generate actions from flat observation format.dict[str, Any]
required
Flat observation dictionary with keys like:
"video.camera_name": np.ndarray[np.uint8, (B, T, H, W, C)]"state.state_name": np.ndarray[np.float32, (B, T, D)]"task"or"annotation.human.coarse_action": tuple[str] or list[str] with shape (B,)
dict[str, Any] | None
Optional parameters
dict[str, np.ndarray]
Dictionary of action arrays with flat keys like
"action.joint_positions" with shape (B, T, D)dict[str, Any]
Additional information dictionary
get_modality_config
Get the modality configuration from the underlying policy.dict[str, ModalityConfig]
Dictionary mapping modality names to their configurations
reset
Reset the wrapped policy.dict[str, Any] | None
Optional reset parameters
dict[str, Any]
Information dictionary after reset
check_observation
Validate flat observation structure.dict[str, Any]
required
Flat observation dictionary to validate
check_action
Validate flat action structure.dict[str, Any]
required
Flat action dictionary to validate
Usage example
Observation format transformation
The wrapper transforms between flat and nested formats:Input (flat format for GR00T sim):
Internal (nested format for Gr00tPolicy):
Action format transformation
Output from Gr00tPolicy (nested format):
Transformed output (flat format for GR00T sim):
DC environment compatibility
The wrapper includes special handling for DC (DeepMind Control) environments:For DC environments that use
"annotation.human.coarse_action" instead of "task" for language instructions, the wrapper automatically handles this mapping.Properties
Gr00tPolicy
The underlying
Gr00tPolicy instanceWhen to use this wrapper
UseGr00tSimPolicyWrapper when:
- Working with existing GR00T simulation environments
- Your environment uses flat observation keys like
"video.camera","state.joints" - Your environment expects flat action keys like
"action.joints" - Integrating with legacy GR00T infrastructure
- Building new environments (use
Gr00tPolicydirectly with nested format) - Working with custom robots (use
Gr00tPolicydirectly) - You have control over the observation/action format
See also
Gr00tPolicy
Core policy class (use directly for new environments)
Policy API guide
Complete guide to using the policy API
PolicyClient
Client for remote inference