diff --git a/Mapping/grid_map_lib/grid_map_lib.py b/Mapping/grid_map_lib/grid_map_lib.py index a93ea309..85dd76e7 100644 --- a/Mapping/grid_map_lib/grid_map_lib.py +++ b/Mapping/grid_map_lib/grid_map_lib.py @@ -194,7 +194,7 @@ class GridMap: min_x, max_x = x[i2], x[i1] else: min_x, max_x = x[i1], x[i2] - if not min_x < iox < max_x: + if not min_x <= iox < max_x: continue tmp1 = (y[i2] - y[i1]) / (x[i2] - x[i1]) @@ -226,8 +226,8 @@ class GridMap: def test_polygon_set(): - ox = [0.0, 20.0, 50.0, 100.0, 130.0, 40.0] - oy = [0.0, -20.0, 0.0, 30.0, 60.0, 80.0] + ox = [0.0, 4.35, 20.0, 50.0, 100.0, 130.0, 40.0] + oy = [0.0, -4.15, -20.0, 0.0, 30.0, 60.0, 80.0] grid_map = GridMap(600, 290, 0.7, 60.0, 30.5) diff --git a/tests/test_grid_map_lib.py b/tests/test_grid_map_lib.py index ed4303d4..8ae142b0 100644 --- a/tests/test_grid_map_lib.py +++ b/tests/test_grid_map_lib.py @@ -14,8 +14,8 @@ def test_position_set(): def test_polygon_set(): - ox = [0.0, 20.0, 50.0, 100.0, 130.0, 40.0] - oy = [0.0, -20.0, 0.0, 30.0, 60.0, 80.0] + ox = [0.0, 4.35, 20.0, 50.0, 100.0, 130.0, 40.0] + oy = [0.0, -4.15, -20.0, 0.0, 30.0, 60.0, 80.0] grid_map = GridMap(600, 290, 0.7, 60.0, 30.5)