00001
00002
00003 import roslib
00004 roslib.load_manifest('occupancy_grid_utils')
00005 import occupancy_grid_utils_python as gu
00006 import math
00007
00008 map_info = gu.MapMetaData()
00009 map_info.resolution = 0.2
00010 map_info.origin.position.x = 1
00011 map_info.origin.position.y = 1
00012 map_info.origin.orientation.w = 1
00013 map_info.height = 20
00014 map_info.width = 20
00015
00016 grid = gu.OccupancyGrid()
00017 grid.info = map_info
00018 gu.allocate_grid(grid)
00019
00020 def occ(i, j):
00021 gu.set_cell(grid, gu.Cell(i, j), gu.OCCUPIED)
00022
00023 occ(1, 6)
00024 occ(3, 4)
00025 occ(3, 7)
00026 occ(4, 4)
00027 occ(4, 6)
00028 occ(5, 4)
00029 occ(7, 8)
00030
00031 scan_info = gu.LaserScan()
00032 scan_info.angle_min = -math.pi/2
00033 scan_info.angle_max = math.pi/2
00034 scan_info.angle_increment = math.pi/4
00035 scan_info.range_max = 1.0
00036
00037 sp = gu.make_pose(1.7, 1.9, math.pi/2)
00038
00039