Skip to content

Commit

Permalink
Got Fetch integration to work
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-a-mendez committed Dec 6, 2023
1 parent 24a2eb3 commit ccd9b20
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
9 changes: 6 additions & 3 deletions predicators/behavior_utils/behavior_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,8 @@ def sample_place_ontop_params(igibson_behavior_env: "BehaviorEnv",
obj_to_place_ontop: "URDFObject",
rng: np.random.Generator,
max_internal_samples=None,
return_failed_samples=False) -> Array:
return_failed_samples=False,
return_distribution_samples=False) -> Array:
"""Main logic for place ontop param sampler.
Implemented in a separate method to enable code reuse in
Expand Down Expand Up @@ -1431,7 +1432,8 @@ def sample_place_next_to_params(igibson_behavior_env: "BehaviorEnv",
obj_to_place_nextto: "URDFObject",
rng: np.random.Generator,
max_internal_samples=None,
return_failed_samples=False) -> Array:
return_failed_samples=False,
return_distribution_samples=False) -> Array:
"""Main logic for place next to param sampler.
Implemented in a separate method to enable code reuse in
Expand Down Expand Up @@ -1535,7 +1537,8 @@ def sample_place_under_params(igibson_behavior_env: "BehaviorEnv",
obj_to_place_under: "URDFObject",
rng: np.random.Generator,
max_internal_samples=None,
return_failed_samples=False) -> Array:
return_failed_samples=False,
return_distribution_samples=False) -> Array:
"""Main logic for place under param sampler.
Implemented in a separate method to enable code reuse in
Expand Down
2 changes: 1 addition & 1 deletion predicators/envs/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def _reachable_classifier(self,
if ig_obj.name == "agent":
return False

if isinstance(robot_obj, BehaviorRobot):
if isinstance(robot_obj, BehaviorRobot):
robot_x, robot_y, _ = robot_obj.get_position()
obj_x, obj_y, _ = ig_obj.get_position()
_, _, robot_yaw = p.getEulerFromQuaternion(robot_obj.get_orientation())
Expand Down
12 changes: 10 additions & 2 deletions predicators/ground_truth_nsrts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3349,14 +3349,18 @@ def place_under_obj_pos_sampler(
set(),
option,
option_vars,
lambda s, g, r, o: sampler(
lambda s, g, r, o, max_internal_samples=None,
return_failed_samples=False, return_distribution_samples=False: sampler(
s,
g,
r,
[
env.object_to_ig_object(o_i)
if isinstance(o_i, Object) else o_i for o_i in o
],
max_internal_samples=max_internal_samples,
return_failed_samples=return_failed_samples,
return_distribution_samples=return_distribution_samples,
))
nsrts.add(nsrt)
# NSRT for grasping an object from inside an object.
Expand All @@ -3369,14 +3373,18 @@ def place_under_obj_pos_sampler(
set(),
option,
option_vars,
lambda s, g, r, o: sampler(
lambda s, g, r, o, max_internal_samples=None,
return_failed_samples=False, return_distribution_samples=False: sampler(
s,
g,
r,
[
env.object_to_ig_object(o_i)
if isinstance(o_i, Object) else o_i for o_i in o
],
max_internal_samples=max_internal_samples,
return_failed_samples=return_failed_samples,
return_distribution_samples=return_distribution_samples,
))
nsrts.add(nsrt)

Expand Down
4 changes: 2 additions & 2 deletions predicators/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def _run_pipeline(env: BaseEnv,
logging.info("Reached online_learning_max_transitions, "
"terminating")
break
logging.warning("CAREFUL!! THIS WILL EXIT RIGHT AFTER COLLECTING INTERACTION REQUESTS")
# logging.warning("CAREFUL!! THIS WILL EXIT RIGHT AFTER COLLECTING INTERACTION REQUESTS")
interaction_requests = approach.get_interaction_requests()
exit()
# exit()
if not interaction_requests:
logging.info("Did not receive any interaction requests, "
"terminating")
Expand Down

0 comments on commit ccd9b20

Please sign in to comment.