| Updated: October 28, 2024 |
Viewers are defined in a single array named viewer in JSON format.
Specifying viewers is optional. You may leave out specifying this in your configuration file. However, if you are specifying algorithms, here is an example:
...
"viewer": [
{
"type": "ADAS_VIEWER_CAMERA",
"view": "ADAS_VIEW_FORWARD",
"zoom_factor": 1,
"background_color": {
"red": 0.2,
"green": 0.2,
"blue": 0.2,
"alpha": 1.0
},
"z_order": 0,
"visible": true,
"layouts" : [
{
"view": "ADAS_VIEW_FORWARD",
"layout": "camera_layout_1"
},
{
"view": "ADAS_VIEW_DRIVER",
"layout": "camera_layout_1"
},
{
"view": "ADAS_VIEW_RADAR",
"layout": "camera_layout_1"
},
{
"view": "ADAS_VIEW_NAVIGATION",
"layout": "camera_layout_1"
}
]
},
{
"type": "ADAS_VIEWER_POINT_CLOUD",
"input": [
{
"id": "front_lidar"
}
],
"view": "ADAS_VIEW_ISOMETRIC",
"zoom_factor": 2,
"z_order": 0,
"visible": false,
"range": {
"x": 10000,
"y": 5625,
"z": 5000
},
"persistence": 1000,
"position": {
"x": -1245,
"y": -932,
"z": 0
},
"dimensions": {
"width": 1864,
"height": 1475,
"depth": 4925
}
},
{
"type": "ADAS_VIEWER_OVERLAY",
"input": [
{
"id": "primary_gps"
},
{
"id": "primary_imu"
}
],
"view": "ADAS_VIEW_ISOMETRIC",
"zoom_factor": 2,
"z_order": 1,
"visible": false,
"enable_hud": false,
"parent": 2,
"layouts" : [
{
"view": "ADAS_VIEW_RADAR",
"layout": "overlay_layout_1"
},
{
"view": "ADAS_VIEW_NAVIGATION",
"layout": "overlay_layout_2"
}
]
},
{
"type": "ADAS_VIEWER_OVERLAY",
"input": [
{
"id": "secondary_gps"
},
{
"id": "secondary_imu"
}
],
"view": "ADAS_VIEW_FORWARD",
"zoom_factor": 1,
"z_order": 1,
"visible": true,
"enable_hud": true,
"parent": 1,
"layouts" : [
{
"view": "ADAS_VIEW_FORWARD",
"layout": "overlay_layout_3"
},
{
"view": "ADAS_VIEW_DRIVER",
"layout": "overlay_layout_4"
},
{
"view": "ADAS_VIEW_RADAR",
"layout": "overlay_layout_1"
},
{
"view": "ADAS_VIEW_NAVIGATION",
"layout": "overlay_layout_2"
}
]
}
]
...
There are the properties that you can use to configure a viewer.
...
"visible": true,
...
...
"zoom_factor": 1,
...
...
"z_order": 1,
...
...
"camera_layout_1": [
{
"input": "forward_camera",
"theta": 100,
"rotation": {
"yaw": 0,
"pitch": 0,
"roll": 0
},
"source_type": "texture",
"destination_type": "full_screen"
}
],
...
then you can specify camera_layout_1 (the name of the camera layout)
as the layout property in an entry of your layouts
array for your viewer. For example:
...
"layouts" : [
{
"view": "ADAS_VIEW_FORWARD",
"layout": "camera_layout_1"
},
...
]
...
...
"enable_hud": true,
...
...
"input": [
...
{
"source": "sensor",
"instance": "SENSOR_UNIT_5",
"id": "primary_gps"
},
...
]
...
then you can specify primary_gps as the id property in an
element of your input array for your viewer. For example:
...
{
"type": "ADAS_VIEWER_OVERLAY",
"input": [
{
"id": "primary_gps"
},
{
"id": "primary_imu"
}
],
...
...
"overlay_layout_1": [
{
"type": "widget",
"path": "/usr/share/images/car.png",
"width": 18000,
"length": 45000,
"height": 15000
}
],
...
then you can specify camera_layout_1 (the name of the camera layout)
as the layout property in an
element of your layouts
array for your viewer. For example:
...
"layouts" : [
{
"view": "ADAS_VIEW_RADAR",
"layout": "overlay_layout_1"
},
...
]
...
...
"viewer": [
{
"type": "ADAS_VIEWER_CAMERA",
...
},
{
"type": "ADAS_VIEWER_POINT_CLOUD",
...
},
{
"type": "ADAS_VIEWER_OVERLAY",
...
},
{
"type": "ADAS_VIEWER_OVERLAY",
...
],
...
then you can specify 2 (the viewer whose type is ADAS_VIEWER_OVERLAY)
as the instance property in an
element of your output
array for your algorithm. For example:
...
{
"type": "ADAS_VIEWER_OVERLAY",
...
"parent": 2,
...
},
...
...
"position": {
"x": -1245,
"y": -932,
"z": 0
},
...
...
"dimensions": {
"width": 1864,
"height": 1475,
"depth": 4925
}
...
...
"input": [
...
{
"source": "sensor",
"name": "vlp-16",
"id": "front_lidar"
},
...
]
...
then you can specify front_lidar as the id property in an
entry of your input array for your viewer. For example:
...
{
"type": "ADAS_VIEWER_POINT_CLOUD",
"input": [
{
"id": "front_lidar"
}
],
...
...
"range": {
"x": 10000,
"y": 5625,
"z": 5000
},
...