Module basicGridMap :: Class BasicGridMap
[frames] | no frames]

Class BasicGridMap

gridMap.GridMap --+
                  |
                 BasicGridMap

Implements the GridMap interface.

Instance Methods
 
__init__(self, worldPath, gridSquareSize, windowWidth=400)
Reads in a world file.
 
makeStartingGrid(self)
Called by gridMap.GridMap.__init__.
 
robotCanOccupy(self, (xIndex, yIndex))
Returns True if the robot's center can be at any location within this cell and not cause a collision.
 
indicesToBoxSegs(self, indices)
Returns: list of four line segments that constitute the boundary of the cell, grown by the radius of the robot, which is found in gridMap.robotRadius.

Inherited from gridMap.GridMap: boxDim, drawNewSquare, drawPath, drawSquare, drawWorld, indexToX, indexToY, indicesToPoint, makeWindow, pointToIndices, squareColor, undrawPath, xToIndex, yToIndex

Method Details

__init__(self, worldPath, gridSquareSize, windowWidth=400)
(Constructor)

 

Reads in a world file. Gets boundary dimensions and aspect ratio from there. Grid cells are square, with size gridSquareSize

Parameters:
  • worldPath - String representing path to a soar world definition file
  • gridSquareSize - size, in world coordinates, of a grid square
  • windowWidth - size, in pixels, to make the window for drawing this map
Overrides: gridMap.GridMap.__init__

makeStartingGrid(self)

 

Called by gridMap.GridMap.__init__. Returns the initial value for the grid, which will be stored in self.Grid.

indicesToBoxSegs(self, indices)

 
Parameters:
  • indices - pair of (ix, iy) indices of a grid cell
Returns:
list of four line segments that constitute the boundary of the cell, grown by the radius of the robot, which is found in gridMap.robotRadius.