Preserve installed operator workspace before consolidation
Local preservation snapshot, not a new deployment or simulation acceptance.
This commit is contained in:
@@ -10,8 +10,10 @@ import math
|
||||
import numpy as np
|
||||
|
||||
|
||||
def obstructing_triangles(vertices, faces, xy, heading, plane, *, step=0.1, height=1.1):
|
||||
"""Count triangles above qualified step height inside the 1 x 1 m start.
|
||||
def obstructing_triangles(
|
||||
vertices, faces, xy, heading, plane, *, step=0.1, height=1.1, length=1.0, width=1.0
|
||||
):
|
||||
"""Count triangles above step height inside the selected robot's start.
|
||||
|
||||
``plane`` is z = a*(x-xy[0]) + b*(y-xy[1]) + c, fitted to the start's support.
|
||||
This is a conservative preparation gate, not a claim of route traversability.
|
||||
@@ -19,8 +21,9 @@ def obstructing_triangles(vertices, faces, xy, heading, plane, *, step=0.1, heig
|
||||
"""
|
||||
triangles = np.asarray(vertices)[faces]
|
||||
center_xy = np.asarray(xy)
|
||||
selected = (triangles[:, :, :2].min(axis=1) <= center_xy + 0.71).all(axis=1) & (
|
||||
triangles[:, :, :2].max(axis=1) >= center_xy - 0.71
|
||||
radius = math.hypot(length, width) / 2
|
||||
selected = (triangles[:, :, :2].min(axis=1) <= center_xy + radius).all(axis=1) & (
|
||||
triangles[:, :, :2].max(axis=1) >= center_xy - radius
|
||||
).all(axis=1)
|
||||
triangles = triangles[selected].astype(np.float64)
|
||||
if not len(triangles):
|
||||
@@ -31,7 +34,7 @@ def obstructing_triangles(vertices, faces, xy, heading, plane, *, step=0.1, heig
|
||||
triangles[:, :, 2] -= delta @ np.asarray(plane[:2]) + plane[2]
|
||||
triangles[:, :, :2] = delta @ rotation
|
||||
low = step + 1e-4 # Same centimetre-scale capability boundary as navigation.
|
||||
half = np.array([0.5, 0.5, (height - low) / 2])
|
||||
half = np.array([length / 2, width / 2, (height - low) / 2])
|
||||
triangles[:, :, 2] -= (height + low) / 2
|
||||
selected = (triangles.min(axis=1) <= half).all(axis=1) & (triangles.max(axis=1) >= -half).all(
|
||||
axis=1
|
||||
|
||||
Reference in New Issue
Block a user