Admit observed crossing areas before the unknown-road planning boundary
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user