Triangulator
ptolemy.domains.wireless.lib.Triangulator

Given inputs that represent the location of a sensor and the time at which those sensors detect an event, this actor outputs the location of the source of the event. It uses the specified <i>signalPropagationSpeed</i> and triangulates. <p> The input is a record with two fields named "location" and "time". The location field is an array of doubles, and the time is a double. In the current implementation, the actor assumes a two-dimensional space, so the location field is assumed to be an array with two doubles, which represent the horizontal (east-west) and vertical (north-south) location of the sensor. The time field is assumed to be a double representing the time at which the event was detected by the sensor. <p> The triangulation algorithm requires three distinct sensor inputs for the same event in order to be able to calculate the location of the origin of the event. Suppose that the event occurred at time <i>t</i> and location <i>x</i>. Suppose that three sensors at locations <i>y1</i>, <i>y2</i>, and <i>y3</i> have each detected events at times <i>t1</i>, <i>t2</i>, and <i>t3</i>, respectively. Then this actor looks for a solution for <i>x</i> and <i>t</i> in the following equations: <quote> distance(<i>x</i>, <i>y1</i>)/<i>v</i> = <i>t1</i> - <i>t</i>, <br> distance(<i>x</i>, <i>y2</i>)/<i>v</i> = <i>t2</i> - <i>t</i>, <br> distance(<i>x</i>, <i>y3</i>)/<i>v</i> = <i>t3</i> - <i>t</i>, <br> </quote> where <i>v</i> is the value of <i>propagationSpeed</i>. If such a solution is found, then the output <i>x</i> is produced. <p> Since three distinct observations are required, this actor will produce no output until it has received three distinct observations. The observations are distinct if the sensor locations are distinct. If the three observations yield no solution, then this actor will produce no output. However, it is possible for the three observations to come from distinct events, in which case the output may be erroneous. To guard against this, this actor provides a <i>timeWindow</i> parameter. The times of the three observations must be within the value of <i>timeWindow</i>, or no output will be produced. The output is an array of doubles, which in this implementation represent the X and Y locations of the event.

Author(s): Xiaojun Liu, Edward A. Lee
Version:$Id: Triangulator.doc.html,v 1.1 2006/02/22 18:42:26 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Red (ptolemy)


input
The input port for an event detection, which is a record containing the location of a sensor that has detected the event and the time at which the sensor detected the event. This has type {location = {double}, time = double} The location is assumed to have two entries.
output
The output producing the calculated event location. This has type {double}, a double array with two entries.


signalPropagationSpeed
Speed of propagation of the signal to be used for triangulation. This is a double that defaults to 344.0 (the speed of sound in air at room temperature, in meters per second).
timeWindow
Time window within which observations are assumed to come from the same sound event. This is a double that defaults to 0.5 (in seconds).