Skip to content

Commit 4fa0156

Browse files
committed
slight changes for debugging.
1 parent b1eac4c commit 4fa0156

6 files changed

Lines changed: 37 additions & 22 deletions

File tree

predicators/approaches/grammar_search_invention_approach.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,9 @@ def enumerate(self) -> Iterator[Tuple[Predicate, float]]:
487487
"Cut0",
488488
],
489489
"pybullet_coffee": [
490-
"JugInMachine",
491-
"Holding",
492-
"HandEmpty",
490+
"JugInMachine0",
491+
"Holding0",
492+
"HandEmpty0",
493493
]
494494
}
495495
_DEBUG_VLM_PREDICATES = defaultdict(list, _DEBUG_VLM_PREDICATES)
@@ -1107,6 +1107,7 @@ def rename(p: str) -> str: # pragma: no cover
11071107
self._learned_predicates = set(
11081108
p for p in candidates.keys()
11091109
if p.name in debug_predicate_names)
1110+
import pdb; pdb.set_trace()
11101111
else:
11111112
# Create the score function that will be used to guide search.
11121113
score_function = create_score_function(
@@ -1123,6 +1124,7 @@ def rename(p: str) -> str: # pragma: no cover
11231124
elif CFG.grammar_search_pred_selection_approach == "no_select":
11241125
self._learned_predicates = set(candidates.keys())
11251126
logging.info("Done.")
1127+
11261128
# Finally, learn NSRTs via superclass, using all the kept predicates.
11271129
annotations = None
11281130
if dataset.has_annotations:

predicators/datasets/generate_atom_trajs_with_vlm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def _sample_vlm_atom_proposals_from_trajectories(
113113
"""Given a list of ImageOptionTrajectories, query a VLM to generate a list
114114
of names of ground atoms from which we can extract predicates that might be
115115
relevant for planning to recreate these trajectories."""
116+
import pdb; pdb.set_trace()
116117
aggregated_vlm_output_strs = []
117118
all_vlm_queries_list = []
118119
for traj in trajectories:

predicators/datasets/vlm_input_data_prompts/atom_labelling/img_option_diffs_label_history.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
You are a vision system for a robot provided with two images: a before image showing the state before a skill is executed, an after image showing the state after the skill is executed. You are given a list of predicates below, and you are given the values of these predicates in the image before the skill is executed. Your job is to output the values of the following predicates in the image after the skill is executed. Pay careful attention to the visual changes between the two images to figure out which predicates change and which predicates do not change. Note that some or all of the predicates don't necessary have to change. First, output a description of what changes you expect to happen based on the skill that was just run, explicitly noting the skill that was run. Second, output a description of what visual changes you see happen between the before and after images, looking specifically at the objects involved in the skill's arguments, noting what objects these are. From these two descriptions, for each predicate labeled in the previous timestep, note whether you expect its value to change or stay the same. Next, for each predicate given in the list of predicates to label, output each predicate value in the after image as a bulleted list (use '*' for the bullets) with each predicate and value on a different line. Ensure there is a period ('.') after the truth value of the predicate. For each predicate value, provide an explanation as to why you labelled this predicate as having this particular value, and note what value this predicate had in the previous timestep, which is given to you in the prompt. Use the format: `* <predicate>: <truth_value>. <explanation>`. When labeling the value of a predicate, if you don't see the objects involved in that predicate, retain its truth value from the previous timestep. Also, if your description of changes you expect to happen, and your description of visual changes you saw happen, have nothing to do with the predicate you are trying to label, retain its truth value from the previous timestep. For example, if in the previous timestep I paint an object, and in the current timestamp I sit on it, we don't expect its color to change after sitting on it.
22

3+
Note that the coffee machine is black and the table is white.
4+
35
Your response should have three sections. Here is an outline of what your response should look like:
46
[START OULTLINE]
57
# Expected changes based on the executed skill
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
You are a vision system for a robot. Your job is to output the values of the following predicates based on the provided visual scene. For each predicate, output True, False, or Unknown if the relevant objects are not in the scene or the value of the predicate simply cannot be determined. Output each predicate value as a bulleted list (use '*' for the bullets) with each predicate and value on a different line. Use the format: `<predicate>(<obj1>, <obj2>, ...): <truth_value>` given the provided predicates and arguments exactly. Ensure there is a period ('.') after every list item. Do not output any text except the names and truth values of predicates.
1+
You are a vision system for a robot. Your job is to output the values of the following predicates based on the provided visual scene. For each predicate, output True, False, or Unknown if the relevant objects are not in the scene or the value of the predicate simply cannot be determined. Output each predicate value as a bulleted list (use '*' for the bullets) with each predicate and value on a different line. Use the format: `<predicate>(<obj1>, <obj2>, ...): <truth_value>` given the provided predicates and arguments exactly. Ensure there is a period ('.') after every list item. Do not output any text except the names and truth values of predicates.
2+
3+
Before output predicate values, give a description of the scene and explain why you think the predicate values are what they are.
4+
5+
Note that the coffee machine is black and the table is white.
6+
27
Predicates:

predicators/envs/pybullet_coffee.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,21 +286,23 @@ def predicates(self) -> Set[Predicate]:
286286
def agent_goal_predicates(self) -> Set[Predicate]:
287287
return self.goal_predicates
288288

289-
# def get_vlm_debug_atom_strs(self,
290-
# train_tasks: List[Task]) -> List[List[str]]:
291-
# # Convert the default value from List[List[str]] to List[str] to match
292-
# # the other entries we'll put into the dictionary.
293-
# default = [a[0] for a in super().get_vlm_debug_atom_strs(train_tasks)]
294-
# atom_strs_by_task_type = {
295-
# "more_stacks": ["Cooked(patty1)"],
296-
# "fatter_burger": ["Cooked(patty1)"],
297-
# "combo_burger":
298-
# ["Cooked(patty1)", "Cut(lettuce1)", "Whole(lettuce1)"]
299-
# }
300-
# atom_strs_by_task_type = defaultdict(lambda: default,
301-
# atom_strs_by_task_type)
302-
# atom_strs = atom_strs_by_task_type[CFG.burger_no_move_task_type]
303-
# return [[a] for a in atom_strs]
289+
def get_vlm_debug_atom_strs(self,
290+
train_tasks: List[Task]) -> List[List[str]]:
291+
# # Convert the default value from List[List[str]] to List[str] to match
292+
# # the other entries we'll put into the dictionary.
293+
# default = [a[0] for a in super().get_vlm_debug_atom_strs(train_tasks)]
294+
# atom_strs_by_task_type = {
295+
# "more_stacks": ["Cooked(patty1)"],
296+
# "fatter_burger": ["Cooked(patty1)"],
297+
# "combo_burger":
298+
# ["Cooked(patty1)", "Cut(lettuce1)", "Whole(lettuce1)"]
299+
# }
300+
# atom_strs_by_task_type = defaultdict(lambda: default,
301+
# atom_strs_by_task_type)
302+
# atom_strs = atom_strs_by_task_type[CFG.burger_no_move_task_type]
303+
# return [[a] for a in atom_strs]
304+
return [["JugInMachine(jug, coffee_machine)"], ["Holding(robby, jug)"], ["HandEmpty(robby)"]]
305+
304306

305307
@property
306308
def oracle_proposed_predicates(self) -> Set[Predicate]:

predicators/settings.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,12 @@ class GlobalSettings:
333333
# pybullet _coffee env parameters
334334
pybullet_coffee_update_camera = True
335335
pybullet_coffee_camera_distance = 0.8
336-
pybullet_coffee_camera_yaw = -60
337-
pybullet_coffee_camera_pitch = -30
338-
pybullet_coffee_camera_target = (0.75, 1.25, 0.42)
336+
# pybullet_coffee_camera_yaw = -60
337+
# pybullet_coffee_camera_pitch = -30
338+
# pybullet_coffee_camera_target = (0.75, 1.25, 0.42)
339+
pybullet_coffee_camera_yaw = 40
340+
pybullet_coffee_camera_pitch = -40
341+
pybullet_coffee_camera_target = (1, 1.25, 0.42)
339342

340343
# satellites env parameters
341344
satellites_num_sat_train = [2, 3]

0 commit comments

Comments
 (0)