SDK Driver Camera Features

class Metavision::AntiFlickerModule

Facility class to handle anti-flicker configuration on the hardware side.

Public Functions

AntiFlickerModule(I_AntiFlickerModule *afk)

Constructor.

~AntiFlickerModule()

Destructor.

void enable()

Enables the anti-flicker filter.

void disable()

Disables the anti-flicker filter.

void set_frequency(uint32_t frequency_center, uint32_t bandwidth, bool stop = true)

Sets anti-flicker parameters.

Defines the frequency band to be kept or removed : [frequency_center - bandwidth/2, frequency_center + bandwidth/2] This frequency range should be in the range [50 - 500] Hz

Note

band-stop removes all frequencies between min and max

band-pass removes all events outside of the band sequence defined

Parameters
  • frequency_center – Center of the frequency band (in Hz)

  • bandwidth – Range of frequencies around the frequency_center (in Hz)

  • stop – If true, band-stop (by default); if false, band-pass

Throws

exception – if frequency band is not in the range [50 - 500] Hz

void set_frequency_band(uint32_t min_freq, uint32_t max_freq, bool stop = true)

Sets anti-flicker parameters.

Defines the frequency band to be kept or removed in the range [50 - 500] Hz

Note

band-stop removes all frequencies between min and max

band-pass removes all events outside of the band sequence defined

Parameters
  • min_freq – Lower frequency of the band (in Hz)

  • max_freq – Higher frequency of the band (in Hz)

  • stop – If true, band-stop; if false, band-pass

Throws

exception – if frequencies are outside of the range [50 - 500] Hz

I_AntiFlickerModule *get_facility() const

Gets corresponding facility in HAL library.

class Metavision::Biases

Facility class to handle biases.

Public Functions

Biases(I_LL_Biases *i_ll_biases)

Constructor.

~Biases()

Destructor.

void set_from_file(const std::string &biases_filename)

Sets camera biases from a bias file at biases_filename.

Throws

CameraException – in case of failure. This could happen for example if given path does not exists.

Parameters

biases_filename – Path to the bias file used to configure the camera

void save_to_file(const std::string &dest_file) const

Save the current biases into a file.

Parameters

dest_file – the destination file

I_LL_Biases *get_facility() const

Get corresponding facility in HAL library.

enum Metavision::CameraErrorCode::Enum

Values:

enumerator CameraError

Base Metavision SDK Driver camera error.

enumerator FailedInitialization

Camera failed initialization.

enumerator CameraNotFound

Failed initialization due to a camera not found.

enumerator InternalInitializationError

Metavision SDK Driver Internal Initialization problem.

enumerator RuntimeError

Camera runtime errors.

enumerator BiasesError

Fails to set biases.

enumerator CameraNotInitialized

Error due to a non initialized camera.

enumerator InvalidRawfile

Invalid RAW file.

enumerator DataTransferFailed

Error while retrieving data from source.

enumerator RoiError

Fails to set ROI.

enumerator UnsupportedFeature

Error while trying to use a feature unsupported by the camera.

enumerator FirmwareIsNotUpToDate

Device firmware is not up to date.

enumerator DeprecatedFeature

Error while trying to use a deprecated feature.

enumerator InvalidArgument

Errors related to invalid arguments.

enumerator FileDoesNotExist

File does not exist.

enumerator NotARegularFile

File is not a regular file.

enumerator WrongExtension

File extension is not the one expected.

enumerator CouldNotOpenFile

Could not open file.

class Metavision::CameraException : public std::system_error

Class for all exceptions thrown by Metavision SDK Driver.

Public Functions

CameraException(CameraErrorCodeType e)

Creates an exception of type e with default error message.

See also

CameraErrorCode

Parameters

e – Camera error code

CameraException(CameraErrorCodeType e, std::string additional_info)

Creates an exception of type e with an error description in additional_info.

See also

CameraErrorCode

Parameters
  • e – Camera error code

  • additional_info – error description

class Metavision::CameraGeneration

Facility class to handle camera generation.

Public Functions

virtual ~CameraGeneration()

Destructor.

Deletes a CameraGeneration class instance.

short version_major() const

Returns the major version of the camera’s generation.

short version_minor() const

Returns the minor version of the camera’s generation.

bool operator==(const CameraGeneration &c) const

overrides “equal to” operator

bool operator!=(const CameraGeneration &c) const

overrides “not equal to” operator

bool operator<(const CameraGeneration &c) const

overrides “less than” operator

bool operator<=(const CameraGeneration &c) const

overrides “less than or equal to” operator

bool operator>(const CameraGeneration &c) const

overrides “greater than” operator

bool operator>=(const CameraGeneration &c) const

overrides “greater than or equal to” operator

Private &get_pimpl()

For internal use.

class Metavision::CD

Facility class to handle CD events.

Public Functions

virtual ~CD()

Destructor.

Deletes a CD class instance.

CallbackId add_callback(const EventsCDCallback &cb)

Subscribes to CD events.

Registers a callback that will be called each time a buffer of eventCD has been decoded.

See also

EventsCDCallback

Parameters

cb – Callback to call each time a buffer of eventCD has been decoded

Returns

ID of the added callback

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

See also

add_callback

Parameters

callback_id – Callback ID

Returns

true if the callback has been unregistered correctly, false otherwise.

Private &get_pimpl()

For internal use.

class Metavision::ErcModule

Facility class for Event Rate Controller (ERC) commands.

Public Functions

ErcModule(I_Erc *ierc)

Constructor.

~ErcModule()

Destructor.

void enable(bool b)

Toggles ERC activation.

Note

When ERC is inactive, all the events generated by the sensor are transmitted. Potential bandwidth limitation might occur.

Parameters

b – Desired state. b = true means ERC active, and b = false means ERC inactive.

bool is_enabled()

Returns ERC activation state.

Returns

The ERC state

void set_cd_event_rate(uint32_t events_per_sec)

Sets the target CD event rate of the ERC.

Note

Event rate is computed by ERC block as the number of events generated by the sensor divided by the count period.

Parameters

events_per_sec – Event rate expressed in events per second

uint32_t get_cd_event_rate()

Gets the CD event rate set point of the ERC.

Note

See set_cd_event_rate to define the event rate target.

Returns

The event rate expressed in events per second

I_Erc *get_facility() const

Gets corresponding facility in HAL library.

class Metavision::ExtTrigger

Facility class to handle External Triggers events.

Public Functions

virtual ~ExtTrigger()

Destructor.

Deletes an ExtTrigger class instance.

CallbackId add_callback(const EventsExtTriggerCallback &cb)

Subscribes to external trigger events.

Registers a callback that will be called each time a buffer of external trigger event has been decoded.

See also

EventsExtTriggerCallback

Parameters

cb – Callback to call each time a buffer of ext trigger event has been decoded

Returns

ID of the added callback

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

See also

add_callback

Parameters

callback_id – Callback ID

Returns

true if the callback has been unregistered correctly, false otherwise.

Private &get_pimpl()

For internal use.

Warning

doxygenclass: Cannot find class “Metavision::ERCCounter” in doxygen xml output for project “SDKdriver” from directory: /data/work/_build/generated/doc_build/driver/doxygen/xml

class Metavision::Geometry

Facility class to get the geometry of a Device.

Public Functions

Geometry(I_Geometry *geom)

Constructor.

~Geometry()

Destructor.

int width() const

Width of the sensor.

int height() const

Height of the sensor.

I_Geometry *get_facility() const

Gets corresponding facility in HAL library.

Warning

doxygenclass: Cannot find class “Metavision::IlluminanceModule” in doxygen xml output for project “SDKdriver” from directory: /data/work/_build/generated/doc_build/driver/doxygen/xml

Warning

doxygenclass: Cannot find class “Metavision::ImuModule” in doxygen xml output for project “SDKdriver” from directory: /data/work/_build/generated/doc_build/driver/doxygen/xml

class Metavision::NoiseFilterModule

Facility class to handle noise filter module configuration on the hardware side.

The types of noise filter are Spatio-Temporal Contrast (STC) and Trail.

Public Functions

NoiseFilterModule(I_NoiseFilterModule *noise_filter)

Constructor.

~NoiseFilterModule()

Destructor.

void enable(I_NoiseFilterModule::Type type, uint32_t threshold)

Enables the NoiseFilterModule in the mode STC or Trail with the corresponding threshold.

Note

STC keeps the second event within a burst of events with the same polarity Trail keeps the first event within a burst of events with the same polarity

Parameters
  • type – Defines the type of the filter

  • threshold – Delay in microsecond between two bursts of events

void disable()

Disables filtering.

No events are removed by this filter anymore.

I_NoiseFilterModule *get_facility() const

Gets corresponding facility in HAL library.

class Metavision::OfflineStreamingControl

Facility class to control offline streaming features.

Public Functions

bool is_ready() const

Checks if all features of the offline streaming control are ready.

Note

You should make sure this function returns true before making any other calls

Returns

true if all features are ready, false otherwise

bool seek(Metavision::timestamp ts)

Seek to a specified timestamp.

Parameters

ts – Timestamp to seek to

Returns

True if seeking succeeded, false otherwise

Metavision::timestamp get_seek_start_time() const

Gets the first reachable timestamp that can be seeked to.

Returns

Metavision::timestamp First timestamp to seek to

Metavision::timestamp get_seek_end_time() const

Gets the last reachable timestamp that can be seeked to.

Returns

Metavision::timestamp Last timestamp to seek to

Metavision::timestamp get_duration() const

Gets the duration of the recording.

Returns

Metavision::timestamp Duration of the recording

Private &get_pimpl()

For internal use.

class Metavision::RawData

Facility class to handle RAW data.

Public Functions

virtual ~RawData()

Destructor.

Deletes a RawData class instance.

CallbackId add_callback(const RawDataCallback &cb)

Subscribes to RAW data callback.

Registers a callback that will be called each time a buffer of RAW data has been received.

See also

RawDataCallback

Note

This callback is always called after all events callbacks have been called, with the raw data buffer used to decode the events that are passed to the events callback.

Parameters

cb – Callback to call each time a buffer of RAW data has been received

Returns

ID of the added callback

bool remove_callback(CallbackId callback_id)

Removes a previously registered callback.

See also

add_callback

Parameters

callback_id – Callback ID

Returns

true if the callback has been unregistered correctly, false otherwise.

Private &get_pimpl()

For internal use.

class Metavision::Roi

Facility class to handle a Region Of Interest (ROI)

Public Functions

Roi(I_ROI *roi)

Constructor.

~Roi()

Destructor.

void set(Rectangle roi)

Sets an hardware ROI on the sensor.

When an ROI is set successfully, no events will be output by the sensor outside of this ROI. Since this is a hardware ROI, there is no processing added to filter the events. Setting an ROI will unset any previously set ROI.

Parameters

roi – The ROI to set on the sensor

void set(const std::vector<bool> &cols_to_enable, const std::vector<bool> &rows_to_enable)

Sets several rectangular hardware ROI from binary maps of lines and columns.

The binary map arguments must have the sensor’s dimension. Throws a CameraException if input doesn’t have the correct size.

Parameters
  • cols_to_enable – vector of boolean of size sensor’s width representing the binary map of the columns to disable (0) or to enable (1)

  • rows_to_enable – vector of boolean of size sensor’s height representing the binary map of the rows to disable (0) or to enable (1)

void set(const std::vector<Rectangle> &to_set)

Sets several rectangular hardware ROI from Roi::Rectangle vector.

Any line or column enabled by a single ROI is also enabled for all the other. Example: Input vector is composed with 2 rois (0, 0, 50, 50), (100, 100, 50, 50). In the sensor, it will result in 4 regions:

  • (0, 0, 50, 50)

  • (0, 100, 50, 50)

  • (100, 0, 50, 50)

  • (100, 100, 50, 50) Indeed, rows and columns from 0 to 50 and 100 to 150 are enabled.

Example: Input vector is composed with 2 ROIs: (0, 0, 50, 50), (25, 25, 50, 50). In the sensor, it will result in a single region: (0, 0, 75, 75)

Parameters

to_set – a vector of Roi::Rectangle

void unset()

Unsets any set ROI on the sensor.

I_ROI *get_facility() const

Gets corresponding facility in HAL library.

struct Rectangle

Basic struct used to set a hardware region of interest (ROI) - a rectangle - on the sensor.

This struct defines an ROI of with*height pixels going from [x, y] to [x + width -1, y + height -1]

Public Members

int x = 0

ROI top left column coordinate of the ROI.

int y = 0

ROI top left row coordinate of the ROI.

int width = 0

Width of the ROI.

int height = 0

Height of the ROI.

Warning

doxygenclass: Cannot find class “Metavision::TemperatureModule” in doxygen xml output for project “SDKdriver” from directory: /data/work/_build/generated/doc_build/driver/doxygen/xml

class Metavision::TriggerOut

Trigger out signal handler class.

The trigger out is a signal generator. Its purpose is to synchronize two (or more) devices.

The configurable signal through this interface is a periodic 1 microsecond pulse.

Public Functions

TriggerOut(I_TriggerOut *i_trigger_out)

Constructor.

virtual ~TriggerOut()

Destructor.

void set_pulse_period(uint32_t period_us)

Sets the trigger out signal pulse period.

By default, the system has a period of 100 us meaning that, when enabled, a pulse of 1 microsecond will occur every 100us.

Parameters

period_us – the signal period in microseconds.

void set_duty_cycle(double period_ratio)

Sets the duty cycle of the trigger out signal i.e. the pulse duration.

The duty cycle represents the part of the signal during which its value is 1 (0 otherwise). Duty cycle represents the quantity pulse_width_us/period_us and thus must be in the range [0, 1]. The period is set with set_pulse_period.

Setting a duty cycle of 0.5 (50%) means that the value of the signal is 1 during the first half of each period, and 0 during the second half.

Parameters

period_ratio – Ratio representing pulse_width_us/period_us which must be in the range [0, 1] (value is clamped in this range otherwise)

void enable()

Enables the trigger out signal.

void disable()

Disables the trigger out signal.

I_TriggerOut *get_facility() const

Get corresponding facility in HAL library.