| Updated: October 28, 2024 |
Algorithms are defined in a single array named algorithm in JSON format.
Specifying algorithms is optional. If you are specifying algorithms, here is an example:
...
"algorithm": [
{
"id": "ADAS_ALGO_CUSTOM",
"path": "libmotion_detection_algo_example.so",
"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
}
]
}
],
...
There are properties that you can use to configure an algorithm object:
...
"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": [
{
"source": "sensor",
"instance": "SENSOR_UNIT_1",
"id": "forward_camera"
},
...
]
...
then you can specify forward_camera as the id property in an
entry of the input property for your algorithm. For example:
...
"algorithm": [
{
...
"input": [
{
"id": "forward_camera"
}
],
...
"parameters" = "horizon=33"
Here, type can be set to viewer, and instance is the index of the viewer that's configured in the viewer array. The index is in range [1..n] where n is the total number of viewers in the 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 property in an entry of your output
array for your algorithm. For example:
...
"algorithm": [
...
"output": [
{
"type": "viewer",
"instance": 3
}
]
...