Introduction & Plugin Configuration

Developing applications for event-based devices begins with connecting to a camera, receiving the streamed events it generates, and processing those events to extract meaningful information. The SDK module responsible for the foundational steps of connecting to a camera is called HAL (Hardware Abstraction Layer). The programming guides will introduce the most important functions of HAL and demonstrate their usage.

As outlined in the SDK Architecture page, HAL provides a standardized API to access the hardware functionalities of event-based cameras. This abstraction ensures a consistent and uniform interface for interacting with various camera models, simplifying the process of integration and development across diverse hardware platforms.

In HAL, an event-based camera is represented by an instance of the Metavision::Device class. This class serves as the primary entry point for accessing the camera’s capabilities, making it the central component for interacting with event-based devices.

Note

In HAL, RAW files are managed as instances of the Metavision::Device class, just like physical camera devices. However, the key distinction lies in their limitations: hardware-specific functionalities are not accessible when working with RAW files, as they do not interact with actual camera hardware.

For a comprehensive overview of the functionalities available for various device types, including RAW files and physical cameras, refer to the Facility Table. This table highlights the differences and outlines the supported features for each device type.

The Metavision::Device interface allows developers to access a wide range of facilities. These facilities offer modular and comprehensive control over the camera’s capabilities, including event streaming, bias tuning, and more.

Before delving into the process of opening devices and streaming events, let’s first explore the functionality and behavior of camera plugins. These plugins play a critical role in enabling seamless integration and ensuring compatibility across different hardware platforms.

Note

The SDK seamlessly manages the loading of camera plugins, requiring no additional action from you. Your main responsibility is to ensure that the plugin configuration aligns with your device’s specifications and requirements. Proper configuration guarantees a smooth and efficient connection process, eliminating the need for manual intervention.

Camera Plugin Configuration

Since communication with a camera device is managed via a camera plugin, the first step is to load the appropriate plugin corresponding to your camera model.

Metavision HAL plugins are searched in the following folders (listed by order of priority):

  • the folder list provided by the environment variable MV_HAL_PLUGIN_PATH (note that folders are separated by ‘:’ under Unix and ‘;’ under Microsoft environment)

  • <install-prefix>/lib/metavision/hal/plugins/ (i.e. /usr/lib/metavision/hal/plugins/ by default on Ubuntu OS)

Note

The folders in which plugins are searched for can be customized with the environment variable MV_HAL_PLUGIN_SEARCH_MODE as explained in the Camera Plugins Installation page.

Every shared library in these folders is considered as a potential plugin, but only those with the required entry points will be recognized as plugins.

Note

In case a plugin in MV_HAL_PLUGIN_PATH or in the installation path is not loaded properly, setting the environment variable MV_HAL_DEBUG_PLUGIN will provide more information about which libraries Metavision HAL tried to load and why the loading failed.

To list the connected devices, every recognized plugin is first interrogated about the connected devices that it can handle. Each plugin returns the list of device IDs for compatible devices. Since a given device ID could be supported by several plugins, the enumerated raw device IDs are prefixed by the HAL with the integrator’s (i.e. manufacturer) name and plugin’s name to build a unique serial number in the form of IntegratorName:PluginName:DeviceID. The plugin’s name is deduced from the name of the corresponding shared library by removing the “lib” prefix and the file extension.

Please note that opening RAW files also requires a camera plugin, as these files are treated as Metavision::Device objects within the HAL framework, as described above.

Going Further

Next, open your device by following one of these guides: