Skip to content

default_wrapper

DefaultWrapper

Bases: EnvironmentWrapper

Default eval wrapper: low-resolution (224x224) RGB observations.

Camera resolution and modalities are declared via :meth:camera_spec and baked into the robot config at env CREATION by the BatchedEvaluator (see omnigibson.eval.evaluator.BatchedEvaluator.load_env), not changed at runtime. This is required because in multi-env mode robot cameras are batched into a single TiledVisionSensor whose resolution is fixed at creation, so a post-hoc per-sensor resize would be silently ignored.

Parameters:

Name Type Description Default
env Environment

The environment to wrap.

required
Source code in OmniGibson/omnigibson/eval/wrappers/default_wrapper.py
class DefaultWrapper(EnvironmentWrapper):
    """
    Default eval wrapper: low-resolution (224x224) RGB observations.

    Camera resolution and modalities are declared via :meth:`camera_spec` and baked into the robot
    config at env CREATION by the BatchedEvaluator
    (see ``omnigibson.eval.evaluator.BatchedEvaluator.load_env``),
    not changed at runtime. This is required because in multi-env mode robot cameras are batched into
    a single ``TiledVisionSensor`` whose resolution is fixed at creation, so a post-hoc per-sensor
    resize would be silently ignored.

    Args:
        env (og.Environment): The environment to wrap.
    """

    @classmethod
    def camera_spec(cls) -> dict:
        """Returns {"modalities": [...], "resolution": {camera_role: (H, W)}} for this eval profile."""
        return {
            "modalities": ["rgb"],
            "resolution": {role: EVAL_LOW_RES for role in EVAL_CAMERA_ROLES},
        }

    def __init__(self, env: Environment):
        super().__init__(env=env)

camera_spec() classmethod

Returns {"modalities": [...], "resolution": {camera_role: (H, W)}} for this eval profile.

Source code in OmniGibson/omnigibson/eval/wrappers/default_wrapper.py
@classmethod
def camera_spec(cls) -> dict:
    """Returns {"modalities": [...], "resolution": {camera_role: (H, W)}} for this eval profile."""
    return {
        "modalities": ["rgb"],
        "resolution": {role: EVAL_LOW_RES for role in EVAL_CAMERA_ROLES},
    }