Traceback (most recent call last):
File "D:\python\栅格(➕障碍物).py", line 145, in
a1.draw_path()
File "D:\python\栅格(➕障碍物).py", line 107, in draw_path
map_grid[x[0], x[1]] = 5
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
是下标错误,
map_grid的下标不对,
你那样用就是设置参数,而不是根据下标设置值