Skip to content

Commit

Permalink
Merge pull request #613 from StanfordVL/sample-scene-objects
Browse files Browse the repository at this point in the history
allow scene objects to be sampled in bddl
  • Loading branch information
ChengshuLi authored Feb 23, 2024
2 parents 3efa96e + 02a05be commit 4232c50
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions omnigibson/utils/bddl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,6 @@ def _parse_inroom_object_room_assignment(self):

self._inroom_object_instances.add(obj_inst)

for obj_synset in self._activity_conditions.parsed_objects:
abilities = OBJECT_TAXONOMY.get_abilities(obj_synset)
if "sceneObject" not in abilities:
continue
for obj_inst in self._activity_conditions.parsed_objects[obj_synset]:
if obj_inst not in self._inroom_object_instances:
# Missing room assignment
return f"All non-sampleable (scene) objects should have room assignment. [{obj_inst}] does not have one."

def _build_sampling_order(self):
"""
Sampling orders is a list of lists: [[batch_1_inst_1, ... batch_1_inst_N], [batch_2_inst_1, batch_2_inst_M], ...]
Expand Down Expand Up @@ -914,10 +905,6 @@ def _import_sampleable_objects(self):
# Don't populate agent
if obj_synset == "agent.n.01":
continue
# Don't populate synsets that can't be sampled
abilities = OBJECT_TAXONOMY.get_abilities(obj_synset)
if "sceneObject" in abilities:
continue

# Populate based on whether it's a substance or not
if is_substance_synset(obj_synset):
Expand All @@ -940,6 +927,9 @@ def _import_sampleable_objects(self):
if obj_inst in self._future_obj_instances:
self._object_scope[obj_inst] = BDDLEntity(bddl_inst=obj_inst)
continue
# Don't sample if already in room
if obj_inst in self._inroom_object_instances:
continue

category = np.random.choice(categories)

Expand Down

0 comments on commit 4232c50

Please sign in to comment.