Admit observed crossing areas before the unknown-road planning boundary

This commit is contained in:
DCCONSTRUCTIONS
2026-10-10 04:00:55 +03:00
parent 18e6a0e971
commit e1fa0f8e2d
2 changed files with 34 additions and 3 deletions
+26
View File
@@ -193,3 +193,29 @@ def test_wide_crossing_requires_measured_exit_within_declared_horizon(module):
current = module.MarkedCrossing(geometry, observation_range_m=20.)
labels[pixels[0][points[:,0]>=16.], pixels[1][points[:,0]>=16.]] = 0
assert not enter(current, data)[1]["admitted"]
def test_observed_crossing_can_be_admitted_before_unknown_inflation_boundary(module):
labels, points, pixels, pose = scene()
# The native planner may stop before a painted stripe because the road
# around it is still unknown. Permission must not require first entering
# that denied area. Use an offset entry; no extra ground is supplied.
points[:, 0] += 1.6
g = gate(module)
mask, state = enter(g, (labels, points, pixels, pose))
assert state['admitted']
assert mask[pixels][labels[pixels] == 3].all()
# The permission remains on the reconstructed area, not the approach gap,
# unrelated road, or an object standing on the admitted crossing.
probe = np.array([[1., 0., 0.], [4., 0., 0.], [4., 2., 0.], [4., 0., .5]])
assert g.ground_mask(probe).tolist() == [False, True, False, False]
def test_more_distant_crossing_still_requires_a_measured_stop(module):
labels, points, pixels, pose = scene()
points[:, 0] += 1.6
g = gate(module)
for index in range(5):
pose[0] = .1 * index
mask, state = g.observe(labels, points, pixels, pose, 10. + .4*index)
assert not state['admitted'] and not mask.any()