EDU.gatech.cc.is.clay
Class v_Localizer_rv

java.lang.Object
  |
  +--EDU.gatech.cc.is.clay.Node
        |
        +--EDU.gatech.cc.is.clay.NodeVec2
              |
              +--EDU.gatech.cc.is.clay.v_Localizer_rv

public class v_Localizer_rv
extends NodeVec2

This determines the robots location, given an abstract_robot and a visible landmark as input. This node is triggered on sighting a landmark and will determine the global position of the robot given the egocentric distance to the landmark.


Field Summary
protected  LineSim[] allTheLines
           
protected  int[] ambigClosest
           
protected  boolean[] ambigLandmarks
           
protected  int[] ambigLMIndex
           
static boolean DEBUG
           
protected  boolean doneAmbigUpdate
           
protected  int epochCounter
           
protected  java.io.FileWriter errorOutFile
           
protected  int getPosCount
           
protected  java.util.Random intGen
           
protected  EDU.cmu.cs.coral.localize.DoubleRectangle[] landmarkAreas
           
protected  SimulatedObject[] landmarks
           
protected static EDU.cmu.cs.coral.localize.LandmarkSampler landmarkSampler
           
 Vec2 last_val
           
 long lasttime
           
protected  EDU.cmu.cs.coral.localize.LineLandmarkSampler lineSampler
           
protected  EDU.cmu.cs.coral.localize.LineSampleUpdater lineUpdater
           
protected  EDU.cmu.cs.coral.localize.LandmarkSampleUpdater lmUpdater
           
protected  java.io.FileWriter logFile
           
protected  long moveUpdateCnt
           
protected  EDU.cmu.cs.coral.localize.MovementSampleUpdater moveUpdater
           
protected  double[] newSamplesT
           
protected  double[] newSamplesX
           
protected  double[] newSamplesY
           
protected  int numAmbigLM
           
protected  int numCorrectVisionClass
           
protected  int numMoveVars
           
protected  int numSamples
           
protected  int numSensorVars
           
protected  EDU.cmu.cs.coral.localize.LocalizationRobot robot
           
protected  EDU.cmu.cs.coral.localize.SampleSet samples
           
protected  boolean samplesAreNormalized
           
protected  java.awt.Color[] samplesColor
           
protected  Vec2[] samplesMag
           
protected  Vec2[] samplesPos
           
protected  double[] samplesT
           
protected  double[] samplesW
           
protected  double[] samplesX
           
protected  double[] samplesY
           
protected  long sensorUpdateCnt
           
protected  EDU.cmu.cs.coral.localize.UniformRandom ur
           
protected  EDU.cmu.cs.coral.localize.UniformSampler us
           
protected  int useLines
           
 
Fields inherited from class EDU.gatech.cc.is.clay.Node
DEBUG, embedded_nodes
 
Constructor Summary
v_Localizer_rv(EDU.cmu.cs.coral.localize.LineLocalizationRobot ar)
          Instantiate a v_Localizer_rv node
 
Method Summary
protected  Vec2 getLandmarkLocation(int lm)
           
protected  double getLandmarkRadius(int lm)
           
protected  LineSim getLine(int i)
           
protected  EDU.cmu.cs.coral.localize.Sample getPosition()
           
 double normalizeSamples()
           
protected  int onLandmark(EDU.cmu.cs.coral.localize.Sample s)
           
protected  void resetPosition()
           
protected  void updateAmbig(int lm)
           
protected  void updatePositionLines(long timestamp)
           
protected  void updatePositionMovement()
           
protected  int updatePositionSensor()
           
 Vec2 Value(long timestamp)
          Returns a Vec2 representing the robots belief of where it is
protected  double Vec2Dot(Vec2 a, Vec2 b)
           
 
Methods inherited from class EDU.gatech.cc.is.clay.Node
initTrial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG

last_val

public Vec2 last_val

lasttime

public long lasttime

robot

protected EDU.cmu.cs.coral.localize.LocalizationRobot robot

landmarks

protected SimulatedObject[] landmarks

ambigLandmarks

protected boolean[] ambigLandmarks

doneAmbigUpdate

protected boolean doneAmbigUpdate

numAmbigLM

protected int numAmbigLM

ambigLMIndex

protected int[] ambigLMIndex

landmarkAreas

protected EDU.cmu.cs.coral.localize.DoubleRectangle[] landmarkAreas

samplesX

protected double[] samplesX

samplesY

protected double[] samplesY

samplesT

protected double[] samplesT

samplesW

protected double[] samplesW

ambigClosest

protected int[] ambigClosest

newSamplesX

protected double[] newSamplesX

newSamplesY

protected double[] newSamplesY

newSamplesT

protected double[] newSamplesT

samplesAreNormalized

protected boolean samplesAreNormalized

samples

protected EDU.cmu.cs.coral.localize.SampleSet samples

numCorrectVisionClass

protected int numCorrectVisionClass

samplesPos

protected Vec2[] samplesPos

samplesMag

protected Vec2[] samplesMag

samplesColor

protected java.awt.Color[] samplesColor

landmarkSampler

protected static EDU.cmu.cs.coral.localize.LandmarkSampler landmarkSampler

lineSampler

protected EDU.cmu.cs.coral.localize.LineLandmarkSampler lineSampler

numSamples

protected int numSamples

us

protected EDU.cmu.cs.coral.localize.UniformSampler us

ur

protected EDU.cmu.cs.coral.localize.UniformRandom ur

getPosCount

protected int getPosCount

errorOutFile

protected java.io.FileWriter errorOutFile

epochCounter

protected int epochCounter

moveUpdateCnt

protected long moveUpdateCnt

sensorUpdateCnt

protected long sensorUpdateCnt

lmUpdater

protected EDU.cmu.cs.coral.localize.LandmarkSampleUpdater lmUpdater

moveUpdater

protected EDU.cmu.cs.coral.localize.MovementSampleUpdater moveUpdater

lineUpdater

protected EDU.cmu.cs.coral.localize.LineSampleUpdater lineUpdater

numSensorVars

protected int numSensorVars

numMoveVars

protected int numMoveVars

allTheLines

protected LineSim[] allTheLines

useLines

protected int useLines

logFile

protected java.io.FileWriter logFile

intGen

protected java.util.Random intGen
Constructor Detail

v_Localizer_rv

public v_Localizer_rv(EDU.cmu.cs.coral.localize.LineLocalizationRobot ar)
Instantiate a v_Localizer_rv node
Parameters:
ar - SimpleInterface, the abstract_robot object
Method Detail

Value

public Vec2 Value(long timestamp)
Returns a Vec2 representing the robots belief of where it is
Overrides:
Value in class NodeVec2
Parameters:
timestamp - long, only get new info if timestamp > than last call of timestamp == -1.
Returns:
the robots estimate of its position

updatePositionSensor

protected int updatePositionSensor()

updateAmbig

protected void updateAmbig(int lm)

Vec2Dot

protected double Vec2Dot(Vec2 a,
                         Vec2 b)

updatePositionLines

protected void updatePositionLines(long timestamp)

getLine

protected LineSim getLine(int i)

getPosition

protected EDU.cmu.cs.coral.localize.Sample getPosition()

updatePositionMovement

protected void updatePositionMovement()

resetPosition

protected void resetPosition()

normalizeSamples

public double normalizeSamples()

onLandmark

protected int onLandmark(EDU.cmu.cs.coral.localize.Sample s)

getLandmarkLocation

protected Vec2 getLandmarkLocation(int lm)

getLandmarkRadius

protected double getLandmarkRadius(int lm)