Skip to content

Commit 52a2d8f

Browse files
committed
make this a flag
1 parent 634f5b6 commit 52a2d8f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rpad/rlbench_utils/placement_dataset.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def get_anchor_points(
195195
use_from_simulator=False,
196196
handle_mapping=None,
197197
names_to_handles=None,
198+
gripper_in_first_phase=True,
198199
):
199200
if use_from_simulator:
200201
handle_mapping = {
@@ -212,7 +213,7 @@ def get_anchor_points(
212213
names = BACKGROUND_NAMES + ROBOT_NONGRIPPER_NAMES
213214

214215
# If it's the first phase, we also omit the gripper.
215-
if phase == TASK_DICT[task_name]["phase_order"][0]:
216+
if phase == TASK_DICT[task_name]["phase_order"][0] and gripper_in_first_phase:
216217
names += GRIPPER_OBJ_NAMES
217218

218219
return filter_out_names(rgb, point_cloud, mask, handle_mapping, names)
@@ -279,6 +280,7 @@ def __init__(
279280
anchor_mode: AnchorMode = AnchorMode.SINGLE_OBJECT,
280281
action_mode: ActionMode = ActionMode.OBJECT,
281282
include_wrist_cam: bool = False,
283+
gripper_in_first_phase: bool = True,
282284
) -> None:
283285
"""Dataset for RL-Bench placement tasks.
284286
@@ -336,6 +338,7 @@ def leaf_fn(path, x):
336338
raise ValueError("Anchor mode must be one of the AnchorMode enum values.")
337339
self.action_mode = action_mode
338340
self.anchor_mode = anchor_mode
341+
self.gripper_in_first_phase = gripper_in_first_phase
339342

340343
if cache:
341344
self.memory = Memory(
@@ -449,6 +452,7 @@ def _select_anchor_vals(rgb, point_cloud, mask):
449452
use_from_simulator=False,
450453
handle_mapping=self.handle_mapping,
451454
names_to_handles=self.names_to_handles,
455+
gripper_in_first_phase=self.gripper_in_first_phase,
452456
)
453457

454458
# Merge all the initial point clouds and masks into one.

0 commit comments

Comments
 (0)