|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jaer.stereopsis.StereoHardwareInterface
public class StereoHardwareInterface
A hardware interface to a stereo pair of sensors. This class merges the data from two AEMonitorInterface's to a single unified stereo stream, with events sorted by timestamp in the output packets. This class also deals with the awkwardness of the fact that you are not guarenteed to get all events in order of generation from the devices owing to buffering. Events from one source (say the left eye) are held back until it is assured there are no earlier events from the other source (the right eye).
| Field Summary | |
|---|---|
protected AEChip |
chip
|
int |
INITIAL_CAPACITY
Initial capacity of output buffer that is reused for outputting merged event stream |
static int |
RESET_TIMESTAMPS_THRESHOLD_DT_US
the two inputs have their timestamps reset when the first timestamp of each most recent packet differs by this much |
| Fields inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
|---|
PID_THESYCON_END, PID_THESYCON_START, VID_THESYCON |
| Constructor Summary | |
|---|---|
StereoHardwareInterface(AEMonitorInterface left,
AEMonitorInterface right)
|
|
| Method Summary | |
|---|---|
AEPacketRaw |
acquireAvailableEventsFromDriver()
Gets available events from driver. |
void |
addAEListener(AEListener listener)
add a PropertyChangeListener for new events |
void |
close()
Closes the device and frees the internal device handle. |
int |
getAEBufferSize()
Returns the size of the host buffer. |
AEMonitorInterface |
getAemonLeft()
|
AEMonitorInterface |
getAemonRight()
|
AEChip |
getChip()
Sets the AEChip that this interface is acquiring events for |
short |
getDID()
|
int |
getEstimatedEventRate()
Returns estimate of present event rate on this interface |
AEPacketRaw |
getEvents()
returns the last events acquired by AEMonitorInterface.acquireAvailableEventsFromDriver() |
int |
getFifoSize()
|
int |
getMaxCapacity()
Returns max capacity of this interface in events/sec |
int |
getNumBuffers()
|
int |
getNumEventsAcquired()
Returns the number of events acquired by the last call to AEMonitorInterface.acquireAvailableEventsFromDriver() |
short |
getPID()
|
java.lang.String[] |
getStringDescriptors()
return the string USB descriptors for the device. |
int |
getTimestampTickUs()
|
java.lang.String |
getTypeName()
get text name of interface, e.g. |
short |
getVID()
|
int[] |
getVIDPID()
return the USB VID/PID of the interface |
boolean |
isEventAcquisitionEnabled()
|
boolean |
isIgnoreTimestampNonmonotonicity()
|
boolean |
isOpen()
|
void |
labelLeftEye(AEPacketRaw aeRaw)
Labels events as coming from left eye |
void |
labelRightEye(AEPacketRaw aeRawRight)
Labels all events in raw packet as coming from right eye |
void |
open()
Opens the device driver and gets a handle to the device which is internally maintained. |
boolean |
overrunOccurred()
Is true if an overrun occured in the driver the last time AEMonitorInterface.acquireAvailableEventsFromDriver() was called. |
void |
removeAEListener(AEListener listener)
remove a PropertyChangeListener for new events |
void |
resetTimestamps()
resets timestamps from both inputs, serially. |
void |
setAEBufferSize(int AEBufferSize)
sets the host AE buffer size. |
void |
setAemonLeft(AEMonitorInterface aemonLeft)
|
void |
setAemonRight(AEMonitorInterface aemonRight)
|
void |
setChip(AEChip chip)
Sets the AEChip that this interface is acquiring events for |
void |
setEventAcquisitionEnabled(boolean enable)
sets both eyes to acquire events |
void |
setFifoSize(int fifoSize)
|
void |
setIgnoreTimestampNonmonotonicity(boolean yes)
If this flag is set true, then packets are returned from acquireAvailableEventsFromDriver as soon as they are delivered, regardless of any timestamp ordering problems. |
void |
setNumBuffers(int numBuffers)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AEChip chip
public final int INITIAL_CAPACITY
public static final int RESET_TIMESTAMPS_THRESHOLD_DT_US
| Constructor Detail |
|---|
public StereoHardwareInterface(AEMonitorInterface left,
AEMonitorInterface right)
| Method Detail |
|---|
public void setChip(AEChip chip)
AEMonitorInterface
setChip in interface AEMonitorInterfacechip - the chippublic AEChip getChip()
AEMonitorInterface
getChip in interface AEMonitorInterfacepublic AEMonitorInterface getAemonLeft()
public void setAemonLeft(AEMonitorInterface aemonLeft)
public AEMonitorInterface getAemonRight()
public void setAemonRight(AEMonitorInterface aemonRight)
public AEPacketRaw acquireAvailableEventsFromDriver()
throws HardwareInterfaceException
AEMonitorInterfaceHardwareInterfaceException is thrown if there is an error.
acquireAvailableEventsFromDriver in interface AEMonitorInterfaceHardwareInterfaceException - .public int getNumEventsAcquired()
AEMonitorInterfaceAEMonitorInterface.acquireAvailableEventsFromDriver()
getNumEventsAcquired in interface AEMonitorInterfacepublic AEPacketRaw getEvents()
AEMonitorInterfaceAEMonitorInterface.acquireAvailableEventsFromDriver()
getEvents in interface AEMonitorInterfacepublic void resetTimestamps()
resetTimestamps in interface AEMonitorInterfacepublic boolean overrunOccurred()
AEMonitorInterfaceAEMonitorInterface.acquireAvailableEventsFromDriver() was called. This flag is cleared by the next AEMonitorInterface.acquireAvailableEventsFromDriver().
If there is an overrun, the events grabbed are the most ancient; events after the overrun are discarded. The timestamps continue on but will
probably be lagged behind what they should be.
overrunOccurred in interface AEMonitorInterfacepublic int getAEBufferSize()
AEMonitorInterface
getAEBufferSize in interface AEMonitorInterfacepublic void setAEBufferSize(int AEBufferSize)
setAEBufferSize in interface AEMonitorInterfaceAEBufferSize - the size in eventspublic int getFifoSize()
getFifoSize in interface ReaderBufferControlpublic void setFifoSize(int fifoSize)
setFifoSize in interface ReaderBufferControlpublic int getNumBuffers()
getNumBuffers in interface ReaderBufferControlpublic void setNumBuffers(int numBuffers)
setNumBuffers in interface ReaderBufferControl
public void setEventAcquisitionEnabled(boolean enable)
throws HardwareInterfaceException
setEventAcquisitionEnabled in interface AEMonitorInterfaceenable - true to start, false to stop
HardwareInterfaceExceptionpublic boolean isEventAcquisitionEnabled()
isEventAcquisitionEnabled in interface AEMonitorInterfacepublic void addAEListener(AEListener listener)
AEMonitorInterface
addAEListener in interface AEMonitorInterfacelistener - will be called after each AEMonitorInterface.acquireAvailableEventsFromDriver() callpublic void removeAEListener(AEListener listener)
AEMonitorInterface
removeAEListener in interface AEMonitorInterfacelistener - to removepublic int getMaxCapacity()
AEMonitorInterface
getMaxCapacity in interface AEMonitorInterfacepublic int getEstimatedEventRate()
AEMonitorInterface
getEstimatedEventRate in interface AEMonitorInterfacepublic int getTimestampTickUs()
getTimestampTickUs in interface AEMonitorInterfacepublic java.lang.String[] getStringDescriptors()
USBInterface
getStringDescriptors in interface USBInterfacepublic int[] getVIDPID()
USBInterface
getVIDPID in interface USBInterfacepublic short getVID()
getVID in interface USBInterfacepublic short getPID()
getPID in interface USBInterfacepublic short getDID()
getDID in interface USBInterfacepublic java.lang.String getTypeName()
HardwareInterface
getTypeName in interface HardwareInterfacepublic void close()
HardwareInterface
close in interface HardwareInterface
public void open()
throws HardwareInterfaceException
HardwareInterface
open in interface HardwareInterfaceHardwareInterfaceException - if there is a problem. Diagnostics are printeds.public boolean isOpen()
isOpen in interface HardwareInterfacepublic void labelRightEye(AEPacketRaw aeRawRight)
aeRawRight - public void labelLeftEye(AEPacketRaw aeRaw)
aeRaw - public boolean isIgnoreTimestampNonmonotonicity()
public void setIgnoreTimestampNonmonotonicity(boolean yes)
yes - true to not order timestamps from the two interfaces.
|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||