Skip to content

How can i get the height value of a particular cell #260

@Ion1811

Description

@Ion1811

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions