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?
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.
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;
}
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
====================================================================
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.
It seems the caller of dwSensorPlugin_start() just prints out a error message but doesnft 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.
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.
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.