Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other
Target Operating System
Linux
QNX
other
Hardware Platform
NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other
SDK Manager Version
1.6.0.8170
other
Host Machine Version
native Ubuntu 18.04
other
Hello,
I have an issue with creating a decoder plugin for radar sensor.
My goal is to connect an ethernet based radar, which is simulated in a virtual environment. The software provides the data through TCP/IP and is locally simulated on my workstation (hence the local IP you will see).
I’m executing the following command for the radar_replay sample and get the following output:
“any-workstation”:~/driveworks/build/src/sensors/radar/radar_replay$ ./sample_radar_replay --protocol=radar.socket --params=ip=192.168.2.125,port=2210,device=CUSTOM,protocol=tcp,decoder=/home/“any-user”/driveworks/build/src/sensors/plugins/radar/libsample_radar_decoder.so
[15-09-2021 18:01:13] Platform: Detected Generic x86 Platform
[15-09-2021 18:01:13] TimeSource: monotonic epoch time offset is 1631691975691083
[15-09-2021 18:01:13] Platform: number of GPU devices detected 1
[15-09-2021 18:01:13] Platform: currently selected GPU device discrete ID 0
[15-09-2021 18:01:13] SDK: Resources mounted from /usr/local/driveworks/samples/…/data/
[15-09-2021 18:01:13] TimeSource: monotonic epoch time offset is 1631691975691083
[15-09-2021 18:01:13] Initialize DriveWorks SDK v2.2.3136
[15-09-2021 18:01:13] Release build with GNU 7.4.0 from heads/buildbrain-branch-0-gca7b4b26e65
[15-09-2021 18:01:13] SensorFactory::createSensor() → radar.socket, ip=192.168.2.125,port=2210,device=CUSTOM,protocol=tcp,decoder=/home/“any-user”/driveworks/build/src/sensors/plugins/radar/libsample_radar_decoder.so
scansPerSecond = 15
[15-09-2021 18:01:13] RadarSocket::RadarSocket, connected to 192.168.2.125:2210
terminate called after throwing an instance of ‘std::runtime_error’
what(): In Radar Properties - packetsPerSecond is 0
Aborted (core dumped)
My decoder plugin is nearly empty, since I’m just trying to see whether this will work and I’m trying to understand, how the decoder has to look like:
#include <dw/sensors/plugins/radar/RadarDecoder.h>
#include <dw/sensors/plugins/radar/RadarPlugin.h>
#include <iostream>
_dwRadarDecoder_constants DecoderConstants;
dwStatus _dwRadarDecoder_initialize () {
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_release() {
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_decodePacket (
dwRadarScan * output,
const uint8_t * buffer,
const size_t length,
const dwRadarScanType scanType )
{
output = 0;
std::cout << buffer << std::endl;
std::cout << length << std::endl;
(void) scanType;
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_getConstants(_dwRadarDecoder_constants * constants)
{
DecoderConstants.properties.scansPerSecond=15;
DecoderConstants.properties.isDecodingOn=1;
DecoderConstants.properties.numScanTypes=1;
DecoderConstants.properties.supportedScanTypes[0][0] = 1;
DecoderConstants.properties.packetsPerScan = 20;
DecoderConstants.properties.maxReturnsPerScan[0][0] = 1;
DecoderConstants.properties.inputPacketsPerSecond = 20;
DecoderConstants.headerSize = 64;
DecoderConstants.maxPayloadSize = 2048;
DecoderConstants.vehicleStateSize = 64;
DecoderConstants.mountSize = 64;
constants = &DecoderConstants;
std::cout << "scansPerSecond = " << constants->properties.scansPerSecond << std::endl;
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_synchronize (
const uint8_t * buffer,
const size_t length,
size_t * remaining)
{
(void) buffer;
(void) length;
(void) remaining;
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_validatePacket (
const uint8_t* buffer,
const size_t length,
dwRadarScanType* scanType)
{
(void) buffer;
(void) length;
(void) scanType;
return DW_SUCCESS;
}
bool _dwRadarDecoder_isScanComplete (
dwRadarScanType scanType,
const uint8_t ** buffer,
size_t * length,
size_t numPackets
)
{
(void) scanType;
(void) buffer;
(void) length;
(void) numPackets;
return true;
}
dwStatus _dwRadarDecoder_encodeVehicleState (
uint8_t * buffer,
const size_t maxOutputSize,
const dwRadarVehicleState * packet
)
{
(void) buffer;
(void) maxOutputSize;
(void) packet;
return DW_SUCCESS;
}
dwStatus _dwRadarDecoder_encodeMountPosition (
uint8_t * buffer,
const size_t maxOutputSize,
const dwRadarMountPosition * packet
)
{
(void) buffer;
(void) maxOutputSize;
(void) packet;
return DW_SUCCESS;
}
but it seems like I’m not able to pass on the properties data as part of the “_dwRadarDecoder_constants” struct to the created sensor through “dwSAL_createSensor” in the radar_replay sample executed in the function “initializeSensor”.
As you can see in the above forwarded output, I’ve set up an output data stream with “cout” in order to see if this function got called by “CreateSensor” and if so, how the value looks like, because I assumed, that “dwSAL_createSensor” is executing exactly this function to get the properties.
So, what exactly am I doing wrong here? Besides, a good manual how to build such a decoder would be really helpful… and please don’t forward the webinar to me, since it’s describing how to build a “comprehensive” plugin and not the decoder, which is totally sufficient for my requirements.
Best regards,
Kerby

