Skip to content

Commit

Permalink
yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
lf-zhao committed Apr 15, 2024
1 parent f64378f commit afcba08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
13 changes: 4 additions & 9 deletions predicators/ground_truth_models/spot_env/nsrts.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,10 @@ class SpotEnvsGroundTruthNSRTFactory(GroundTruthNSRTFactory):
@classmethod
def get_env_names(cls) -> Set[str]:
return {
"spot_cube_env",
"spot_soda_floor_env",
"spot_soda_table_env",
"spot_soda_bucket_env",
"spot_soda_chair_env",
"spot_main_sweep_env",
"spot_ball_and_cup_sticky_table_env",
"spot_brush_shelf_env",
"lis_spot_block_floor_env"
"spot_cube_env", "spot_soda_floor_env", "spot_soda_table_env",
"spot_soda_bucket_env", "spot_soda_chair_env",
"spot_main_sweep_env", "spot_ball_and_cup_sticky_table_env",
"spot_brush_shelf_env", "lis_spot_block_floor_env"
}

@staticmethod
Expand Down
13 changes: 7 additions & 6 deletions predicators/ground_truth_models/spot_env/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ def _grasp_policy(name: str,
grasp_rot = math_helpers.Quat(params[2], params[3], params[4],
params[5])
# If the target object is reasonably large, don't try to stow!
target_obj_volume = state.get(target_obj, "height") * \
state.get(target_obj, "length") * state.get(target_obj, "width")
target_obj_volume = (state.get(target_obj, "height") *
state.get(target_obj, "length") *
state.get(target_obj, "width"))

do_stow = not do_dump and \
target_obj_volume < CFG.spot_grasp_stow_volume_threshold
Expand Down Expand Up @@ -663,7 +664,7 @@ def _place_object_on_top_policy(state: State, memory: Dict,
robot_pose.x, robot_pose.y) and surface_obj.name == "floor":
# Note simulation fn and args not yet implemented.
action_extra_info = SpotActionExtraInfo(name, objects, _drop_and_stow,
(robot,), None, tuple())
(robot, ), None, tuple())
return utils.create_spot_env_action(action_extra_info)

# If we're running on the actual robot, we want to be very precise
Expand Down Expand Up @@ -725,7 +726,7 @@ def _drop_not_placeable_object_policy(state: State, memory: Dict,

# Note simulation fn and args not yet implemented.
action_extra_info = SpotActionExtraInfo(name, objects,
_open_and_close_gripper, (robot,),
_open_and_close_gripper, (robot, ),
None, tuple())
return utils.create_spot_env_action(action_extra_info)

Expand Down Expand Up @@ -758,7 +759,7 @@ def _move_and_drop_object_inside_policy(state: State, memory: Dict,
if surface_geom.contains_point(robot_pose.x, robot_pose.y):
# Note simulation fn and args not yet implemented.
action_extra_info = SpotActionExtraInfo(name, objects, _drop_and_stow,
(robot,), None, tuple())
(robot, ), None, tuple())
return utils.create_spot_env_action(action_extra_info)

# The dz parameter is with respect to the top of the container.
Expand Down Expand Up @@ -969,7 +970,7 @@ def __init__(self, operator_name: str, types: List[Type]) -> None:
# and policies.
if not CFG.bilevel_plan_without_sim:
_OPERATOR_NAME_TO_PARAM_SPACE["PickObjectFromTop"] = Box(
0, 1, (0,))
0, 1, (0, ))
_OPERATOR_NAME_TO_POLICY[
"PickObjectFromTop"] = _sim_safe_pick_object_from_top_policy
params_space = _OPERATOR_NAME_TO_PARAM_SPACE[operator_name]
Expand Down

0 comments on commit afcba08

Please sign in to comment.