|
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 AEMonitorInterface
chip
- the chippublic AEChip getChip()
AEMonitorInterface
getChip
in interface AEMonitorInterface
public AEMonitorInterface getAemonLeft()
public void setAemonLeft(AEMonitorInterface aemonLeft)
public AEMonitorInterface getAemonRight()
public void setAemonRight(AEMonitorInterface aemonRight)
public AEPacketRaw acquireAvailableEventsFromDriver() throws HardwareInterfaceException
AEMonitorInterface
HardwareInterfaceException
is thrown if there is an error.
acquireAvailableEventsFromDriver
in interface AEMonitorInterface
HardwareInterfaceException
- .public int getNumEventsAcquired()
AEMonitorInterface
AEMonitorInterface.acquireAvailableEventsFromDriver()
getNumEventsAcquired
in interface AEMonitorInterface
public AEPacketRaw getEvents()
AEMonitorInterface
AEMonitorInterface.acquireAvailableEventsFromDriver()
getEvents
in interface AEMonitorInterface
public void resetTimestamps()
resetTimestamps
in interface AEMonitorInterface
public boolean overrunOccurred()
AEMonitorInterface
AEMonitorInterface.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 AEMonitorInterface
public int getAEBufferSize()
AEMonitorInterface
getAEBufferSize
in interface AEMonitorInterface
public void setAEBufferSize(int AEBufferSize)
setAEBufferSize
in interface AEMonitorInterface
AEBufferSize
- the size in eventspublic int getFifoSize()
getFifoSize
in interface ReaderBufferControl
public void setFifoSize(int fifoSize)
setFifoSize
in interface ReaderBufferControl
public int getNumBuffers()
getNumBuffers
in interface ReaderBufferControl
public void setNumBuffers(int numBuffers)
setNumBuffers
in interface ReaderBufferControl
public void setEventAcquisitionEnabled(boolean enable) throws HardwareInterfaceException
setEventAcquisitionEnabled
in interface AEMonitorInterface
enable
- true to start, false to stop
HardwareInterfaceException
public boolean isEventAcquisitionEnabled()
isEventAcquisitionEnabled
in interface AEMonitorInterface
public void addAEListener(AEListener listener)
AEMonitorInterface
addAEListener
in interface AEMonitorInterface
listener
- will be called after each AEMonitorInterface.acquireAvailableEventsFromDriver()
callpublic void removeAEListener(AEListener listener)
AEMonitorInterface
removeAEListener
in interface AEMonitorInterface
listener
- to removepublic int getMaxCapacity()
AEMonitorInterface
getMaxCapacity
in interface AEMonitorInterface
public int getEstimatedEventRate()
AEMonitorInterface
getEstimatedEventRate
in interface AEMonitorInterface
public int getTimestampTickUs()
getTimestampTickUs
in interface AEMonitorInterface
public java.lang.String[] getStringDescriptors()
USBInterface
getStringDescriptors
in interface USBInterface
public int[] getVIDPID()
USBInterface
getVIDPID
in interface USBInterface
public short getVID()
getVID
in interface USBInterface
public short getPID()
getPID
in interface USBInterface
public short getDID()
getDID
in interface USBInterface
public java.lang.String getTypeName()
HardwareInterface
getTypeName
in interface HardwareInterface
public void close()
HardwareInterface
close
in interface HardwareInterface
public void open() throws HardwareInterfaceException
HardwareInterface
open
in interface HardwareInterface
HardwareInterfaceException
- if there is a problem. Diagnostics are printeds.public boolean isOpen()
isOpen
in interface HardwareInterface
public 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 |