Retain measured local intent support across range resampling
This commit is contained in:
@@ -29,6 +29,7 @@ class ObservedGoals:
|
||||
self.clearance_observation = None
|
||||
self.clearance_index = None
|
||||
self.continuation_anchor = None
|
||||
self.intent_samples = None
|
||||
|
||||
def observe(self, samples, captured_at, pose, *, frame_id=None, capture_id=None):
|
||||
if frame_id is not None and frame_id in self.seen_semantics:
|
||||
@@ -332,7 +333,18 @@ class ObservedGoals:
|
||||
# body-facing range crop. Both new and retained intentions may refer to
|
||||
# actual earlier returns; no timestamp or physical support is created.
|
||||
# Native planning and live swept-body admission still use current range.
|
||||
points = np.concatenate((points, remembered))
|
||||
# Re-sampling a 20 cm semantic voxel can replace its representative
|
||||
# return by >15 cm without changing the observed surface. Preserve
|
||||
# the actual returns that established this one local intent; otherwise
|
||||
# that sampling change spuriously destroys the goal and moves the
|
||||
# corridor centre sideways. This bounded evidence belongs only to the
|
||||
# matching prior goal and cannot refresh or override semantic cells.
|
||||
retained_samples = np.empty((0, 3))
|
||||
if (prior is not None and self.intent_samples is not None
|
||||
and np.array_equal(self.intent_samples[0], prior)):
|
||||
keys = self.surface.cell_keys(self.intent_samples)
|
||||
retained_samples = self.intent_samples[[tuple(key) in allowed for key in keys]]
|
||||
points = np.concatenate((points, remembered, retained_samples))
|
||||
delta = points[:, :2] - pose[:2]
|
||||
distance = np.linalg.norm(delta, axis=1)
|
||||
progress = np.linalg.norm(points[:, :2] - target, axis=1)
|
||||
@@ -373,6 +385,7 @@ class ObservedGoals:
|
||||
nearest = np.argmin(distances,axis=1)
|
||||
if np.any(distances[np.arange(len(across)),nearest] > .15):
|
||||
return False
|
||||
self.intent_samples = np.vstack((point, support[nearest])).copy()
|
||||
keys = [tuple(cell) for cell in self.surface.cell_keys(support[nearest])]
|
||||
self.evidence = {
|
||||
"source": source,
|
||||
|
||||
Reference in New Issue
Block a user