adas_ext_algorithm_t

List of functions which external algorithm libraries must implement

Synopsis:

#include <adas/adas_external_algo.h>
typedef struct adas_ext_algorithm {
    adas_fusion_algo_probe_t probe;
    adas_fusion_algo_open_t open;
    adas_fusion_algo_process_sensor_buffer_t process_sensor_buffer;
    adas_fusion_algo_close_t close;
} adas_ext_algorithm_t;

Data:

adas_fusion_algo_probe_t probe
Probe function that is called by the ADAS library initially to understand the preferences of the algorithm.

For the list of arguments to implement in the function, see adas_fusion_algo_probe_t.

adas_fusion_algo_open_t open
Open function that is called by the ADAS library to create a new instance of this algorithm.

The handle returned by the algorithm to this function is passed to process_sensor_buffer() and close() to identify the instance of the algorithm of interest. For the list of arguments to implement in the function, see adas_fusion_algo_open_t.

adas_fusion_algo_process_sensor_buffer_t process_sensor_buffer
Process function that is called by the ADAS library when a buffer is ready to be processed by an instance of the algorithm.

For the list of arguments to implement in the function, see adas_fusion_algo_process_sensor_buffer_t.

adas_fusion_algo_close_t close
Close function that is called by the ADAS library when an instance of the algorithm is no longer required.

The algorithm library should do proper cleanup of any memory associated with this instance. For the list of arguments to implement in the function, see adas_fusion_algo_close_t.

Library:

libadas

Description:

The library for the external algorithm must create an instance of this structure that is named adas_ext_algorithm_defs or adas_ext_algorithm_defs_[tag], where tag is a character string of your choice.

If only one custom algorithm driver is needed, we recommend not using a tag. If multiple algorithm implementations are desired in the same library, a different tag should be used for each one. The ADAS library will use this definition to interface with the algorithm. The tag to use must be specified in the ADAS configuration file.

Example without tag:
  adas_ext_algorithm_t adas_ext_algorithm_defs = {
   .probe = algorithm_probe,
   .open = algorithm_open,
   .process_sensor_buffer = algorithm_process_sensor_buffer,
   .close = algorithm_close
  };
Example with tag:
  adas_ext_algorithm_t adas_ext_algorithm_defs_algorithm1 = {
   .probe = algorithm1_probe,
   ...
  };

  adas_ext_algorithm_t adas_ext_algorithm_defs_algorithm2 = {
   .probe = algorithm2_probe,
   ...
  };