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 event

  • t – Timestamp of the event (in us)

  • id – ID of the external trigger

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 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)

Reads EventExtTrigger from buffer.

static inline size_t get_raw_event_size()

Returns raw event size.