Skip to content

Commit

Permalink
make BehaviorTask compatible with vanilla Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
cremebrule committed Oct 1, 2024
1 parent ae080c1 commit 7413b44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions omnigibson/tasks/behavior_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from omnigibson.object_states import Pose
from omnigibson.reward_functions.potential_reward import PotentialReward
from omnigibson.robots.robot_base import BaseRobot
from omnigibson.scenes.interactive_traversable_scene import InteractiveTraversableScene
from omnigibson.scenes.traversable_scene import TraversableScene
from omnigibson.scenes.scene_base import Scene
from omnigibson.tasks.task_base import BaseTask
from omnigibson.termination_conditions.predicate_goal import PredicateGoal
Expand Down Expand Up @@ -195,7 +195,7 @@ def _load(self, env):
# assert success, f"Failed to initialize Behavior Activity. Feedback:\n{self.feedback}"

# Store the scene name
self.scene_name = env.scene.scene_model
self.scene_name = env.scene.scene_model if isinstance(env.scene, TraversableScene) else None

# Highlight any task relevant objects if requested
if self.highlight_task_relevant_objs:
Expand Down
5 changes: 4 additions & 1 deletion omnigibson/utils/bddl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,12 @@ def set_state(self, state, *args, **kwargs):

class BDDLSampler:
def __init__(self, env, activity_conditions, object_scope, backend):
# Avoid circular imports here
from omnigibson.scenes.traversable_scene import TraversableScene

# Store internal variables from inputs
self._env = env
self._scene_model = self._env.scene.scene_model
self._scene_model = self._env.scene.scene_model if isinstance(self._env.scene, TraversableScene) else None
self._agent = self._env.robots[0]
self._backend = backend
self._activity_conditions = activity_conditions
Expand Down

0 comments on commit 7413b44

Please sign in to comment.