DAVIS
pyaer.davis.DAVIS(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='', noise_filter=False)
DAVIS.
Arguments
- device_id:
int
a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
default is 1
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
- noise_filter:
bool
if enable noise filter.
default is False
DAVISFX2
pyaer.davis.DAVISFX2(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='', noise_filter=False)
DAVIS FX2.
Arguments
- device_id:
int
a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
default is 1
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
- noise_filter:
bool
if enable noise filter.
default is False
DAVISFX3
pyaer.davis.DAVISFX3(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='', noise_filter=False)
DAVIS FX3.
Arguments
- device_id:
int
a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
default is 1
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
- noise_filter:
bool
if enable noise filter.
default is False
DAVISRPI
pyaer.davis.DAVISRPI(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='', noise_filter=False)
DAVIS RPI.
Arguments
- device_id:
int
a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
default is 1
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
- noise_filter:
bool
if enable noise filter.
default is False
obtain_device_info
obtain_device_info(handle)
Obtain DAVIS info.
This function collects the following information from the device:
- Deveice ID
- Device serial number
- Device USB bus number
- Device USB device address
- Device string
- Logic version
- If the device is the master device
- Logic clock
- ADC clock
- Chip ID
- Camera DVS width
- Camera DVS height
- If the device has pixel filter
- If the device has hardware background activity filter
- If the device has test event generator
- Camera APS width
- Camera APS height
- APS color filter
- If the device has APS global shutter
- If the device has APS quad ROI
- If the device has APS external ADC
- If the device has APS internal ADC
- If external input has generator
- If external input has extra detectors
- If the device has DVS ROI filter
- If the device has DVS statistics
- If the device has MUX statistics
Arguments
- handle:
caerDeviceHandle
a valid device handle that can be used with the otherlibcaer
functions, orNone
on error.
open
open(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='')
Open DAVIS device.
Arguments
- device_id:
int
a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
default is 1
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
set_bias_from_json
set_bias_from_json(file_path, verbose=False)
Set bias from loading JSON configuration file.
Arguments
- file_path:
str
absolute path of the JSON bias file. - verbose:
bool
optional debugging message.
set_cf_bias
set_cf_bias(param_addr, param, coarse, fine, mode)
Setting coarse fine bias.
Arguments
- param_addr:
int
a parameter address, to select a specific parameter to update from this particular configuration module. Only positive numbers (including zero) are allowed. - param:
int
orbool
a configuration parameter's new value. - coarse:
int
coarae value - fine:
int
fine value - mode:
setting mode
n_type
,p_type
,n_cas_type
,n_off_type
,p_off_type
,vdac
set_bias
set_bias(bias_obj)
Set bias from bias dictionary.
Arguments
- bias_obj:
dict
dictionary that contains DAVIS biases.
Returns
- flag:
bool
True if set successful, False otherwise.
get_cf_bias
get_cf_bias(param_addr, param)
Get coarse-fine bias.
Arguments
- param_addr:
int
a parameter address, to select a specific parameter to update from this particular configuration module. Only positive numbers (including zero) are allowed. - param:
int
orbool
a configuration parameter's new value.
Returns
- coarse_value:
uint
coarse value - fine_value:
uint
fine value
get_bias
get_bias()
Get bias settings.
Returns
- bias_obj:
dict
dictionary that contains DAVIS current bias settings.
save_bias_to_json
save_bias_to_json(file_path)
Save bias to JSON.
Arguments
- file_path:
str
the absolute path to the destiation.
Returns
- flag:
bool
returns True if success in writing, False otherwise.
start_data_stream
start_data_stream(send_default_config=True)
Start streaming data.
Arguments
- send_default_config:
bool
send default config to the device before starting the data streaming.
default is True
set_noise_filter
set_noise_filter(noise_filter)
Set noise filter.
Arguments
- noise_filter:
filters.DVSNoise
A validDVSNoise
object. This filter implements software-level background activity filter.
enable_noise_filter
enable_noise_filter()
Enalbe DVS noise filter.
This function enables the DVS noise filter.
Note that this function will initialize a DVSNoise
filter
if there is None.
disable_noise_filter
disable_noise_filter()
Disable noise filter.
This method disable the noise filter. Note that this function doesn't destroy the existed noise filter. It simply switches off the function.
get_polarity_event
get_polarity_event(packet_header, noise_filter=False)
Get a packet of polarity event.
Arguments
- packet_header:
caerEventPacketHeader
the header that represents a event packet - noise_filter:
bool
the background activity filter is applied if True.
Returns
- events:
numpy.ndarray
a 2-D array that has the shape of (N, 4) where N is the number of events in the event packet. Each row in the array represents a single polarity event. The first number is the timestamp. The second number is the X position of the event. The third number is the Y position of the event. The fourth number represents the polarity of the event (positive or negative).
If thenoise_filter
option is set toTrue
, this array has an additional column at the end. The last column represents the validity of the corresponding event. Filtered events will be marked as 0. - num_events:
int
number of the polarity events available in the packet.
get_event
get_event()
Get Event.
Returns
- pol_events:
numpy.ndarray
a 2-D array that has the shape of (N, 4) where N is the number of events in the event packet. Each row in the array represents a single polarity event. The first number is the timestamp. The second number is the X position of the event. The third number is the Y position of the event. The fourth number represents the polarity of the event (positive or negative).
If thenoise_filter
option is set toTrue
, this array has an additional column at the end. The last column represents the validity of the corresponding event. Filtered events will be marked as 0. - num_pol_events:
int
number of the polarity events available in the packet. - special_events:
numpy.ndarray
a 2-D array that has the shape of (N, 2) where N is the number of events in the event packet. Each row in the array represents a single special event. The first value is the timestamp of the event. The second value is the special event data. - num_special_events:
int
number of the special events in the packet. - frames_ts:
numpy.ndarray
the APS frame timestamps. - frames:
numpy.ndarray
a 3-D array that has the shape of (N, height, width). The height and width of the APS frame is determined by the specific DAVIS device (e.g., DAVIS240 will have a 180x240 APS frame. - imu_events:
numpy.ndarray
a 2-D array that has the shape of (N, 8) where N is the number of IMU6 events in the packet. Each row of the array consists a single IMU6 event. The first value is the timestamp of the event. The next three values are accelerations on the X, Y, and Z axes. The next three values are angular velocity on the X, Y and Z axes. The last value is the temperature in Celsius scale. - num_imu_events:
int
number of the IMU6 events.
DAVIS240C Bias Example
{ "DiffBn_coarse": 4, "DiffBn_fine": 39, "ONBn_coarse": 6, "ONBn_fine": 200, "OFFBn_coarse": 4, "OFFBn_fine": 0, "APSCasEPC_coarse": 5, "APSCasEPC_fine": 185, "DiffCasBNC_coarse": 5, "DiffCasBNC_fine": 115, "APSROSFBn_coarse": 6, "APSROSFBn_fine": 219, "LocalBufBn_coarse": 5, "LocalBufBn_fine": 164, "PixInvBn_coarse": 5, "PixInvBn_fine": 129, "PrBp_coarse": 2, "PrBp_fine": 58, "PrSFBp_coarse": 1, "PrSFBp_fine": 33, "RefrBp_coarse": 4, "RefrBp_fine": 25, "AEPdBn_coarse": 6, "AEPdBn_fine": 91, "LcolTimeoutBn_coarse": 5, "LcolTimeoutBn_fine": 49, "AEPuXBp_coarse": 4, "AEPuXBp_fine": 80, "AEPuYBp_coarse": 7, "AEPuYBp_fine": 152, "IFThrBn_coarse": 5, "IFThrBn_fine": 255, "IFRefrBn_coarse": 5, "IFRefrBn_fine": 255, "PadFollBn_coarse": 7, "PadFollBn_fine": 215, "APSOverflowLevelBn_coarse": 6, "APSOverflowLevelBn_fine": 253, "BiasBuffer_coarse": 5, "BiasBuffer_fine": 254, "aps_enabled": true, "dvs_enabled": true, "exposure": 4000, "autoexposure": true, "frame_delay": 0, "imu_enabled": true, "imu_acc_scale": 3, "imu_gyro_scale": 3, "imu_low_pass_filter": 0, "noise_filter_configs": { "sw_background_activity_two_levels": true, "sw_background_activity_check_polarity": true, "sw_background_activity_support_min": 2, "sw_background_activity_support_max": 8, "sw_background_activity_time": 2000, "sw_background_activity_enable": true, "sw_refractory_period_time": 200, "sw_refractory_period_enable": true, "sw_hotpixel_enable": true, "sw_hotpixel_learn": true } }
DAVIS346B Bias Example
{ "ADC_RefHigh_volt": 24, "ADC_RefHigh_curr": 7, "ADC_RefLow_volt": 1, "ADC_RefLow_curr": 7, "LocalBufBn_coarse": 5, "LocalBufBn_fine": 164, "PadFollBn_coarse": 7, "PadFollBn_fine": 215, "DiffBn_coarse": 4, "DiffBn_fine": 39, "ONBn_coarse": 6, "ONBn_fine": 255, "OFFBn_coarse": 4, "OFFBn_fine": 0, "PixInvBn_coarse": 5, "PixInvBn_fine": 129, "PrBp_coarse": 2, "PrBp_fine": 255, "PrSFBp_coarse": 1, "PrSFBp_fine": 199, "RefrBp_coarse": 3, "RefrBp_fine": 7, "ReadoutBufBp_coarse": 6, "ReadoutBufBp_fine": 20, "APSROSFBn_coarse": 6, "APSROSFBn_fine": 219, "ADCCompBp_coarse": 5, "ADCCompBp_fine": 20, "COLSELLowBn_coarse": 0, "COLSELLowBn_fine": 1, "DACBufBp_coarse": 6, "DACBufBp_fine": 60, "LcolTimeoutBn_coarse": 5, "LcolTimeoutBn_fine": 49, "AEPdBn_coarse": 6, "AEPdBn_fine": 91, "AEPuXBp_coarse": 4, "AEPuXBp_fine": 80, "AEPuYBp_coarse": 7, "AEPuYBp_fine": 152, "IFRefrBn_coarse": 5, "IFRefrBn_fine": 255, "IFThrBn_coarse": 5, "IFThrBn_fine": 255, "BiasBuffer_coarse": 5, "BiasBuffer_fine": 254, "aps_enabled": true, "dvs_enabled": true, "exposure": 4000, "autoexposure": true, "frame_delay": 0, "imu_enabled": true, "imu_acc_scale": 3, "imu_gyro_scale": 3, "imu_low_pass_filter": 0, "background_activity_filter_enabled": false, "background_activity_filter_time": 80, "refractory_period_enabled": true, "refractory_period_time": 2, "noise_filter_configs": { "sw_background_activity_two_levels": true, "sw_background_activity_check_polarity": true, "sw_background_activity_support_min": 2, "sw_background_activity_support_max": 8, "sw_background_activity_time": 2000, "sw_background_activity_enable": true, "sw_refractory_period_time": 200, "sw_refractory_period_enable": true, "sw_hotpixel_enable": true, "sw_hotpixel_learn": true } }