make BehaviorTask compatible with vanilla Scene
This commit is contained in:
parent
ae080c1ae7
commit
7413b447a1
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue