Algorithm

Algorithms are defined in a single array named algorithm in JSON format.

Specifying algorithms is optional. You may leave out specifying this in your configuration file. However, if you are specifying algorithms, here is an example:

...
  "algorithm": [
        {
            "id": "ADAS_ALGO_MOTION_DETECTION",
            "input": [
                {
                    "id": "forward_camera"
                }
            ],
            "output": [
                {
                    "type": "viewer",
                    "instance": 4
                }
            ]
        },
        {
            "id": "ADAS_ALGO_LIDAR_GROUPING",
            "input": [
                {
                    "id": "side_lidar"
                }
            ],
            "output": [
                {
                    "type": "viewer",
                    "instance": 3
                }
            ]
        },
        {
            "id": "ADAS_ALGO_RADAR_GROUPING",
            "input": [
                {
                    "id": "front_radar"
                }
            ],
            "output": [
                {
                    "type": "viewer",
                    "instance": 2
                }
            ]
        }
    ],
...
           

Attributes:

There are the attributes that you can use to configure an algorithm.

id
(Required) The algorithm to apply. Valid algorithms are of type adas_algorithm_t.
If you specify ADAS_ALGO_CUSTOM, then you must also specify the path for your custom algorithm. For example:
...
  "algorithm": [
        {
            "id": "ADAS_ALGO_CUSTOM",
            "path": "/usr/share/algorithms/myAlgorithm.so
            "input": [
                {
                    "id": "forward_camera"
                }
            ],
            "output": [
                {
                    "type": "viewer",
                    "instance": 4
                }
            ]
        },
...
                        
For more information, see Using Custom Algorithms.”
input
(Required) An array of one or more inputs that this algorithm applies to. Each entry in this list is defined by the id data. What you specify as the id must correspond to the id of one of the entries in your input array. For example, if in your input array, you have this entry:
...
    "input": [
        {
            "source": "sensor",            
            "instance": "SENSOR_UNIT_1",
            "id": "forward_camera"
        },
        ...
     ]
...
                        
then you can specify forward_camera as the id attribute in an entry of your input array for your algorithm. For example:
...
    "algorithm": [
        {
            ...
            "input": [
                {
                    "id": "forward_camera"
                }
            ],
...
                        
parameters
(Only when id:ADAS_ALGO_CUSTOM) A string to pass to the custom algorithm. The format you choose is dependent on the implementation of your library. For example, you could specify the string as a property/value pair as shown here, but no structure is actually imposed:
"parameters" = "horizon=33"
.
path
(Only when id:ADAS_ALGO_CUSTOM) The path to the library. The library must be in a location specified by the LD_LIBRARY_PATH environment variable. For example, /lib/dll.
output
(Required) An array of one or more outputs for this algorithm. Each entry in this list is defined by the following data:
  • type
  • instance
where type can be set to viewer , and instance is the index of the viewer that's configured in the viewer array in your configuration file. The index is in range [1..n] where n is the total number of viewers in your viewer array. For example, if in your viewer array, you have these entries:
...
    "viewer": [
        {
            "type": "ADAS_VIEWER_CAMERA",
            ...
        },
        {
            "type": "ADAS_VIEWER_POINT_CLOUD",
            ...
        },
        {
            "type": "ADAS_VIEWER_OVERLAY",
            ...
        },
        {
            "type": "ADAS_VIEWER_NATIVE_CAMERA",
            ...
        }
        ],
...
                        
then you can specify 3 (the viewer whose type is ADAS_VIEWER_OVERLAY) as the instance attribute in an entry of your output array for your algorithm. For example:
...
    "algorithm": [
        ...
            "output": [
                {
                    "type": "viewer",
                    "instance": 3
                }
            ]
...