Skip to content

Commit

Permalink
Revert "Add support for overriding robot config in scene file"
Browse files Browse the repository at this point in the history
This reverts commit d6ec31f.
  • Loading branch information
cgokmen committed Sep 28, 2023
1 parent d6ec31f commit 60e75e1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion omnigibson/envs/env_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def scene_config(self):
Returns:
dict: Scene-specific configuration kwargs
"""
return dict(self.config["scene"], robot_config_override=self.config["robots"])
return self.config["scene"]

@property
def robots_config(self):
Expand Down
3 changes: 0 additions & 3 deletions omnigibson/scenes/interactive_traversable_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(
load_task_relevant_only=False,
seg_map_resolution=0.1,
include_robots=True,
override_robot_config=None
):
"""
Args:
Expand All @@ -56,7 +55,6 @@ def __init__(
load_task_relevant_only (bool): Whether only task relevant objects (and building structure) should be loaded
seg_map_resolution (float): room segmentation map resolution
include_robots (bool): whether to also include the robot(s) defined in the scene
override_robot_config (None or dict): if specified, this will override the robot config defined in the scene
"""

# Store attributes from inputs
Expand Down Expand Up @@ -97,7 +95,6 @@ def __init__(
num_waypoints=num_waypoints,
waypoint_resolution=waypoint_resolution,
use_floor_plane=False,
override_robot_config=override_robot_config,
)

def get_scene_loading_info(self, scene_model, scene_instance=None):
Expand Down
3 changes: 0 additions & 3 deletions omnigibson/scenes/scene_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def __init__(
floor_plane_visible=True,
use_skybox=True,
floor_plane_color=(1.0, 1.0, 1.0),
override_robot_config=None,
):
"""
Args:
Expand All @@ -50,7 +49,6 @@ def __init__(
floor_plane_visible (bool): whether to render the additionally added floor plane
floor_plane_color (3-array): if @floor_plane_visible is True, this determines the (R,G,B) color assigned
to the generated floor plane
override_robot_config (None or dict): if specified, this will override the robot config defined in the scene
"""
# Store internal variables
self.scene_file = scene_file
Expand All @@ -63,7 +61,6 @@ def __init__(
self._use_floor_plane = use_floor_plane
self._floor_plane_visible = floor_plane_visible
self._floor_plane_color = floor_plane_color
self._override_robot_config = override_robot_config
self._floor_plane = None
self._use_skybox = use_skybox
self._skybox = None
Expand Down
3 changes: 0 additions & 3 deletions omnigibson/scenes/traversable_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
use_floor_plane=True,
floor_plane_visible=True,
floor_plane_color=(1.0, 1.0, 1.0),
override_robot_config=None
):
"""
Args:
Expand All @@ -42,7 +41,6 @@ def __init__(
floor_plane_visible (bool): whether to render the additionally added floor plane
floor_plane_color (3-array): if @floor_plane_visible is True, this determines the (R,G,B) color assigned
to the generated floor plane
override_robot_config (None or dict): if specified, this will override the robot config defined in the scene
"""
log.info("TraversableScene model: {}".format(scene_model))
self.scene_model = scene_model
Expand All @@ -62,7 +60,6 @@ def __init__(
use_floor_plane=use_floor_plane,
floor_plane_visible=floor_plane_visible,
floor_plane_color=floor_plane_color,
override_robot_config=override_robot_config
)

@property
Expand Down
9 changes: 1 addition & 8 deletions omnigibson/utils/python_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,18 @@ def get_init_info(self):
return self._init_info


def create_object_from_init_info(init_info, override_robot_config=None):
def create_object_from_init_info(init_info):
"""
Create a new object based on given init info.
Args:
init_info (dict): Nested dictionary that contains an object's init information.
override_robot_config (None or dict): If specified, will override the robot config specified in @init_info
Returns:
any: Newly created object.
"""
from omnigibson.robots.robot_base import BaseRobot

module = import_module(init_info["class_module"])
cls = getattr(module, init_info["class_name"])

if issubclass(cls, BaseRobot) and override_robot_config:
return cls(**override_robot_config)

return cls(**init_info["args"], **init_info.get("kwargs", {}))


Expand Down

0 comments on commit 60e75e1

Please sign in to comment.