DriveWorks SDK Reference
5.4.5418 Release
For Test and Development only

Radar Sensor

Detailed Description

Defines the Radar sensor methods.

Data Structures

struct  dwRadarDetection
 The structs below are serialized in binary and the layout is assummed to be packed. More...
 
struct  dwRadarMountPosition
 Defines the structure for reporting sensor mount position. More...
 
struct  dwRadarProperties
 Defines the properties of the radar. More...
 
struct  dwRadarScan
 Defines the structure for a complete radar scan. More...
 
struct  dwRadarScanType
 Defines the type of scan (combination of return type & range) More...
 
struct  dwRadarStatus
 Defines the return structure for sensor status messages. More...
 
struct  dwRadarTrack
 
struct  dwRadarVehicleState
 Defines the structure for reporting current vehicle dynamics state. More...
 

Macros

#define DW_RADARSCAN_MINIMUM_PAYLOAD_SIZE   1744
 The minimum payload size is larger than sizeof(dwRadarScan) to allow custom types to use a larger payload. More...
 

Enumerations

enum  dwRadarDynamicState {
  DW_RADAR_DYNAMIC_STATE_MOVING = 0,
  DW_RADAR_DYNAMIC_STATE_STATIONARY = 1,
  DW_RADAR_DYNAMIC_STATE_ONCOMING = 2,
  DW_RADAR_DYNAMIC_STATE_CROSS_TRAFFIC = 3,
  DW_RADAR_DYNAMIC_STATE_STOPPED = 4,
  DW_RADAR_DYNAMIC_STATE_UNKNOWN = 5
}
 Defines the dynamic state of the radar return. More...
 
enum  dwRadarRange {
  DW_RADAR_RANGE_SHORT = 0,
  DW_RADAR_RANGE_MEDIUM = 1,
  DW_RADAR_RANGE_LONG = 2,
  DW_RADAR_RANGE_UNKNOWN = 3,
  DW_RADAR_RANGE_COUNT = 4
}
 Defines the range of radar return. More...
 
enum  dwRadarReturnType {
  DW_RADAR_RETURN_TYPE_DETECTION = 0,
  DW_RADAR_RETURN_TYPE_TRACK = 1,
  DW_RADAR_RETURN_TYPE_STATUS = 2,
  DW_RADAR_RETURN_TYPE_COUNT = 3
}
 Defines the type of radar return. More...
 

Functions

DW_API_PUBLIC dwStatus dwSensorRadar_getProperties (dwRadarProperties *const radarProperties, dwSensorHandle_t const sensor)
 Gets information about the Radar sensor. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_processRawData (const dwRadarScan **const data, const uint8_t *const rawData, size_t const size, dwSensorHandle_t const sensor)
 Decodes RAW data previously read onto the application side structure. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_readData (const dwRadarScan **const data, const dwRadarScanType type, const dwTime_t timeoutUs, dwSensorHandle_t const sensor)
 Reads a single packet, which might be an entire scan or a fraction of a scan, which is sensor dependent. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_readScan (const dwRadarScan **const data, const dwTime_t timeoutUs, dwSensorHandle_t const sensor)
 Reads a one scan chunk. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_returnData (const dwRadarScan *const scan, dwSensorHandle_t const sensor)
 Returns the data read to the internal pool. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_returnScan (const dwRadarScan *const scan, dwSensorHandle_t const sensor)
 Returns the data covering an entire scan read to the internal pool. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_setDataDecoding (bool const enable, dwSensorHandle_t const sensor)
 Enables/disables the decoding of the Radar packets, which incurs in additional CPU load. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_setMountPosition (dwRadarMountPosition *const data, dwSensorHandle_t const sensor)
 Sends the radar mount position information to the radar. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_setVehicleState (dwRadarVehicleState *const data, dwSensorHandle_t const sensor)
 Sends vehicle dynamics information to the radar. More...
 
DW_API_PUBLIC dwStatus dwSensorRadar_toggleScanType (bool const enable, dwRadarScanType const scanType, dwSensorHandle_t const sensor)
 Enables/Disables a scan type for the radar sensor. More...
 

Data Structure Documentation

◆ dwRadarDetection

struct dwRadarDetection
Data Fields
float32_t azimuth Azimuth angle (radians)
float32_t elevationAngle Angle of elevation (radians)
bool elevationValidity Indicates validity of the elevation angle.
float32_t radialVelocity Radial velocity (m/s)
float32_t radius Radial distance (m)
float32_t rcs Reflection amplitude (dB)
float32_t SNR Signal to noise ratio (dBr)
float32_t Vx X-component (m/s) of the velocity in the azimuth direction.
float32_t Vy Y-component (m/s) of the velocity in the azimuth direction.
float32_t x X-position (m)
float32_t y Y-position (m)

◆ dwRadarMountPosition

struct dwRadarMountPosition
Data Fields
float32_t damping Damping of radome (db)
bool isReversed Indicates if the sensor is reversed from its default orientation.
dwTransformation3f radarPosition Radar position.
uint32_t sensorId Id of the sensor (vendor-specific)
float32_t wheelbase Size of wheel-base (m)

◆ dwRadarProperties

struct dwRadarProperties
Data Fields
uint32_t inputPacketsPerSecond Number of input odometry packets per second.
uint8_t isDecodingOn Indicates whether decoding is enabled.
uint32_t maxReturnsPerScan[DW_RADAR_RETURN_TYPE_COUNT][DW_RADAR_RANGE_COUNT] Max # of returns in any given scan.
uint32_t numScanTypes Number of supported scan types.
uint32_t packetsPerScan

of packets per scan (Note: will be deprecated soon)

uint32_t scansPerSecond Number of scans (of a particular type) per second.

In case scan rate differ between scans, this number is the maximum amongst all scan types

uint32_t supportedScanTypes[DW_RADAR_RETURN_TYPE_COUNT][DW_RADAR_RANGE_COUNT] Enumerates the types of scans supported by the radar.

◆ dwRadarScan

struct dwRadarScan
Data Fields
void * data Pointer to the array of returns (to be casted based on return type)
float32_t dopplerAmbiguity Doppler ambiguity free range.
dwTime_t hostTimestamp Host timestamp at reception of first packet belonging to this scan (us)
uint32_t numReturns Number of radar returns in this scan.
uint32_t scanIndex Sensor-provided scan index.
dwRadarScanType scanType Type of scan.
dwTime_t sensorTimestamp Sensor timestamp for this scan (us)

◆ dwRadarScanType

struct dwRadarScanType
Data Fields
dwRadarRange range Scan range.
dwRadarReturnType returnType Type of radar return.

◆ dwRadarStatus

struct dwRadarStatus
Data Fields
float32_t azimuthDeviation[DW_RADAR_RANGE_COUNT]
float32_t elevationDeviation[DW_RADAR_RANGE_COUNT]
float32_t pitch Pitch angle of sensor (radians)
float32_t roll Roll angle of sensor (radians)
bool sensorAligned Indicates if the sensor is aligned.
bool sensorBlock Indicates if the sensor is blocked.
bool sensorDisturbed Indicates if the sensor is disturbed due to interference.
bool sensorOK Indicaes if the is OK.
float32_t x X-position (m) of sensor mounting in AUTOSAR-coordinates from CoG.
float32_t y Y-position (m) of sensor mounting in AUTOSAR-coordinates from CoG.
float32_t yaw Yaw angle of sensor (radians)
float32_t z Z-position (m) of sensor mounting in AUTOSAR-coordinates from CoG.

◆ dwRadarTrack

struct dwRadarTrack
Data Fields
uint32_t age Age of tracked object (in scans)
float32_t Ax X-component (m/s^2) of the acceleration.
float32_t Ay Y-component (m/s^2) of the aceleration.
float32_t azimuth Azimuth angle (radians)
float32_t azimuthRate Rate of change of azimuth angle (radians/s)
float32_t confidence Confidence of object existence (range: 0-1);.
dwRadarDynamicState dynamicState Dynamic state of the object.
bool elevationValid Indicates validity of z position.
uint32_t id Radar-provided track id.
float32_t radialAcceleration Radial acceleration (m/s^2)
float32_t radialVelocity Radial velocity (m/s)
float32_t radius Radial distance (m)
float32_t rcs Compensated reflection amplitude (dB)
float32_t Vx X-component (m/s) of the velocity.
float32_t Vy Y-component (m/s) of the velocity.
float32_t x X-position (m)
float32_t y Y-position (m)
float32_t z Z-position (m)

◆ dwRadarVehicleState

struct dwRadarVehicleState
Data Fields
float32_t acceleration Longitudinal acceleration (m/s^2)
float32_t lateralAcceleration Lateral acceleration (m/s^2)
float32_t velocity Longitudinal velocity (m/s)
float32_t yawRate Yaw rate (radians/s)

Macro Definition Documentation

◆ DW_RADARSCAN_MINIMUM_PAYLOAD_SIZE

#define DW_RADARSCAN_MINIMUM_PAYLOAD_SIZE   1744

The minimum payload size is larger than sizeof(dwRadarScan) to allow custom types to use a larger payload.

Definition at line 56 of file Radar.h.

Enumeration Type Documentation

◆ dwRadarDynamicState

Defines the dynamic state of the radar return.

Enumerator
DW_RADAR_DYNAMIC_STATE_MOVING 

Moving.

DW_RADAR_DYNAMIC_STATE_STATIONARY 

Stationary.

DW_RADAR_DYNAMIC_STATE_ONCOMING 

Oncoming.

DW_RADAR_DYNAMIC_STATE_CROSS_TRAFFIC 

Cross-traffic.

DW_RADAR_DYNAMIC_STATE_STOPPED 

Stopped (was moving, now stationary)

DW_RADAR_DYNAMIC_STATE_UNKNOWN 

Unknown.

Definition at line 92 of file Radar.h.

◆ dwRadarRange

Defines the range of radar return.

Enumerator
DW_RADAR_RANGE_SHORT 

Short Range.

DW_RADAR_RANGE_MEDIUM 

Medium Range.

DW_RADAR_RANGE_LONG 

Long Range.

DW_RADAR_RANGE_UNKNOWN 

Unknown Range.

DW_RADAR_RANGE_COUNT 

Count.

Definition at line 59 of file Radar.h.

◆ dwRadarReturnType

Defines the type of radar return.

Enumerator
DW_RADAR_RETURN_TYPE_DETECTION 

Raw detection.

DW_RADAR_RETURN_TYPE_TRACK 

Processed tracker output.

DW_RADAR_RETURN_TYPE_STATUS 

Sensor status information.

DW_RADAR_RETURN_TYPE_COUNT 

Count.

Definition at line 77 of file Radar.h.

Function Documentation

◆ dwSensorRadar_getProperties()

DW_API_PUBLIC dwStatus dwSensorRadar_getProperties ( dwRadarProperties *const  radarProperties,
dwSensorHandle_t const  sensor 
)

Gets information about the Radar sensor.

Parameters
[out]radarPropertiesA pointer to the struct containing the properties of the Radar.
[in]sensorSensor handle created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwSensorRadar_processRawData()

DW_API_PUBLIC dwStatus dwSensorRadar_processRawData ( const dwRadarScan **const  data,
const uint8_t *const  rawData,
size_t const  size,
dwSensorHandle_t const  sensor 
)

Decodes RAW data previously read onto the application side structure.

This happens on the CPU thread where the function is called, incurring on additional load on that thread.

Parameters
[out]dataA pointer to a container for the decoded data.
[in]rawDataA pointer for the non-decoded Radar packet, as returned from 'dwSensor_readRawData()'.
[in]sizeSpecifies the size in bytes of the raw data.
[in]sensorSpecifies the sensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS
Note
The returned dwRadarScan is only valid till the next 'dwSensorRadar_processRawData()' call.

◆ dwSensorRadar_readData()

DW_API_PUBLIC dwStatus dwSensorRadar_readData ( const dwRadarScan **const  data,
const dwRadarScanType  type,
const dwTime_t  timeoutUs,
dwSensorHandle_t const  sensor 
)

Reads a single packet, which might be an entire scan or a fraction of a scan, which is sensor dependent.

The pointer returned is to the internal data pool. DW guarantees that the data remains constant until returned by the application. The data must be explicitly returned by the application.

Parameters
[out]dataA pointer to a pointer to the decoded data read from the sensor. The struct contains the numbers of points read, which depends on the sensor used.
[in]typeType of scan requested
[in]timeoutUsSpecifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorRadar_readScan()

DW_API_PUBLIC dwStatus dwSensorRadar_readScan ( const dwRadarScan **const  data,
const dwTime_t  timeoutUs,
dwSensorHandle_t const  sensor 
)

Reads a one scan chunk.

The pointer returned is to the internal data pool. DW guarantees that the data remains constant until returned by the application. The data must be explicitly returned by the application.

Note
This method returns the oldest scan contained in the internal pool.
Parameters
[out]dataA pointer to a pointer to a decoded scan from the sensor. The struct contains the numbers of points read, which depends on the sensor used.
[in]timeoutUsSpecifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorRadar_returnData()

DW_API_PUBLIC dwStatus dwSensorRadar_returnData ( const dwRadarScan *const  scan,
dwSensorHandle_t const  sensor 
)

Returns the data read to the internal pool.

At this point the pointer is still be valid, but data is changed based on newer readings of the sensor.

Parameters
[in]scanA pointer to the scan data previously read from the Radar using 'dwSensorRadar_readData()' to be returned to the pool.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorRadar_returnScan()

DW_API_PUBLIC dwStatus dwSensorRadar_returnScan ( const dwRadarScan *const  scan,
dwSensorHandle_t const  sensor 
)

Returns the data covering an entire scan read to the internal pool.

At this point the pointer is still be valid, but data is changed based on newer readings of the sensor.

Parameters
[in]scanA pointer to an entire scan's data previously read from the Radar using 'dwSensorRadar_readScan()' to be returned to the pool.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_NOT_AVAILABLE, DW_TIME_OUT, DW_SUCCESS

◆ dwSensorRadar_setDataDecoding()

DW_API_PUBLIC dwStatus dwSensorRadar_setDataDecoding ( bool const  enable,
dwSensorHandle_t const  sensor 
)

Enables/disables the decoding of the Radar packets, which incurs in additional CPU load.

Method fails if the sensor has been started and is capturing data. Stop the sensor first.

Parameters
[in]enableSpecifies TRUE when decoding, false if RAW data.
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor()
Returns
DW_INVALID_HANDLE, DW_CALL_NOT_ALLOWED, DW_SUCCESS

◆ dwSensorRadar_setMountPosition()

DW_API_PUBLIC dwStatus dwSensorRadar_setMountPosition ( dwRadarMountPosition *const  data,
dwSensorHandle_t const  sensor 
)

Sends the radar mount position information to the radar.

Parameters
[in]dataA pointer to the struct containing the radar mount position information to send.
[in]sensorSensor handle created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwSensorRadar_setVehicleState()

DW_API_PUBLIC dwStatus dwSensorRadar_setVehicleState ( dwRadarVehicleState *const  data,
dwSensorHandle_t const  sensor 
)

Sends vehicle dynamics information to the radar.

Parameters
[in]dataA pointer to the struct containing the vehicle dynamics information to send
[in]sensorSensor handle created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_SUCCESS

◆ dwSensorRadar_toggleScanType()

DW_API_PUBLIC dwStatus dwSensorRadar_toggleScanType ( bool const  enable,
dwRadarScanType const  scanType,
dwSensorHandle_t const  sensor 
)

Enables/Disables a scan type for the radar sensor.

Method fails if the sensor does not support the specified scan type OR the sensor has been started and is capturing data.

Parameters
[in]enableSpecifies if the scan should be enabled or disabled
[in]scanTypeSpecifies the scan type to enable
[in]sensorSpecifies the sensor handle of the sensor previously created with dwSAL_createSensor().
Returns
DW_INVALID_HANDLE, DW_INVALID_ARGUMENT, DW_CALL_NOT_ALLOWED, DW_SUCCESS