SDK Base Events

class Metavision::Event2d

Class representing basic 2D events:

  • Contrast Detection -CD- event

  • Exposure Measurement -EM- event

Subclassed by Metavision::EventCD

Public Functions

Event2d() = default

Default constructor.

inline Event2d(unsigned short x, unsigned short y, short p, timestamp t)

Constructor.

Parameters
  • x – Column position of the event in the sensor

  • y – Row position of the event in the sensor

  • p – Polarity specialising the event

  • t – Timestamp of the event (in us)

Public Members

unsigned short x

Column position in the sensor at which the event happened.

unsigned short y

Row position in the sensor at which the event happened.

short p

Polarity, whose value depends on the type of the event (CD or EM)

  • In case of CD event: polarity representing the change of contrast

    • 1: a positive contrast change

    • 0: a negative contrast change

  • In case of EM event: polarity representing the exposure measurement type

    • 1: EM high i.e. the exposure measurement begins

    • 0: EM low i.e. the exposure measurement ends

timestamp t

Timestamp at which the event happened (in us)

class Metavision::EventCD : public Metavision::Event2d

Class representing basic 2D CD (Contrast Detection) events:

Public Functions

EventCD() = default

Default constructor.

inline EventCD(const Event2d &ev)

Constructor from Event2d.

Event2d() = default

Default constructor.

inline Event2d(unsigned short x, unsigned short y, short p, timestamp t)

Constructor.

Parameters
  • x – Column position of the event in the sensor

  • y – Row position of the event in the sensor

  • p – Polarity specialising the event

  • t – Timestamp of the event (in us)

class Metavision::EventExtTrigger

Class representing an external trigger event.

Public Functions

EventExtTrigger() = default

Default constructor.

inline EventExtTrigger(short p, timestamp t, short id)
Parameters
  • p – Polarity of the external trigger event

  • t – Timestamp of the external trigger event (in us)

  • id – Channel ID of the external trigger event

inline void write_event(void *buf, timestamp origin) const

Writes EventExtTrigger in buffer.

inline EventExtTrigger shifted(timestamp dt)

Function shifted returning class EventExtTrigger.

inline bool operator==(const EventExtTrigger &e) const

Event comparison operator.

inline bool operator<(const EventExtTrigger &e) const

Event timestamp comparison operator.

inline bool operator<=(const EventExtTrigger &e) const

Event timestamp comparison operator.

inline bool operator>(const EventExtTrigger &e) const

Event timestamp comparison operator.

inline bool operator>=(const EventExtTrigger &e) const

Event timestamp comparison operator.

Public Members

short p

Polarity representing the change of contrast (1: positive, 0: negative)

timestamp t

Timestamp at which the event happened (in us)

short id

ID of the external trigger.

Public Static Functions

static inline EventExtTrigger read_event_v1(void *buf, const timestamp &delta_ts)

Reads EventExtTrigger encoded in an old format from buffer.

static inline EventExtTrigger read_event(void *buf, const timestamp &delta_ts = 0)

Reads EventExtTrigger from buffer.

static inline size_t get_raw_event_size()

Returns raw event size.

class Metavision::EventERCCounter

Class representing event notification from Event Rate Controller counting events.

Public Functions

EventERCCounter() = default

Default constructor.

inline EventERCCounter(timestamp t, uint64_t count, bool erc_output_counter)

Constructor.

Parameters
  • t – Timestamp of the event (in us)

  • count – number of CD events received

  • erc_output_counter – whether count represents number of events output by ERC

Public Members

timestamp t

Timestamp at which the event happened (in us)

uint64_t event_count

number of events counted

bool is_output

states whether the count number represents events that were output by the ERC

class Metavision::RawEventFrameHisto

Class representing a histogram of CD events: Event data is presented as a “frame” of accumulated events, with two channels per pixel. The first channel being the number of negative events and the second channel being the number of positive events.

Public Functions

RawEventFrameHisto() = default

Default constructor.

inline RawEventFrameHisto(unsigned height, unsigned width, unsigned channel_bit_neg = 4, unsigned channel_bit_pos = 4, bool packed = false)

Constructor.

Throws

invalid_argument – if either bit size is zero or if their sum is more than 8

inline RawEventFrameHisto(const RawEventFrameHistoConfig &cfg, const std::vector<uint8_t> &data)

Constructor.

Throws

invalid_argument – if either bit size is zero or if their sum is more than 8

inline RawEventFrameHisto(const RawEventFrameHisto &h)

Copy constructor.

inline void reset(unsigned height, unsigned width, unsigned channel_bit_neg = 4, unsigned channel_bit_pos = 4, bool packed = false)

Resets the event frame configuration and sets all values to 0.

Throws

invalid_argument – if either bit size is zero or if their sum is more than 8

inline void reset()

Reset all values in the event frame to 0.

class Metavision::RawEventFrameDiff

Class representing a cumulative difference histogram of CD events: Event data is presented as a “frame” of accumulated events, with two channels per pixel. The first channel being the number of negative events and the second channel being the number of positive events.

Public Functions

RawEventFrameDiff() = default

Default constructor.

inline RawEventFrameDiff(unsigned height, unsigned width, unsigned bit_size = 8)

Constructor.

Throws

invalid_argument – if bit_size is outside the supported range of [2;8].

inline RawEventFrameDiff(const RawEventFrameDiffConfig &cfg, const std::vector<int8_t> &data)

Constructor.

Throws

invalid_argument – if cfg.bit_size is outside the supported range of [2;8].

inline RawEventFrameDiff(const RawEventFrameDiff &d)

Copy constructor.

inline void reset(unsigned height, unsigned width, unsigned bit_size = 8)

Resets the event frame configuration and sets all values to 0.

Throws

invalid_argument – if bit_size is outside the supported range of [2;8].

inline void reset()

Reset all values in the event frame to 0.

class Point3D

Class representing a 3D point:

class Metavision::PointCloud

Class representing a point cloud frame of 3D events.

Public Members

unsigned int frame_id

Frame number.

float max_depth

Maximum depth within the frame.

std::vector<Point3D> points

List of 3D events.

class Point3D

Class representing a 3D point: