Connecting to Devices

The SDK module allowing to connect to event-based devices is HAL.

As explained in the Architecture page, HAL is an API that accesses camera hardware functionalities in a generic way.

In HAL, an event-based camera is represented by an instance of the Metavision::Device class, which is the entry point to access all camera capabilities using the facilities.

As the communication with a camera device is handled by the plugin itself, the first step is to load the relevant plugin.

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.

Note that a plugin is also required to open RAW files which in HAL are also considered as Metavision::Device.

Next step is to open your device, following one of those guide: