Admit observed crossing ground between zebra markings

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 23:01:29 +03:00
parent 60d660f447
commit e61aa6da5f
4 changed files with 261 additions and 96 deletions
+6 -4
View File
@@ -559,10 +559,12 @@ class ComposedInference:
crossing = inputs.get("source.crossing-mask")
if crossing is not None and self.environment == "urban" and self.segmenter_id == "simulation-sam3-surfaces":
crossing = np.asarray(crossing, dtype=bool)
if crossing.shape != surface.shape or np.any(crossing & (inputs["segmentation.labels"] != 3)):
raise ValueError("Crossing admission exceeds observed marking")
if crossing.shape != surface.shape or np.any(crossing & ~np.isin(inputs["segmentation.labels"], (0, 1, 2, 3))):
raise ValueError("Crossing admission exceeds ground surface classes")
if crossing.any() and not inputs.get("source.crossing-admission", {}).get("admitted"):
raise ValueError("Crossing ground requires manoeuvre admission")
permissions |= crossing
surface |= crossing & inputs["segmentation.surface"]
surface |= crossing
observed_goals = getattr(self, "observed_goals", None)
semantic_observation = inputs.get("source.semantic-observation")
if observed_goals is not None and semantic_observation is not None:
@@ -678,7 +680,7 @@ class ComposedInference:
"navigation.goal": self.goal,
"navigation.intent": intent,
"navigation.surface": surface,
"navigation.semantic-known": inputs["segmentation.known"],
"navigation.semantic-known": inputs["segmentation.known"] | (crossing if crossing is not None else False),
# Low confidence is not a semantic obstacle. Keep that gate in
# visual_goal, but persist only explicit profile exclusions in CMU.
"navigation.permissions": permissions,