-
Couldn't load subscription status.
- Fork 116
Update heavy robot wrapper. Fix eval bug #1867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from .default_wrapper import DefaultWrapper | ||
| from .heavy_robot_wrapper import HeavyRobotWrapper | ||
| from .rgb_low_res_wrapper import RGBLowResWrapper | ||
| from .rich_obs_wrapper import RichObservationWrapper | ||
|
|
||
| __all__ = ["DefaultWrapper", "RGBLowResWrapper", "RichObservationWrapper"] | ||
| __all__ = ["DefaultWrapper", "HeavyRobotWrapper", "RGBLowResWrapper", "RichObservationWrapper"] |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||
| import omnigibson as og | ||||||||||||
| from omnigibson.envs import EnvironmentWrapper, Environment | ||||||||||||
| from omnigibson.utils.ui_utils import create_module_logger | ||||||||||||
| from omnigibson.learning.utils.eval_utils import ROBOT_CAMERA_NAMES | ||||||||||||
|
|
||||||||||||
| # Create module logger | ||||||||||||
| logger = create_module_logger("HeavyRobotWrapper") | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class HeavyRobotWrapper(EnvironmentWrapper): | ||||||||||||
| """ | ||||||||||||
| Args: | ||||||||||||
| env (og.Environment): The environment to wrap. | ||||||||||||
| """ | ||||||||||||
|
|
||||||||||||
| def __init__(self, env: Environment): | ||||||||||||
| super().__init__(env=env) | ||||||||||||
| # Note that from eval.py we already set the robot to include rgb + depth + seg_instance_id modalities | ||||||||||||
| # Here, we modify the robot observation to include only rgb modalities, and use 224 * 224 resolution | ||||||||||||
|
||||||||||||
| # For a complete list of available modalities, see VisionSensor.ALL_MODALITIES | ||||||||||||
| # We also change the robot base mass to 250kg to match the configuration during data collection. | ||||||||||||
| robot = env.robots[0] | ||||||||||||
| with og.sim.stopped(): | ||||||||||||
| robot.base_footprint_link.mass = 250.0 # increase base mass to 250kg | ||||||||||||
| # Update robot sensors: | ||||||||||||
| for camera_id, camera_name in ROBOT_CAMERA_NAMES["R1Pro"].items(): | ||||||||||||
|
||||||||||||
| for camera_id, camera_name in ROBOT_CAMERA_NAMES["R1Pro"].items(): | |
| robot_type = getattr(robot, "name", None) | |
| if robot_type not in ROBOT_CAMERA_NAMES: | |
| raise ValueError(f"Robot type '{robot_type}' not found in ROBOT_CAMERA_NAMES. Available types: {list(ROBOT_CAMERA_NAMES.keys())}") | |
| for camera_id, camera_name in ROBOT_CAMERA_NAMES[robot_type].items(): |
Uh oh!
There was an error while loading. Please reload this page.