Skip to content

Commit

Permalink
tolerance to drivable grid map
Browse files Browse the repository at this point in the history
  • Loading branch information
JingfeiPeng committed Apr 17, 2021
1 parent 481ff5d commit 2c6a81a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions smarts/core/tests/test_observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def sample_vehicle_pos(lens, rgb, ogm, drivable_area, vehicle_pos):

# Check if vehicles are rendered at the expected position
# RGB
tolerance = 3
tolerance = 2
assert np.count_nonzero(rgb.data[rgb_x, rgb_y, :]) and np.count_nonzero(
apply_tolerance(rgb.data, rgb_x, rgb_y, tolerance) != ROAD_COLOR
)
Expand All @@ -148,7 +148,9 @@ def sample_vehicle_pos(lens, rgb, ogm, drivable_area, vehicle_pos):

# Check if vehicles are within drivable area
# Drivable area grid map
assert np.count_nonzero(drivable_area.data[drivable_area_x, drivable_area_y, :])
assert np.count_nonzero(
apply_tolerance(drivable_area.data, drivable_area_x, drivable_area_y, tolerance)
)


def test_observations(env, agent_spec):
Expand Down

0 comments on commit 2c6a81a

Please sign in to comment.