SDK Driver Pipeline

For a basic usage guide, refer to Pipeline.

class Metavision::CameraStage : public Metavision::BaseStage

Producing stage to generate EventCD buffers and/or EventExtTrigger from a Camera.

The CD events buffer producing part uses the SharedEventsBufferProducerAlgorithm allowing to tune further the way you want to build the CD events buffers.

Default usage:

int main(void) {
    // Opens a camera
    auto cam = Camera::from_first_available();

    // Creates a pipeline object
    Pipeline p;

    // Add the Camera producing stage to the pipeline
    auto &cam_stage = p.add_stage(std::make_unique<CameraStage>(std::move(cam)));

    // Runs the pipeline
    p.run();

    return 0;
}

Using SharedEventsBufferProducerAlgorithm capabilities:

int main(void) {
    auto camera = Camera::from_first_available();

    // Creates a pipeline object
    Pipeline p;

    SharedEventsBufferProducerParameters parameters;
    parameters.buffers_time_slice_us_ = 5000;

    // Will produce buffers containing 5 ms of events for the next consuming stage.
    auto &cam_stage = p.add_stage(std::make_unique<CameraStage>(std::move(cam), parameters));

    // Runs the pipeline
    p.run();

    return 0;
}

See also

Pipeline BaseStage

Public Functions

inline CameraStage(Camera &&camera, SharedEventsBufferProducerParameters buffer_producer_parameters, bool enable_cd_events_callback = true)

Constructor.

Parameters
  • camera – Camera producing the input events

  • buffer_producer_parameters – Buffer to use by the CD events buffer producing part

  • enable_cd_events_callback – If true, enables the callback of CD events

inline CameraStage(Camera &&camera, timestamp buffer_duration_ms = 1, bool enable_cd_events_callback = true)

Constructor.

Parameters
  • camera – Camera producing the input events

  • buffer_duration_ms – Time slice (in milliseconds) to use in the SharedEventsBufferProducerParameters used by the CD events buffer producing part

  • enable_cd_events_callback – If true, enables the callback of CD events

inline void add_ext_trigger_events(const EventExtTrigger *begin, const EventExtTrigger *end)

Adds trigger events.

Parameters
inline Camera &camera()

Gets Camera.

Returns

Camera used in the stage