map
index
/home/home5/gvtaylor/cps089s_code/snarfableSlam/map.py

map.py
Mac Mason <mac@cs.duke.edu>
 
A map. A map is a collection of Landmarks. We provide code for reading maps
from text files, and writing maps to text files. If you'd like to produce an
image, see drawstuff.py.
 
We also provide methods for adding and removing landmarks from maps, and a
skeleton of code for use in a sensor model. 
 
This implementation assumes that every landmark has a unique id. If your
landmarks are not unique, you have some work to do.

 
Modules
       
landmark

 
Classes
       
Map

 
class Map
    A (deterministic) landmark-based map. Provides utility code for modifying
the stored collection of landmarks, as well as text file I/O.
 
  Methods defined here:
__init__(self, filename=None)
Construct a new, empty map. If filename != None, treat it as the path to a
file to read in. This means that
 
>>> M = Map("foo.txt")
 
is equivalent to
 
>>> M = Map()
>>> M.read_from_text_file("foo.txt")
add_landmark(self, l)
Add the landmark l to the map. If a landmark in this map already has l's
id, throws an exception.
read_from_text_file(self, filename)
Parse a map from a text file. This will clobber whatever map this object
is currently storing.
 
TODO: This function depends HEAVILY on how Landmark IDs work; you will
probably have to modify this to work with your particular brand of
Landmark. See the code for details.
write_to_text_file(self, filename)
Write the map to the text file specified by filename. Note that this
overwrite that file, should it already exist; be careful.