Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions predicators/approaches/vlm_open_loop_approach.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

from typing import Callable, List, Sequence, Set

import logging
import numpy as np
import PIL
from PIL import ImageDraw

from predicators import utils
from predicators.approaches import ApproachFailure
from predicators.planning import PlanningFailure
from predicators.approaches.bilevel_planning_approach import \
BilevelPlanningApproach
from predicators.nsrt_learning.segmentation import segment_trajectory
Expand Down Expand Up @@ -150,6 +152,15 @@ def _solve(self, task: Task, timeout: int) -> Callable[[State], Action]:
try:
option_plan = self._query_vlm_for_option_plan(task)
except Exception as e:
if CFG.planning_check_dr_reachable:
try:
init_atoms = utils.abstract(task.init,
self._get_current_predicates())
except Exception: # pragma: no cover - best-effort logging only
init_atoms = set()
logging.info(f"Detected goal unreachable. Goal: {task.goal}")
logging.info(f"Initial atoms: {init_atoms}")
raise PlanningFailure(f"Goal {task.goal} not dr-reachable")
raise ApproachFailure(
f"VLM failed to produce coherent option plan. Reason: {e}")

Expand Down
Loading