In a grid map, are static obstacle shapes the corresponding grid? Do the coordinates refer to the coordinates of the center of the obstacle, which is also the center of the grid?
By analyzing the code of the Grid class, the grid map is based on the largest rectangle formed by static obstacles as the boundary. However, in details, there are some small problems in the conversion of coordinates and grids. For example,
grid_size=100
the center coordinates of the leftmost obstacle are [0, 0]
the center coordinates of the rightmost obstacle are [1000,0]
At this time,
minx=0, maxx=1000, x_size= (1000 - 0) // 100 = 10,
so the grid map has 10 horizontal cells, but there are actually 11, which are (0,0), (100,0), ..., (1000, 0).
In a grid map, are static obstacle shapes the corresponding grid? Do the coordinates refer to the coordinates of the center of the obstacle, which is also the center of the grid? By analyzing the code of the Grid class, the grid map is based on the largest rectangle formed by static obstacles as the boundary. However, in details, there are some small problems in the conversion of coordinates and grids. For example,
grid_size=100
minx=0
,maxx=1000
,x_size= (1000 - 0) // 100 = 10
, so the grid map has 10 horizontal cells, but there are actually 11, which are (0,0), (100,0), ..., (1000, 0).