Align native planning clearance and admit observed tracked pivots

This commit is contained in:
DCCONSTRUCTIONS
2026-10-08 21:14:12 +03:00
parent 7f87b5aa4d
commit 012286e972
12 changed files with 518 additions and 13 deletions
@@ -81,6 +81,21 @@ class Footprint:
# cannot authorize moving toward it, reversing into it or corner penetration.
return bool(np.all(clearance + 1e-6 >= np.minimum(initial, self.clearance_m)))
def rotation_clear(self, angle, terrain, pose):
"""Collision-only proposal check for a complete turn about the body centre.
Sample corner travel at the same 2.5 cm scale as command admission.
This never certifies ground support or supplies a motor command.
"""
if not math.isfinite(angle) or abs(angle) > math.pi:
raise ValueError("Invalid proposed rotation")
obstacles = self._obstacles(np.asarray(terrain).reshape(-1, 4), pose)
radius = math.hypot(self.collision_half_length + self.clearance_m,
self.collision_half_width + self.clearance_m)
steps = max(1, math.ceil(abs(angle) * radius / .025))
return all(self._clear(obstacles, np.zeros(2), heading)
for heading in np.linspace(0., angle, steps + 1))
def assess_pose(self, terrain, pose, contact_height_m, *, support_terrain=None):
"""Certify a stationary body using observed support, never empty space.