- Welcome
- Getting Started With the NVIDIA DriveWorks SDK
- Modules
- Samples
- Tools
- Tutorials
- SDK Porting Guide
- DriveWorks API
- More
Defines sensor management interface layer.
Data Structures | |
struct | dwDispatcherParams |
struct | dwSensorEvent |
Structure for returning data upon any sensor event. More... | |
struct | dwSensorManagerParams |
Macros | |
#define | DW_SENSORMANGER_MAX_CAMERAS 16U |
#define | DW_SENSORMANGER_MAX_NUM_SENSORS 64U |
Typedefs | |
typedef void(* | dwSensorManagerDispatcher_t) (const dwSensorEvent *, void *, dwStatus) |
typedef struct dwSensorManagerObject * | dwSensorManagerHandle_t |
typedef struct _dwUltrasonicEnvelope | dwUltrasonicEnvelope |
Not available as of current release. Will be added in future releases. More... | |
Enumerations | |
enum | dwSensorManagerDataMode { DW_SENSOR_MANAGER_DATA_MODE_NON_RAW = 0 , DW_SENSOR_MANAGER_DATA_MODE_RAW = 1 } |
Functions | |
DW_API_PUBLIC dwStatus | dwSensorManager_acquireNextEvent (const dwSensorEvent **ev, dwTime_t timeoutMicroSeconds, dwSensorManagerHandle_t sm) |
Called by the application to consume the next available sensor event ready for consumption. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_addCameraSensor (const char8_t *groupName, uint32_t siblingIndex, dwSensorParams params, uint64_t clientData, dwSensorManagerHandle_t sm) |
Adds a camera sensor to the SAL instance. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_addSensor (dwSensorParams params, uint64_t clientData, dwSensorManagerHandle_t sm) |
Adds a sensor to the SAL instance. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_getNumSensors (uint32_t *count, dwSensorType type, dwSensorManagerHandle_t sm) |
Gets the number of sensors instantiated for a given sensor type. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_getSensorClientData (uint64_t *cd, uint32_t sensorIndex, dwSensorManagerHandle_t sm) |
Gets sensor's clientData. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_getSensorHandle (dwSensorHandle_t *handle, uint32_t sensorIndex, dwSensorManagerHandle_t sm) |
Gets the sensor handle to the specified sensor. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_getSensorIndex (uint32_t *sensorIndex, dwSensorType type, uint32_t sensorTypeIndex, dwSensorManagerHandle_t sm) |
Gets sensor's index. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_getSensorTypeIndex (uint32_t *sensorTypeIndex, dwSensorType *type, uint32_t sensorIndex, dwSensorManagerHandle_t sm) |
Gets sensor's relative index and type based upon its sensor index. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_initialize (dwSensorManagerHandle_t *sm, size_t poolSize, dwSALHandle_t const sal) |
Creates and initializes a SensorManager module. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_initializeFromRig (dwSensorManagerHandle_t *sm, dwRigHandle_t rc, size_t poolSize, dwSALHandle_t sal) |
Creates and initializes a SensorManager module, adding all sensors in the provided Rig Configuration. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_initializeFromRigWithParams (dwSensorManagerHandle_t *sm, dwRigHandle_t const rc, const dwSensorManagerParams *params, size_t poolSize, dwSALHandle_t const sal) |
Creates and initializes a SensorManager module, adding enabled sensors in the provided Rig Configuration, and configuring SensorManager according to params provided. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_release (dwSensorManagerHandle_t sm) |
Releases the SensorManager module. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_releaseAcquiredEvent (const dwSensorEvent *ev, dwSensorManagerHandle_t sm) |
Releases a previously acquired event back to the pool. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_reset (dwSensorManagerHandle_t sm) |
Resets all sensors. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_setDispatcher (dwSensorManagerDispatcher_t dispatchPtr, void *const cookie, dwSensorManagerHandle_t sm) |
Sets sensor's dispatcher function when the feature is turned on. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_setTimeout (dwTime_t timeout, dwSensorManagerHandle_t sm) |
Sets the timeout to wait for a new frame across all sensors. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_start (dwSensorManagerHandle_t sm) |
Starts all sensors. More... | |
DW_API_PUBLIC dwStatus | dwSensorManager_stop (dwSensorManagerHandle_t sm) |
Stops all sensors. More... | |
struct dwDispatcherParams |
Data Fields | ||
---|---|---|
bool | accumCamFrames | Whether Dispatcher shall accumulated frames from all cameras into a single event. |
dwTime_t | camFramesTimeDiffLimit | Up to how much can timstamps of camera frames accumulated in a single event differ. |
dwTime_t | timeout | Timeout value to be used in dispatcher mode for virtual files. |
struct dwSensorEvent |
Data Fields | ||
---|---|---|
dwCameraFrameHandle_t | camFrames[DW_SENSORMANGER_MAX_CAMERAS] | |
dwCANMessage | canFrame | |
const dwDataPacket * | dataFrame | |
dwGPSFrame | gpsFrame | Data accessor for all other sensors. |
dwIMUFrame | imuFrame | |
const dwLidarDecodedPacket * | lidFrame | |
uint32_t | numCamFrames | |
const dwRadarScan * | radFrame | |
const uint8_t * | rawData | |
size_t | rawDataSize | |
uint32_t | sensorIndex |
The index of the sensor as defined by the order in which it was created. If the sensor manager was created via the rig configuration file this will match that sensor index. If it was not created via the rig configuration will be the number of sensors already created |
uint32_t | sensorIndices[DW_SENSORMANGER_MAX_CAMERAS] | If the event is a multisensor event then the sensor indices of all sensors involved will be stored here. |
uint32_t | sensorTypeIndex | Index of the given sensor as defined by the order in which it was created and the type of sensor it is (ie Camera and Lidar can have sensorTypeIndex 0 because they are different sensor types. |
dwTime_t | timestamp_us | Timestamp (us) |
dwSensorType | type | Type of sensor providing data for this event. |
const dwUltrasonicEnvelope * | ultrasonicFrame |
struct dwSensorManagerParams |
Data Fields | ||
---|---|---|
dwDispatcherParams | dispatcherParams | Parameters to configure dispatcher mode. |
uint32_t | enableSensors[DW_SENSORMANGER_MAX_NUM_SENSORS] | List of sensors indices to be enabled during initialization (i.e. whitelist) |
uint32_t | numEnableSensors |
Number of entries in the 'enableSensors' list.
|
bool | singleVirtualCameraGroup |
Whether to associate virtual cameras to individual 'camera-group's (default), or to a single 'camera-group' (in case no dedicated per sensor 'camera-group' is specified for a given camera sensor in its sensor parameters). Distinct groups for each virtual camera are beneficial if sensors were recorded within different groups / on different devices (as otherwise potential time-offsets can be introduced if all virtual cameras are treated as a single group), but some applications might expect virtual cameras to be associated to a single group |
#define DW_SENSORMANGER_MAX_CAMERAS 16U |
Definition at line 67 of file SensorManager.h.
#define DW_SENSORMANGER_MAX_NUM_SENSORS 64U |
Definition at line 69 of file SensorManager.h.
typedef void(* dwSensorManagerDispatcher_t) (const dwSensorEvent *, void *, dwStatus) |
Definition at line 154 of file SensorManager.h.
typedef struct dwSensorManagerObject* dwSensorManagerHandle_t |
Definition at line 71 of file SensorManager.h.
typedef struct _dwUltrasonicEnvelope dwUltrasonicEnvelope |
Not available as of current release. Will be added in future releases.
Definition at line 74 of file SensorManager.h.
Enumerator | |
---|---|
DW_SENSOR_MANAGER_DATA_MODE_NON_RAW | |
DW_SENSOR_MANAGER_DATA_MODE_RAW |
Definition at line 116 of file SensorManager.h.
DW_API_PUBLIC dwStatus dwSensorManager_acquireNextEvent | ( | const dwSensorEvent ** | ev, |
dwTime_t | timeoutMicroSeconds, | ||
dwSensorManagerHandle_t | sm | ||
) |
Called by the application to consume the next available sensor event ready for consumption.
The method will return the oldest available event among all sensors.
[out] | ev | A pointer to a pointer of the event to be acquired |
[in] | timeoutMicroSeconds | time threshold to bail out if no new event is available |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_addCameraSensor | ( | const char8_t * | groupName, |
uint32_t | siblingIndex, | ||
dwSensorParams | params, | ||
uint64_t | clientData, | ||
dwSensorManagerHandle_t | sm | ||
) |
Adds a camera sensor to the SAL instance.
All addCameraSensor() calls must be completed before the start() call.
[in] | groupName | Specifies the group name for this camera |
[in] | siblingIndex | Specifies the sibling id for this camera (GMSL only) |
[in] | params | Specifies the parameters for sensor creation. |
[in] | clientData | Client data to be added for this sensor |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_addSensor | ( | dwSensorParams | params, |
uint64_t | clientData, | ||
dwSensorManagerHandle_t | sm | ||
) |
Adds a sensor to the SAL instance.
All addSensor() calls must be completed before the start() call.
[in] | params | Specifies the parameters for sensor creation. |
[in] | clientData | Client data to be added for this sensor |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_getNumSensors | ( | uint32_t * | count, |
dwSensorType | type, | ||
dwSensorManagerHandle_t | sm | ||
) |
Gets the number of sensors instantiated for a given sensor type.
[out] | count | A pointer to return the number of sensors |
[in] | type | Type of sensor to return the count for |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_getSensorClientData | ( | uint64_t * | cd, |
uint32_t | sensorIndex, | ||
dwSensorManagerHandle_t | sm | ||
) |
Gets sensor's clientData.
[out] | cd | Pointer to location where clientData shall be returned |
[in] | sensorIndex | Index of the sensor |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_getSensorHandle | ( | dwSensorHandle_t * | handle, |
uint32_t | sensorIndex, | ||
dwSensorManagerHandle_t | sm | ||
) |
Gets the sensor handle to the specified sensor.
[in] | handle | Pointer to location where handle shall be returned |
[in] | sensorIndex | Index of the sensor |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_getSensorIndex | ( | uint32_t * | sensorIndex, |
dwSensorType | type, | ||
uint32_t | sensorTypeIndex, | ||
dwSensorManagerHandle_t | sm | ||
) |
Gets sensor's index.
[out] | sensorIndex | Pointer to location where the sensor index should be returned |
[in] | type | Type of sensor being requested |
[in] | sensorTypeIndex | Index of the sensor as defined by the dwSensorType |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_getSensorTypeIndex | ( | uint32_t * | sensorTypeIndex, |
dwSensorType * | type, | ||
uint32_t | sensorIndex, | ||
dwSensorManagerHandle_t | sm | ||
) |
Gets sensor's relative index and type based upon its sensor index.
[out] | sensorTypeIndex | Pointer to location where the index of the sensor as defined by the dwSensorType should be returned |
[out] | type | Pointer to location where the type of sensor should be returned |
[in] | sensorIndex | Index of the sensor |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_initialize | ( | dwSensorManagerHandle_t * | sm, |
size_t | poolSize, | ||
dwSALHandle_t const | sal | ||
) |
Creates and initializes a SensorManager module.
[out] | sm | A pointer to the sm handle will be returned here. |
[in] | poolSize | Size of the event pool to be allocated. Has to be greater than 0 |
[in] | sal | SAL handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_initializeFromRig | ( | dwSensorManagerHandle_t * | sm, |
dwRigHandle_t | rc, | ||
size_t | poolSize, | ||
dwSALHandle_t | sal | ||
) |
Creates and initializes a SensorManager module, adding all sensors in the provided Rig Configuration.
[out] | sm | A pointer to the sm handle will be returned here. |
[in] | rc | Rig Configuration handle |
[in] | poolSize | Size of the event pool to be allocated. Has to be greater than 0 |
[in] | sal | SAL handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_initializeFromRigWithParams | ( | dwSensorManagerHandle_t * | sm, |
dwRigHandle_t const | rc, | ||
const dwSensorManagerParams * | params, | ||
size_t | poolSize, | ||
dwSALHandle_t const | sal | ||
) |
Creates and initializes a SensorManager module, adding enabled sensors in the provided Rig Configuration, and configuring SensorManager according to params provided.
[out] | sm | A pointer to the sm handle will be returned here. |
[in] | rc | Rig Configuration handle |
[in] | params | Params to configure SensorManager |
[in] | poolSize | Size of the event pool to be allocated. Has to be greater than 0 |
[in] | sal | SAL handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_release | ( | dwSensorManagerHandle_t | sm | ) |
Releases the SensorManager module.
[out] | sm | The sensor manager handle that needs to be released |
DW_API_PUBLIC dwStatus dwSensorManager_releaseAcquiredEvent | ( | const dwSensorEvent * | ev, |
dwSensorManagerHandle_t | sm | ||
) |
Releases a previously acquired event back to the pool.
For certain sensors, this call will also trigger returning the backing buffer back to the DW sensor bufferpools.
[in] | ev | A pointer to the event to be returned |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_reset | ( | dwSensorManagerHandle_t | sm | ) |
Resets all sensors.
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_setDispatcher | ( | dwSensorManagerDispatcher_t | dispatchPtr, |
void *const | cookie, | ||
dwSensorManagerHandle_t | sm | ||
) |
Sets sensor's dispatcher function when the feature is turned on.
[in] | dispatchPtr | dispatcher function pointer |
[in] | cookie | pointer of the the class object in which the dispatcher member function is defined |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_setTimeout | ( | dwTime_t | timeout, |
dwSensorManagerHandle_t | sm | ||
) |
Sets the timeout to wait for a new frame across all sensors.
Should be called before dwSensorManager_start.
[in] | timeout | Timeout in microseconds to wait for a new frame. |
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_start | ( | dwSensorManagerHandle_t | sm | ) |
Starts all sensors.
[in] | sm | SM handle instantiated by the caller |
DW_API_PUBLIC dwStatus dwSensorManager_stop | ( | dwSensorManagerHandle_t | sm | ) |
Stops all sensors.
[in] | sm | SM handle instantiated by the caller |