Esempio n. 1
0
 def __init__(self, start, goal):
    menu = [('File',[['Load map...',self.myLoadMap],
                     ['Save map...',self.saveMap],
                     ['Exit',self.destroy] 
                     ]),
            ]
    keybindings = [ ("<B1-Motion>", self.increaseCell),
                    ("<B2-Motion>", self.middleCell),
                    ("<B3-Motion>", self.decreaseCell),
                    ("<Button-1>", self.increaseCell),
                    ("<Button-2>", self.middleCell),
                    ("<Button-3>", self.decreaseCell),
                    ("<KeyPress-p>", self.findPath),
                    ("<KeyPress-s>", self.setStart),
                    ("<KeyPress-g>", self.setGoal),
                    ("<KeyPress-2>", self.setDouble),
                    ("<KeyPress-q>", self.destroy)
                    ]
    TkMap.__init__(self, 50, 50, 0.5,
                   200, 200, 100, 100,
                   "Occupancy Grid", menu, keybindings)
    self.threshhold = 0.8
    self.lastMatrix = self.grid
    self.lastPath = None
    self.start = start
    self.goal = goal
    self.infinity = 1e5000
    self.bigButNotInfinity = 5000
    self.value= [[self.infinity for col in range(self.cols)]
                 for row in range(self.rows)]
Esempio n. 2
0
    def __init__(self,
                 cols=400,
                 rows=400,
                 value=0.5,
                 widthMM=10000,
                 heightMM=10000,
                 title="Global Perceptual Space"):
        """ Pass in grid cols, grid cells, and total cols/rows in MM"""
        self.step = 0

        self.changedValues = ()

        # 2000 is the max dist of a Pioneer sonar (in MMs)
        self.range = 5000

        # sonar model is broken into 3 regions - these are the boundaries
        self.reg2max = self.range * 0.3
        self.reg1max = self.range * 0.75

        self.field = 15

        # max probability of occupancy
        self.maxOccupied = 0.98

        # create the map
        TkMap.__init__(self, cols, rows, value, cols, rows, widthMM, heightMM,
                       title)
Esempio n. 3
0
 def __init__(self, start, goal):
     menu = [
         ('File', [['Load map...', self.myLoadMap],
                   ['Save map...', self.saveMap], ['Exit', self.destroy]]),
     ]
     keybindings = [("<B1-Motion>", self.increaseCell),
                    ("<B2-Motion>", self.middleCell),
                    ("<B3-Motion>", self.decreaseCell),
                    ("<Button-1>", self.increaseCell),
                    ("<Button-2>", self.middleCell),
                    ("<Button-3>", self.decreaseCell),
                    ("<KeyPress-p>", self.findPath),
                    ("<KeyPress-s>", self.setStart),
                    ("<KeyPress-g>", self.setGoal),
                    ("<KeyPress-2>", self.setDouble),
                    ("<KeyPress-q>", self.destroy)]
     TkMap.__init__(self, 50, 50, 0.5, 200, 200, 100, 100, "Occupancy Grid",
                    menu, keybindings)
     self.threshhold = 0.8
     self.lastMatrix = self.grid
     self.lastPath = None
     self.start = start
     self.goal = goal
     self.infinity = 1e5000
     self.bigButNotInfinity = 5000
     self.value = [[self.infinity for col in range(self.cols)]
                   for row in range(self.rows)]
Esempio n. 4
0
 def __init__(self, cols, rows, value = 0.5,
              width = 200, height = 200,
              widthMM = 7500, heightMM = 7500,
              title = "Local Perceptual Space"):
    """ Pass in grid cols, grid cells, and total width/height in MM"""
    self.step = 0
    TkMap.__init__(self, cols, rows, value,
                   width, height,
                   widthMM, heightMM, title)
Esempio n. 5
0
 def __init__(self,
              cols,
              rows,
              value=0.5,
              width=200,
              height=200,
              widthMM=7500,
              heightMM=7500,
              title="Local Perceptual Space"):
     """ Pass in grid cols, grid cells, and total width/height in MM"""
     self.step = 0
     TkMap.__init__(self, cols, rows, value, width, height, widthMM,
                    heightMM, title)
Esempio n. 6
0
   def __init__(self, cols=400, rows=400, value = 0.5,
                widthMM = 10000, heightMM = 10000,
                title = "Global Perceptual Space"):
      """ Pass in grid cols, grid cells, and total cols/rows in MM"""
      self.step = 0
      
      self.changedValues = ()
      
      # 2000 is the max dist of a Pioneer sonar (in MMs) 
      self.range = 5000

      # sonar model is broken into 3 regions - these are the boundaries
      self.reg2max = self.range * 0.3
      self.reg1max = self.range * 0.75

      self.field = 15

      # max probability of occupancy
      self.maxOccupied = 0.98

      # create the map
      TkMap.__init__(self, cols, rows, value,
                     cols, rows,
                     widthMM, heightMM, title)
Esempio n. 7
0
 def myLoadMap(self):
    TkMap.loadMap(self)
    self.redraw(self.grid, None)
Esempio n. 8
0
 def myLoadMap(self):
     TkMap.loadMap(self)
     self.redraw(self.grid, None)