About ”dwSensor_start” return value

Hello,

I’m developing plugins to control our custom radar with Driveworks.
I think API: dwSensor_start calls Plugin: dwSensorPlugin_start.
I found that when dwSensorPlugin_start returned “DW_SAL_SENSOR_ERROR”, dwSensor_start returned DW_SUCCESS without any error.

Question:
Is there a way for dwSensor_start to return an error if dwSensorPlugin_start occurs any issues?

Environment:
Hardware Platform: DRIVE AGX Xavier™ Developer Kit
Software Version: DRIVE Software 10.0

Hi @mark0214 ,

Please take a look at “Integrating with Custom Sensors” document in DriveWorks SDK Reference (/usr/local/driveworks/doc/nvsdk_html/sensorplugins_mainsection.html on your host system) and then check you are running comprehensive or decoder only plugin. Decoder only plugin won’t call dwSensorPlugin_start() function. Thanks.

Hello VickNV,

Thank you for your reply.

I develop comprehensive plugins by referring to the following site.
https://docs.nvidia.com/drive/driveworks-3.0/sensorplugins_radarsensor.html

I have confirmed that dwSensorPlugin_start is actually called from dwSensor_start by putting print code in the dwSensorPlugin_start I made.

I suspect dwSensor_start does not refer to the return value from dwSensorPlugin_start.

Below are excerpts of the code calls the API and the code of the plugin I made, and their execution results.
Please let me know if something is wrong with my usage.

  • The API and the code of the plugin
    ====================================================================
    dwStatus _dwSensorPlugin_start(dwSensorPluginSensorHandle_t sensor)
    {
    std::cout << “Call start.\n”; // To confirm that this function was called.
    auto sensorContext = reinterpret_castdw::plugins::radar::SampleRadarSensor*(sensor);
    if (!checkValid(sensorContext))
    {
    return DW_INVALID_HANDLE;
    }

    sensorContext->startSensor();
    return DW_SAL_SENSOR_ERROR ; // Returning DW_SAL_SENSOR_ERROR for experimentation
    }
    ====================================================================

  • The code calls the API
    ====================================================================
    std::cout << “start dwSensor_start.\n”;
    status = dwSensor_start(m_radarSensor);
    std::cout << “end dwSensor_start. status=” << status << “\n”;
    ====================================================================

  • their execution results
    ====================================================================
    start dwSensor_start.
    Call start.
    end dwSensor_start. status=0
    ====================================================================

Best regards.

It seems the caller of dwSensorPlugin_start() just prints out a error message but doesn’t return error accordingly.
Can you see “RadarCustom: plugin start was not succesful.” error message in the failure case? Thanks.

Hello VickNV,

Thank you for your reply.

It seems the caller of dwSensorPlugin_start() just prints out a error message but doesnft return error accordingly.

Does this mean that the error caused by dwSensorPlugin_start() cannot be notified to the caller of dwSensor_start()?
I would like to change the behavior of the caller of dwSensor_start() if dwSensorPlugin_start() gets any error.

Can you see “RadarCustom: plugin start was not succesful.” error message in the failure case?

I created a logger instance in the code calls the API as shown below and I made dwSensorPlugin_start return “DW_SAL_SENSOR_ERROR”.
However the message “Radar Custom: Failed to launch plugin” was not displayed.

dwLogger_initialize(getConsoleLoggerCallback(true);
dwLogger_setLogLevel(DW_LOG_VERBOSE);

Sorry that I just noticed that you’re using DriveWorks 2.2 (part of DRIVE Software 10.0) instead of DriveWorks 3.5.
DriveWorks 3.5 will print “RadarCustom: plugin start was not succesful.” error message for an error returned by dwSensorPlugin_start() but 2.2 doesn’t.

I will create a ticket for improving error handling for dwSensorPlugin_start() in DriveWorks APIs. Thanks for your feedback.

Hello VickNV,

Thank you for your help.
In addition, dwSensor_stop () and dwSAL_release () don’t seem to refer to the related plugin return values either.
I hope these will be improved.

Best regards.

Thanks for the feedback.