jAER project on SourceForge

ch.unizh.ini.jaer.projects.opticalflow.chip
Class MotionData

java.lang.Object
  extended by ch.unizh.ini.jaer.projects.opticalflow.chip.MotionData

public class MotionData
extends java.lang.Object

Packs data returned from optical flow sensor. Values are floats that which are normalized as follows: all values are returned in range 0-1 float. Motion signals are centered around 0.5f. Global outputs are not - they are just from corner of chip.

Author:
tobi

Field Summary
static int ADC_RESOLUTION_BITS
          the resolution of the SiLabs_8051F320 ADC
static int GLOBAL_X
          Bit definitions for what this structure holds.
static int GLOBAL_Y
          Bit definitions for what this structure holds.
static int OBJECT_SIZE
          The serialized size in bytes of a MotionData instance
static int PHOTO
          Bit definitions for what this structure holds.
static int UX
          Bit definitions for what this structure holds.
static int UY
          Bit definitions for what this structure holds.
 
Constructor Summary
MotionData()
          Creates a new instance of MotionData
 
Method Summary
 int getContents()
          returns the contents field, whose bits show what data is valid in this buffer
 float getGlobalX()
           
 float getGlobalY()
           
static int getLength()
           
 float getMaxph()
           
 float getMaxus()
           
 float getMaxuy()
           
 float getMinph()
           
 float getMinux()
           
 float getMinuy()
           
 float[][] getPh()
           
 int getSequenceNumber()
          returns the sequence number of this data
 long getTimeCapturedMs()
          gets the system time that the data was captured
 float[][] getUx()
           
 float[][] getUy()
           
 boolean hasGlobalX()
           
 boolean hasGlobalY()
           
 boolean hasLocalX()
           
 boolean hasLocalY()
           
 boolean hasPhoto()
           
 void read(java.io.DataInput in)
          Implements the reader half of the Externalizable interface
 void setContents(int contents)
           
 void setGlobalX(float globalX)
           
 void setGlobalY(float globalY)
           
 void setMaxph(float maxph)
           
 void setMaxus(float maxus)
           
 void setMaxuy(float maxuy)
           
 void setMinph(float minph)
           
 void setMinux(float minux)
           
 void setMinuy(float minuy)
           
 void setPh(float[][] ph)
           
 void setSequenceNumber(int sequenceNumber)
           
 void setTimeCapturedMs(long timeCapturedMs)
           
 void setUx(float[][] ux)
           
 void setUy(float[][] uy)
           
 java.lang.String toString()
           
 void write(java.io.DataOutput out)
          Implements the Externalizable writer in conjuction with the reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GLOBAL_X

public static final int GLOBAL_X
Bit definitions for what this structure holds. User sets these bits to tell the hardware interface what data should be acquired for this buffer

See Also:
Constant Field Values

GLOBAL_Y

public static final int GLOBAL_Y
Bit definitions for what this structure holds. User sets these bits to tell the hardware interface what data should be acquired for this buffer

See Also:
Constant Field Values

PHOTO

public static final int PHOTO
Bit definitions for what this structure holds. User sets these bits to tell the hardware interface what data should be acquired for this buffer

See Also:
Constant Field Values

UX

public static final int UX
Bit definitions for what this structure holds. User sets these bits to tell the hardware interface what data should be acquired for this buffer

See Also:
Constant Field Values

UY

public static final int UY
Bit definitions for what this structure holds. User sets these bits to tell the hardware interface what data should be acquired for this buffer

See Also:
Constant Field Values

ADC_RESOLUTION_BITS

public static final int ADC_RESOLUTION_BITS
the resolution of the SiLabs_8051F320 ADC

See Also:
Constant Field Values

OBJECT_SIZE

public static int OBJECT_SIZE
The serialized size in bytes of a MotionData instance

Constructor Detail

MotionData

public MotionData()
Creates a new instance of MotionData

Method Detail

getLength

public static final int getLength()
Returns:
total number of independent data

getSequenceNumber

public final int getSequenceNumber()
returns the sequence number of this data

Returns:
the sequence number, starting at 0 with the first data captured by the reader

setSequenceNumber

public final void setSequenceNumber(int sequenceNumber)

getGlobalX

public final float getGlobalX()

setGlobalX

public final void setGlobalX(float globalX)

getGlobalY

public final float getGlobalY()

setGlobalY

public final void setGlobalY(float globalY)

getPh

public final float[][] getPh()

setPh

public final void setPh(float[][] ph)

getUx

public final float[][] getUx()

setUx

public final void setUx(float[][] ux)

getUy

public final float[][] getUy()

setUy

public final void setUy(float[][] uy)

getContents

public final int getContents()
returns the contents field, whose bits show what data is valid in this buffer


setContents

public final void setContents(int contents)

getMinph

public float getMinph()

setMinph

public void setMinph(float minph)

getMaxph

public float getMaxph()

setMaxph

public void setMaxph(float maxph)

getMinux

public float getMinux()

setMinux

public void setMinux(float minux)

getMaxus

public float getMaxus()

setMaxus

public void setMaxus(float maxus)

getMinuy

public float getMinuy()

setMinuy

public void setMinuy(float minuy)

getMaxuy

public float getMaxuy()

setMaxuy

public void setMaxuy(float maxuy)

hasGlobalX

public boolean hasGlobalX()

hasGlobalY

public boolean hasGlobalY()

hasPhoto

public boolean hasPhoto()

hasLocalX

public boolean hasLocalX()

hasLocalY

public boolean hasLocalY()

getTimeCapturedMs

public long getTimeCapturedMs()
gets the system time that the data was captured

Returns:
the time in ms as returned by System.currentTimeMillis()

setTimeCapturedMs

public void setTimeCapturedMs(long timeCapturedMs)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Implements the Externalizable writer in conjuction with the reader. Each MotionData object is written as follows:
out.writeInt(contents);
out.writeInt(sequenceNumber);
out.writeLong(timeCapturedMs);
write2DArray(out,ph);
write2DArray(out,ux);
write2DArray(out,uy);

Parameters:
out - the output
Throws:
java.io.IOException

read

public void read(java.io.DataInput in)
          throws java.io.IOException
Implements the reader half of the Externalizable interface

Parameters:
in - the ObjectInput interface
Throws:
java.io.IOException

jAER project on SourceForge