You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get the heigth value of a cell with the next function, but i'm always getting the whole array on screen.
My code is this:
index_x = int((x - self.grid_map.info.pose.position.x) / self.grid_map.info.resolution)
index_y = int((y - self.grid_map.info.pose.position.x) / self.grid_map.info.resolution)
if 0 <= index_x < self.grid_map.info.length_x and 0 <= index_y < self.grid_map.info.length_y:
height_index = int(index_y * self.grid_map.info.length_x + index_x)
if len(self.grid_map.data) > 0:
height = self.grid_map.data[height_index]
return height
The text was updated successfully, but these errors were encountered:
I'm trying to get the heigth value of a cell with the next function, but i'm always getting the whole array on screen.
My code is this:
index_x = int((x - self.grid_map.info.pose.position.x) / self.grid_map.info.resolution)
index_y = int((y - self.grid_map.info.pose.position.x) / self.grid_map.info.resolution)
if 0 <= index_x < self.grid_map.info.length_x and 0 <= index_y < self.grid_map.info.length_y:
height_index = int(index_y * self.grid_map.info.length_x + index_x)
if len(self.grid_map.data) > 0:
height = self.grid_map.data[height_index]
return height
The text was updated successfully, but these errors were encountered: