perf(simulation): reuse support surface within an observation

This commit is contained in:
DCCONSTRUCTIONS
2026-10-08 15:14:14 +03:00
parent bc915c01e1
commit 1f1d4a2807
3 changed files with 18 additions and 10 deletions
@@ -119,10 +119,11 @@ class TerrainObservation:
request['body_contact_height_m'], monitor=self.monitor)
physical = points.copy()
ground_at = time.monotonic()
self.support_obstacles.revalidate(points, pose, request['body_contact_height_m'],
monitor=self.monitor)
# Both checks use the same immutable terrain and pose in this transaction.
surface = self.support_obstacles.revalidate(points, pose, request['body_contact_height_m'],
monitor=self.monitor)
self.support_obstacles.observe_ahead(points, pose, request['body_contact_height_m'],
monitor=self.monitor, speed_mps=float(request['max_speed_mps']))
monitor=self.monitor, speed_mps=float(request['max_speed_mps']), surface=surface)
support_at = time.monotonic()
candidates = self.detections.observed(request)
ground = current[ground[:,3] == 1]