How is map data analyzed?
Hello I would like to make sure the way I am reading Occupancy grid maps is right.
based on info on the message type I know the data array is in row-major order.
The question is the width number increase from left to right? height increases from bottom to top?
For example, if self.mapdata.info.width = 600 self.mapdata.info.height = 400 self.mapdata.info.resolution = 0.05 self.mapdata.info.origin.position.x = -15 self.map_data.info.origin.position.y = -10 position xy(0,0)
whats the map_data array number for position x=0,y=0?
I have this code in Python but I am not sure if its right:
xx = (abs(self.map_data.info.origin.position.x - x)/(self.map_data.info.width*self.map_data.info.resolution))*self.map_data.info.width
xx = round(xx,0)
yy = (abs(self.map_data.info.origin.position.y - y)/(self.map_data.info.height*self.map_data.info.resolution))*self.map_data.info.height
yy = round(yy,0)
listno = ((self.map_data.info.height-yy)*self.map_data.info.width)+xx
Asked by Cero10 on 2019-07-18 11:14:42 UTC
Comments