SDK Base Events

class Metavision::Event2d

Class representing basic 2D events:

  • Contrast Detection -CD- event

  • Exposure Measurement -EM- event

Subclassed by Metavision::EventCD, Metavision::EventEM

Public Functions

Event2d() = default

Default constructor.

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.

EventCD(const Event2d &ev)

Constructor from Event2d.

Event2d() = default

Default constructor.

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.

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

void write_event(void *buf, timestamp origin) const

Writes EventExtTrigger in buffer.

EventExtTrigger shifted(timestamp dt)

Function shifted returning class EventExtTrigger.

bool operator<(const EventExtTrigger &e) const

Event timestamp comparison operator.

bool operator<=(const EventExtTrigger &e) const

Event timestamp comparison operator.

bool operator>(const EventExtTrigger &e) const

Event timestamp comparison operator.

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

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

Reads EventExtTrigger encoded in an old format from buffer.

EventExtTrigger read_event(void *buf, const timestamp &delta_ts)

Reads EventExtTrigger from buffer.

size_t get_raw_event_size()

Returns raw event size.