make BehaviorTask compatible with vanilla Scene

This commit is contained in:
cremebrule 2024-10-01 00:21:03 -07:00
parent ae080c1ae7
commit 7413b447a1
2 changed files with 6 additions and 3 deletions

View File

@ -18,7 +18,7 @@ from omnigibson.macros import gm
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
@ -195,7 +195,7 @@ class BehaviorTask(BaseTask):
# 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:

View File

@ -566,9 +566,12 @@ class BDDLEntity(Wrapper):
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