Skip to content

Commit 5d6167c

Browse files
committed
and keep if from failing
1 parent e9985e5 commit 5d6167c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/rpad/rlbench_utils/placement_dataset.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ def get_anchor_points(
244244
gripper_in_first_phase=True,
245245
):
246246
if use_from_simulator:
247-
handle_mapping = {
248-
name: sim.simGetObjectHandle(name)
249-
for name in BACKGROUND_NAMES + ROBOT_NONGRIPPER_NAMES + GRIPPER_OBJ_NAMES
250-
}
247+
handle_mapping = {}
248+
for name in BACKGROUND_NAMES + ROBOT_NONGRIPPER_NAMES + GRIPPER_OBJ_NAMES:
249+
try:
250+
handle_mapping[name] = sim.simGetObjectHandle(name)
251+
except RuntimeError:
252+
logging.info(f"Object {name} not found in scene.")
251253

252254
if anchor_mode == AnchorMode.RAW:
253255
return rgb, point_cloud

0 commit comments

Comments
 (0)