Keep detector planning reserve out of native body collision map

This commit is contained in:
DCCONSTRUCTIONS
2026-10-10 06:13:32 +03:00
parent 3657998f9d
commit 621023380a
3 changed files with 59 additions and 19 deletions
@@ -61,6 +61,13 @@ class ObservedCollision:
hazards = terrain[terrain[:,3]>self.max_step+1e-4,:2]
search = search_terrain[search_terrain[:,3]>self.max_step+1e-4,:2]
reserve = self.detector_exclusion.points(detected, request['pose'])
self.hazards.publish(cloud(stamp,'map',np.concatenate((hazards,reserve))))
# Reserve is a search constraint, not an observed solid object. It may
# already enclose the body when a new detection arrives. Making it
# lethal locally prevents native BackUp from leaving that reserve.
# Keep original returns in the body map; the independent exact sweep
# guard still enforces the reserve and forbids closer motion when the
# rover is already inside it.
detected_xy = np.asarray(detected, dtype=float).reshape(-1,3)[:,:2]
self.hazards.publish(cloud(stamp,'map',np.concatenate((hazards,detected_xy))))
self.search.publish(cloud(stamp,'map',np.concatenate((search,reserve))))
return True