Add vector infrastructure maps and persistent location experience
This commit is contained in:
@@ -380,6 +380,7 @@ class NavigationClient:
|
||||
|
||||
|
||||
class ComposedInference:
|
||||
experience = None
|
||||
def __init__(self, root: Path, run, directory: Path, mission=None):
|
||||
profile = json.loads((root / "models.worker-006.json").read_text())
|
||||
self.graph = compose(root, run["request"].get("composition"))
|
||||
@@ -433,6 +434,10 @@ class ComposedInference:
|
||||
self.navigation_evidence = {}
|
||||
self.pool = ThreadPoolExecutor(max_workers=2, thread_name_prefix="simulation-module")
|
||||
self.directory = directory
|
||||
self.experience = None
|
||||
if run.get("_spatial_experience_root") and run["world"].get("collider_sha256"):
|
||||
from experience_adapter import ExperienceAdapter
|
||||
self.experience = ExperienceAdapter(run, self.inputs, directory)
|
||||
names = self.models.labels
|
||||
if self.segmenter_id == "simulation-sam3-surfaces":
|
||||
from k1link.simulation.ai_polygon.concept_surfaces import LABELS
|
||||
@@ -655,7 +660,8 @@ class ComposedInference:
|
||||
return observed_goals.maneuver(
|
||||
inputs["source.lidar"], inputs["source.pose"], target, prior, excluded,
|
||||
self.geometry, time.monotonic(), self.mission.goals_permitted
|
||||
if isinstance(self.mission, RoutedMission) else None)
|
||||
if isinstance(self.mission, RoutedMission) else None,
|
||||
experience_cost=self.experience.costs if self.experience else None)
|
||||
|
||||
self.goal, intent = self.mission.update(
|
||||
inputs["source.pose"],
|
||||
@@ -1020,6 +1026,8 @@ class ComposedInference:
|
||||
# direction and this transaction's range/support gates. It does
|
||||
# not use the older local translation goal retained during survey.
|
||||
self.intent_captured_at = calibration["captured_at"]
|
||||
if self.experience is not None:
|
||||
self.experience.observe(inputs, self.goal, result)
|
||||
self.navigation_evidence = {
|
||||
"mission": intent,
|
||||
"environment": self.environment,
|
||||
@@ -1199,6 +1207,8 @@ class ComposedInference:
|
||||
)
|
||||
|
||||
def close(self):
|
||||
if self.experience is not None:
|
||||
self.experience.close()
|
||||
self.pool.shutdown(wait=True, cancel_futures=True)
|
||||
self.models.close()
|
||||
self.navigation.close()
|
||||
|
||||
Reference in New Issue
Block a user