Closed anlanxuan closed 2 years ago
good question, i don't remember exactly the thought process here. it's supposed to take in a (px, py) position in the xy-plane, and map that to the coordinates in the 2d gridmap, only necessary if you want to use the laserscan or occupancygrid sensors, which haven't been extensively debugged/tested (i typically only use the OtherAgentsStatesSensor). if your logic is indeed correct, i'd welcome a pull request :)
def world_coordinates_to_map_indices(self, pos):
for a single [px, py] -> [gx, gy]
i think that the gx = int(np.floor(pos[0]/self.grid_cell_size-self.origin_coords[0])) the gy = int(np.floor(pos[1]/self.grid_cell_size-self.origin_coords[1])) is that right? or I don't understand the world_coordinates_to_map_indices?