1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page sensors_usecase2 Sensor Querying
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 NVIDIA<sup>®</sup> DriveWorks context allows querying all the supported sensors for each HW platform as well as the parameters available to configure them. Please note that the query returns supported sensors by DriveWorks and not if a particular sensor is actually physically attached to the platform. Sensors are specified using a factory pattern such as:
9 sensor_type.mode param1=value1,param2=value2,...
11 where sensor_type.mode specifies the protocol and the following specifies the various parameters:
13 param1=value1,param2=value2,...
15 For example, the code snipped below lists all sensors supported on the NVIDIA DRIVE platform and Linux host system. It also lists the parameters for each sensor.
17 DW_PLATFORM_OS_V5L dwPlatformOS currentPlatform;
18 dwPlatformOS platform[] = {DW_PLATFORM_OS_LINUX, DW_PLATFORM_OS_V5L};
19 CHECK_DW_ERROR(dwSAL_getPlatform(¤tPlatform, hal));
21 // get information about available sensors on each platform
22 for (size_t i = 0; i < sizeof(platform) / sizeof(dwPlatformOS); i++) {
23 const char *name = nullptr;
24 CHECK_DW_ERROR(dwSAL_getPlatformInfo(&name, platform[i], hal));
25 std::cout << "Platform: " << name;
26 if (platform[tformOS currentPlatform;
27 dwPlatformOS platform[] = {DW_PLATFORM_OS_LINUX, DW_PLATFORM_OS_V5L};
28 CHECK_DW_ERROR(dwSAL_getPlatform(¤tPlatform, hal));
30 // get information about available sensors on each platform
31 for (size_t i = 0; i < sizeof(platform) / sizeof(dwPlatformOS); i++) {
32 const char *name = nullptr;
33 CHECK_DW_ERROR(dwSAL_getPlatformInfo(&name, platform[i], hal));
34 std::cout << "Platform: " << name;
35 if (platform[i] == currentPlatform)
36 std::cout << " - CURRENT";
37 std::cout << ": " << std::endl;
38 uint32_t numSensors = 0;
39 CHECK_DW_ERROR(dwSAL_getNumSensors(&numSensors, platform[i], hal));
40 for (uint32_t j = 0; j < numSensors; j++) {
41 const char *protocol = "";
42 const char *params = "";
43 CHECK_DW_ERROR(dwSAL_getSensorProtocol(&protocol, j, platform[i], hal));
47 - CHECK_DW_ERROR is a macro that throws an exception if an error occurs and
48 - ::DW_PLATFORM_OS_V5L is the NVIDIA DRIVE platform.
50 With the output being:
52 Platform: OS_LINUX - CURRENT:
53 Sensor [0] : can.socket ? device=can0[,fifo-size=1024]
54 Sensor [1] : can.virtual ? file=/path/to/file.can[,create_seek,default_timeout_us,time-offset=0]
55 Sensor [2] : camera.virtual ? video/file=filepath.{h264,raw,lraw}[,timestamp=file.txt][,create_seek][,time-offset=0]
56 Sensor [3] : camera.nvidia-ip ? host=<ip_addr>, port=<TCP port number>
57 Sensor [4] : camera.usb ? device=0
58 Sensor [5] : gps.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=nmea0183][,fifo-size=1024]]
59 Sensor [6] : gps.virtual ? file=filepath.bin[xsens-raw-gps=true,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
60 Sensor [7] : gps.xsens ? device=0[,frequency=100,xsens-raw-gps=true,time-smoothing=false,fifo-size=1024,baudrate=115200,stop-bits=2]
61 Sensor [8] : gps.novatel ? [fifo-size=1024]
62 Sensor [9] : gps.dataspeed ? can-proto=can.socket,can-params=device=canX[,fifo-size=1024]
63 Sensor [10] : imu.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=xsens_nmea][,fifo-size=1024]]
64 Sensor [11] : imu.xsens ? device=0[,frequency=100,time-smoothing=true,fifo-size=1024,baudrate=115200,stop-bits=2]
65 Sensor [12] : imu.virtual ? file=filepath.bin[,create_seek,default_timeout_us,time-smoothing=true][,fifo-size=1024][,time-offset=0]
66 Sensor [13] : imu.novatel ? [fifo-size=1024]
67 Sensor [14] : imu.dataspeed ? can-proto=can.socket,can-params=device=canX[,fifo-size=1024]
68 Sensor [15] : lidar.virtual ? file=filepath.bin[,create_seek,default_timeout_us,decoder=filepath.so,time-smoothing=false,decoding=true,time-offset=0]
69 Sensor [16] : lidar.socket ? ip=X.X.X.X,port=XXXX,device={QUAN_M81A, IBEO_LUX, IBEO_LUX_8L, VELO_VLP16, VELO_VLP16HR, VELO_HDL32E, VELO_VLP32C, VELO_HDL64E, CUSTOM},scan-frequency=XX.X[,protocol=xxx,multicast-ip=X.X.X.X,decoder=filepath.so,time-smoothing=false]
70 Sensor [17] : radar.virtual ? file=filepath.bin,time-smoothing=true[,decoder=filepath.so,create_seek,default_timeout_us,decoding=true,time-offset=0]
71 Sensor [18] : radar.socket ? ip=X.X.X.X,port=XXXX,device={DELPHI_ESR2_5, CONTINENTAL_ARS430, CUSTOM},multicast-ip=X.X.X.X],time-smoothing=true,isInverted=false[,decoder=filepath.so,protocol=xxx]
72 Sensor [19] : radar.can ? can-driver=can.xxx,can-bus=xxx,can-base-id=0x460,device={CONTINENTAL_ARS430_CAN}[,aurix-can-ip=X.X.X.X.X],[aurix-can-aport=XXXX][,aurix-can-bport=XXXX][,virtual-file=filepath.bin][,time-smoothing=false]
74 Platform: OS_DRIVE_V5L:
75 Sensor [0] : can.socket ? device=can0[,fifo-size=1024]
76 Sensor [1] : can.aurix ? ip=10.0.0.1,bus={a,b,c,d}[,aport=50000,bport=60395][,fifo-size=1024]
77 Sensor [2] : can.virtual ? file=/path/to/file.can[,create_seek,default_timeout_us,time-offset=0]
78 Sensor [3] : camera.gmsl ? (Parker) camera-type={ov10635, ov10640-bggr-ae-svc210, ov10640-bggr-ae-svc212, ar0231-grbg-ae-sd3321, ar0231-rccb-ae-ss3322,ar0231-rccb-bae-ss3322, ar0231-rccb-ae-ss3323, ar0231-rccb-bae-ss3323, ar0231-rccb-ae-sf3324,ar0231-rccb-bae-sf3324, ar0231-rccb-ae-sf3325, ar0231-rccb-bae-sf3325},camera-group={a,b,c},camera-count={1,2,3,4},(Xavier) camera-type={ar0231-rccb-bae-sf3324, ar0231-rccb-bae-sf3325, ar0144-cccc-none-gazet1},output-format={yuv+raw+data}[,slave={0,1}][,fifo-size={3..20}][,custom-board=0]camera-group={a,b,c,d},camera-count={1,2,3,4},[,camera-mask={0001|0010|0011|..|1111}][,warn-per-frame={0,1}]
79 Sensor [4] : camera.virtual ? video/file=filepath.{h264,raw,lraw}[,timestamp=file.txt][,create_seek][,time-offset=0]
80 Sensor [5] : camera.usb ? device=0
81 Sensor [6] : camera.nvidia-ip ? host=[ip_addr], port=[TCP port number]
82 Sensor [7] : gps.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=nmea0183]][,fifo-size=1024]
83 Sensor [8] : gps.virtual ? file=filepath.bin[,xsens-raw-gps=true,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
84 Sensor [9] : gps.xsens ? device=0[,frequency=100,xsens-raw-gps=true,time-smoothing=false,fifo-size=1024,baudrate=115200,stop-bits=2]
85 Sensor [10] : gps.novatel ? [fifo-size=1024]
86 Sensor [11] : gps.dataspeed ? can-proto=can.socket,can-params=device=canX[,fifo-size=1024]
87 Sensor [12] : imu.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=xsens_nmea]][,fifo-size=1024]
88 Sensor [13] : imu.xsens ? device=0[,frequency=100,time-smoothing=false,fifo-size=1024,baudrate=115200,stop-bits=2]
89 Sensor [14] : imu.virtual ? file=filepath.bin[,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
90 Sensor [15] : imu.novatel ? [fifo-size=1024]
91 Sensor [16] : imu.dataspeed ? can-proto=can.socket,can-params=device=canX[,fifo-size=1024]
92 Sensor [17] : lidar.virtual ? file=filepath.bin[,create_seek,default_timeout_us,time-smoothing=false,decoding=true,time-offset=0]
93 Sensor [18] : lidar.socket ? ip=X.X.X.X,port=XXXX,device={QUAN_M81A, IBEO_LUX, IBEO_LUX_8L, VELO_VLP16, VELO_VLP16HR, VELO_HDL32E, VELO_VLP32C, VELO_HDL64E, CUSTOM},scan-frequency=XX.X[,protocol=xxx,multicast-ip=X.X.X.X,decoder=filepath.so,time-smoothing=false]
94 Sensor [19] : radar.virtual ? file=filepath.bin,time-smoothing=true[,decoder=filepath.so,create_seek,default_timeout_us,decoding=true,time-offset=0]
95 Sensor [20] : radar.socket ? ip=X.X.X.X,port=XXXX,device={DELPHI_ESR2_5, CONTINENTAL_ARS430, CUSTOM},multicast-ip=X.X.X.X,time-smoothing=true,isInverted=false[,decoder=filepath.so,protocol=xxx]
96 Sensor [21] : radar.can ? can-driver=can.xxx,can-bus=xxx,can-base-id=0x460,device={CONTINENTAL_ARS430_CAN}[,aurix-can-ip=X.X.X.X.X],[aurix-can-aport=XXXX][,aurix-can-bport=XXXX][,virtual-file=filepath.bin]
99 Sensor [0] : can.socket ? device=can0
100 Sensor [1] : can.virtual ? file=/path/to/file.can[,create_seek][,time-offset=0]
101 Sensor [2] : camera.gmsl ? camera-group={a,b,c,d},camera-count={1,2,3,4},camera-type={ar0231-rccb-bae-sf3324, ar0231-rccb-bae-sf3325},output-format={yuv+raw+data}[,slave={0,1}][,fifo-size={3..20}][,custom-board=0][,camera-mask={0001|0010|0011|..|1111}][,warn-per-frame={0,1}]
102 Sensor [3] : camera.virtual ? video/file=filepath.{h264,raw}[,timestamp=file.txt][,create_seek][,time-offset=0]
103 Sensor [4] : gps.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=nmea0183]][,fifo-size=1024]
104 Sensor [5] : gps.virtual ? file=filepath.bin[,xsens-raw-gps=true,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
105 Sensor [6] : gps.xsens ? device=0[,frequency=100,xsens-raw-gps=true,time-smoothing=false,fifo-size=1024,baudrate=115200,stop-bits=2]
106 Sensor [7] : gps.dataspeed ? can-proto=can.socket/aurix,can-params=device=canX[,fifo-size=1024]
107 Sensor [8] : imu.uart ? device=/dev/ttyXXX[,baud={1200,2400,4800,9600,19200,38400,57600,115200}[,format=xsens_nmea]][,fifo-size=1024]
108 Sensor [9] : imu.virtual ? file=filepath.bin[,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
109 Sensor [10] : imu.xsens ? device=0[,frequency=100,time-smoothing=false,fifo-size=1024,baudrate=115200,stop-bits=2]
110 Sensor [11] : imu.dataspeed ? can-proto=can.socket/aurix,can-params=device=canX[,fifo-size=1024]
111 Sensor [12] : lidar.virtual ? file=filepath.bin[,create_seek,default_timeout_us,time-smoothing=false,time-offset=0]
112 Sensor [13] : lidar.socket ? ip=X.X.X.X,port=XXXX,device={QUAN_M81A, IBEO_LUX, IBEO_LUX_8L, VELO_VLP16, VELO_VLP16HR, VELO_HDL32E, VELO_VLP32C, VELO_HDL64E, CUSTOM},scan-frequency=XX.X[,protocol=xxx,multicast-ip=X.X.X.X,decoder=filepath.so,time-smoothing=false]
113 Sensor [14] : radar.virtual ? file=filepath.bin,time-smoothing=true[,decoder=filepath.so,create_seek,default_timeout_us,decoding=false,time-offset=0]
114 Sensor [15] : radar.socket ? ip=X.X.X.X,port=XXXX,device={DELPHI_ESR2_5, CONTINENTAL_ARS430, CUSTOM},multicast-ip=X.X.X.X],time-smoothing=true,isInverted=false[,decoder=filepath.so,protocol=xxx]
115 Sensor [16] : radar.can ? can-driver=can.xxx,can-bus=xxx,can-base-id=0x460,device={CONTINENTAL_ARS430_CAN}[,aurix-can-ip=X.X.X.X.X],[aurix-can-aport=XXXX][,aurix-can-bport=XXXX][,virtual-file=filepath.bin]
117 For a full implementation see @ref dwx_sensor_enum_sample .