Simulation of the VU Ranging application and the LocalDistanceMap component
[This document is under construction, links may be broken.]
The VU Ranging component is used to determine distances between motes
by using radio signals and sounder. The motes emit once every minute a
radio signal and a chirping sound at the same time, so that listening
motes can determine the time-of-flight of the sound signal and with
this the distance to the sound source - the other mote.
How does the VU Ranging simulation work?
The main difference between the real and the simulated VU ranging is
the fact, that the simulated one doesn't need all the stuff related to
sounder and microphone; the simulation gets its distance information
from the simulator using the previously implemented SimCoordinatesC
component.
The basic scenario of the ranging simulation can roughly be described as follows:
- each n milliseconds a (simulated) radio message containing the
own address is broadcasted, which should correspond to the "beacon"
consisting of the combination of sound and radio signals in the real
VU component. The number n can be configured in RangingSimConfig.h
- if such a "beacon" message is received, the mote determines
whether it disregards it or not based on a probability value (see
RangingSimConfig.h).
- if the mote "decides" to process the
received beacon message it determines the "real" distance to the
sender of the message by calling SimCoordinates.getXYDistance().
- in order to get a behaviour closer to the real component a
derivation is added/substracted from the "real" distance (the
maximal error can be configured in RangingSimConfig.h)
- finally,
a distanceEstimated event is signaled
Components/Files
Convention: As usual in NesC applications, the following naming
conventions have been used for file names:
- files with the suffix "M.nc" contain implementation modules
- files with the suffix "C.nc" or just ".nc" contain
configurations, i.e. their implementation is realized in terms of
other components by connecting provides and uses interfaces.
- files with the suffix just ".nc" may also contain interfaces (sorry)
Components
The following is a structured list of components used in the
application; sub components are listed as sub-items, boldface means new components, emphasize means TinyOS system components:
- RMain: toplevel component; can be ignored for understanding the interplay between localization and ranging. The only purpose of RMain component is to simulate, that the motes are not switched on at the same time by waiting for a random amount of seconds before the start() command of the KLocalizationC component is executed.
- Main: every application's toplevel component has to use this, initializes, starts, and stops the application
- RMainM: implementation component of toplevel component. It implements the above mentioned "switch-on" delay by starting a "one-shot" timer initialized with a random amount of milliseconds (see command start())
- RandomLFSR: used to get the random number for the delay timer
- TimerC: the delay timer, started as "one-shot" timer in RMainM, i.e. it fires exactly one time after the given amount of milliseconds and then never again thereafter.
- KLocalizationC: the toplevel component of the localization application, it uses the following components:
- KLocalizationM: (will) implement(s) the Kestrel localization component; currently only local distance map functionality implemented
- RangingSim: The toplevel component of the VU ranging simulation, it uses:
- RangingSimM: This is the most important component for understanding the VU ranging simulation. It implements the above sketched scenario, how distance estimates are determined.
- SimCoordinatesC: for retrieving distance information from the simulator
- RandomLSFR: to get random numbers used to make the simulation more realistic (see RangingSimM component)
- TimerC: for sending out beacons periodically
- IntToRfm: for sending the radio signal part of the beacon
- RfmToInt: for receiving the radio signal part of the beacon
- LocalDistanceMapM: simple data base type of component for storing and retrieving distance information that has been collected from the ranging component.
Interfaces
The following new interfaces are used in the above components:
Last modified: Mon Jun 2 23:12:01 PDT 2003