6.894 PSET #5
1. Introduction to the assignment
The goal of this assignment is to use the Cricket Location System
to provide another way of inputting search parameters. Say you have
a large, map spread out on a table. What if we wanted to use our
cricket technology as a sort of indoor GPS system to input our start
and end nodes of the search, instead of explicitly typing it into the
GUI or saying it to SpeechBuilder? This problem set will familiarize
you with working with crickets as an indoor GPS type tool.
2. Background about the cricket system
The Cricket Location System came from research done in the Network
and Mobile systems group at CSAIL. To learn more about the project,
see their webpage at http://nms.lcs.mit.edu/projects/cricket/
At the most basic level, the Cricket system consists of a Cricket
beacon and a Cricket listener. Beacons transmit signals that are
received by the listeners. Based on the signals that are received,
the listener can determine its location relative to the beacons.
3. Information about setting up cricket and pycricket on the iPaq
For this assignment, you (and your partner) will receive two Crickets.
They can both function as listeners and beacons. To tell which is
which, there should be a number on your Cricket. All those higher
than 15 are beacons, and those 15 and below are listeners. Connect
the listener to the serial cable on your iPaq using the null modem
connector.
For more information on the hardware setup, see
http://nms.lcs.mit.edu/projects/cricket/setup.html.
The most important piece of software you need for the Crickets is
cricketd. Cricketd is the interface to the raw cricket data. It
allows you to telnet to the iPaq and see the data feed from the
Listener. There is a graphical interface to the Cricket data called
pyCricket (cricket.py). There is an additional library called
libcricket.py that contains a few classes that will make it easier
for you to do the assignment.
To put cricketd on the iPaqs, do an ipkg install for
"cricketd."
ipaq>> ipkg install cricketd
You will need to make a small change to the cricketd start-up script
because we've changed hardware since the package was made. After
cricketd has been installed, make the following modification to the
file /usr/bin/start-cricketd.
The original file should contain the line:
cricketd -s 9600 -T k -p /dev/tts/0
You need to change the 9600 to 115200 to work with the new Cricket
hardware. NOTE: Singapore students--you have the old Cricket hardware,
and you should keep your baud rate at 9600.
To test to see if the crickets are working, run
/usr/bin/start-cricketd. You can then telnet to port 2947 to see if
you are receiving raw data from the listener.
ipaq>> /usr/bin/start-cricketd
From your host machine:
taka>> telnet ipaqipaddress2947
After you are connected, you should see the following dialog:
Trying 18.24.6.114...
Connected to 18.24.6.114.
Escape character is '^]'.
When you see this, type 'r.' The following data should appear:
CRICKETD,R=1
$Cricket2,ver=3.0,space=MIT19,id=20,dist=57,duration=05
$Cricket2,ver=3.0,space=MIT19,id=20,dist=5C,duration=37
$Cricket2,ver=3.0,space=MIT19,id=20,dist=5C,duration=49
...
...
Back on your iPaq, if you've installed pyCricket, you should be able
to run Cricket and see a
graphical interface window pop up. You can run Cricket by typing:
taka>> python cricket.py
At this time, the ipkg for pyCricket and libcricket.py is not
installing properly, but you can go to
http://neon.lcs.mit.edu/pycricket/ to download cricket.py and
cricket.glade. Make a directory on your iPaq, download cricket.py,
libcricket.py and cricket.glade into that directory, and you should
be able to run cricket.py as shown above.
4. Assignment details
Before you start the assignment, familiarize yourself with the classes
contained in libcricket.py. There's a short test code at the end of
the file that will work if you run libcricket.py. Play around with
this to see how you can get the location update information from the
crickets. To run libcricket, you must start cricketd first!
ipaq>> /usr/bin/start-cricketd
ipaq>> python libcricket.py
There is no GUI interface, but you should see cricket data appearing
on the terminal.
Your assignment:
We will continue with the idea of searching on a map. However, instead of using the maps that already exist of the Stata Center, you will be making your own map. Draw/make a large, physical poster sized map of whatever it is you want to make a map of. It could be offices in a building, a city, or a piece of land with several different landmarks. Once you make this physical map, you must make a corresponding .graph and .png file so that your pystata python search program can search on this map.
With this physical map, we can use the crickets to point to a start and finish location on the map, and search for a path in between these two points. The concept is illustrated below.
1) First set up your cricket beacons around the map:
2) Then move your cricket listener to a position on your map for a little bit, to allow your system to recognize its location relative to the map:
3) Now after this first position is registered, move your ipaq and cricket listener to another location on the map.
4) Let that second location register, and after a few seconds, move your cricket listener to another location that signals that you would like to conduct the search. Now that your system knows what the two points are, you should be able to run the search command on it.
You should get the idea. Working with the crickets should be much easier than working with SpeechBuilder, and they are markedly improved from the earlier versions.
Right now, cricket listeners are set up to simply output each of the data readings from cricket beacons it hears to a particular port on the ipaq. Your job is to figure out how to use these distance measurements to interpret where your listener is on the map, and build the backend so that you can translate these relative positions on the physical map to actual nodes on your .graph file.
Let’s look at the maps from above. Let’s say that you place your cricket listener over the pond on the bottom left corner of the map. Using the readings from your two beacons, you can tell that your listener is x inches away from beacon 1, and y inches away from beacon 2. You can do a little bit of math to figure out where you are on the map. Once you have that location, you check out your .graph file, and match it to the closest one. Then do the same for the other position over the map, and you should have your two points. Once you get here, there’s nothing new, and you can execute the search as normal.