Sensortypecustom(), Decordercustom() and SensorTypeCustom, DecorderCustom mentioned on Webiner

Do you tell me detail information of the following function and Layer, which is mentioned on Webiner on the link below?

Is there any sample cord to implement them?



My confusing is that there seems different exploration between Webiner and SDK documents regarding as plugin sequence.

On webiner slide page 42, layers called SensorTypeCustom and DecorderCustom are mentioned, however I can’t find out the related information on SDk documents.

In addition, Webiner says calling of Sensortypecustom() and Decordercustom() are required before calling of _dwSensorPlugin_createHandle() from DecorderCustom layer, however, SDK documents says that SAL calls dwSensorPlugin_createHandle() directly from plugin, as following.

44 SAL will then make the following calls to your plugin:
46 | # | Function Call | Purpose |
47 | - | ------------- | ------- |
48 | 1 | dwSensorPlugin_createHandle() | Initialize a context for this sensor (allocate resources, etc.) |
49 | 2 | dwSensorRadarPlugin_getDecoderConstants() | Retrieve necessary constants |

Next, Webiner says that SAL calls readRawdata() before calling of dwSensorPlugin_readRawData() from SensorTypeCustom, however SDK documents says that SAL calls dwSensorPlugin_readRawData() from plugin without calling both of them, as following.

88 raw data from the device. Once the sensor has been started via a
89 dwSensorPlugin_start() call, SAL will make the following calls to your plugin:
91 | # | Function Call | Purpose |
92 | - | ------------- | ------- |
93 | 1 | dwSensorPlugin_readRawData() | Provide raw data for a single sensor message as a byte array |

SDK documents: 04_DRIVE_SW_10.0_References/DRIVE_Software/DRIVE_AV_doxy_files/radar__fullsensor_8md_source.html

Thank you.

**Hardware Platform:DRIVE AGX Xavier™ Developer Kit
**Software Version:DRIVE Software 10
**Host Machine Version: native Ubuntu 18.04
**SDK Manager Version:

Hi @Jamie,

plugin samples are mentioned in doc (open file:///usr/local/driveworks/doc/nvsdk_html/dwx_samples_section.html#dwx_other_sensor_samples_group url with a browser on your host system), e.g. CAN Plugin Sample, etc.

source code is under /usr/local/driveworks/samples/src/sensors/plugins/ of your host system.

SensorTypeCustom is actually <Sensor Type>Custom, e.g. CANCustom. Which is an internal class so you cannot find it in the doc.

Take CAN plugin sample for example; dwSensorCANPlugin_getFunctionTable() needs to manipulate dwSensorCANPluginFunctionTable structure. So it is the only necessary API which needs to be implemented by plugin developers. Then to use it, application developers just need to get the plugin library and then call SAL APIs with related parameters.

Hope these information will be helpful!

1 Like

Thank you. I’m not sure what “DecorderCustom” means. Calling of _dwSensorPlugin_readRawData() looks like correct to be called from “DecorderCustom”, but my understanding is that decorder function is part of plugin function, so it looks like correct to be placed under the vender library. On webiner sequence diagram, they are represented separately but actually look like the same.

DecoderCustom is also an internal class. Developers just need to implement dwSensor<Sensor Type>Plugin_getFunctionTable() to provide necessary function pointers in defined dwSensor<Sensor Type>PluginFunctionTable structure.