NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
SensorManager.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
27 #ifndef DW_SENSORS_SENSORMANAGER_H_
28 #define DW_SENSORS_SENSORMANAGER_H_
29 
30 #include <dw/rig/Rig.h>
31 #include <dw/sensors/common/Sensors.h>
32 #include <dw/sensors/camera/Camera.h>
33 #include <dw/sensors/imu/IMU.h>
34 #include <dw/sensors/gps/GPS.h>
35 #include <dw/sensors/radar/Radar.h>
36 #include <dw/sensors/data/Data.h>
37 
38 #ifndef DW_IS_SAFETY
39 #include <dw/sensors/canbus/CANTypes.h>
40 #endif
41 
42 #if !defined(DW_L2_BUILD) && !defined(DW_IS_SAFETY)
43 #include <dw/sensors/lidar/Lidar.h>
44 #endif
45 
46 #include "SensorManagerConstants.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 typedef struct dwSensorManagerObject* dwSensorManagerHandle_t;
53 
57 
58 #if defined(DW_L2_BUILD) || defined(DW_IS_SAFETY)
60 #else
62 #endif
63 
65 typedef struct
66 {
69 
73  uint32_t sensorTypeIndex;
74 
77 
81  uint32_t sensorIndex;
82 
84  uint32_t sensorIndices[DW_SENSORMANGER_MAX_CAMERAS];
85 
88  uint32_t numCamFrames;
90 
91  // Data accessor for all other sensors
94 #ifndef DW_IS_SAFETY
96 #endif
100  const uint8_t* rawData;
101  size_t rawDataSize;
103 } dwSensorEvent;
104 
110 {
113 };
114 
119 typedef struct
120 {
128 
133 typedef struct
134 {
137 
139  uint32_t enableSensors[DW_SENSORMANGER_MAX_NUM_SENSORS];
140 
144 
154 
156 
174  size_t poolSize, dwSALHandle_t const sal);
175 
203  size_t poolSize, dwSALHandle_t sal);
204 
235  size_t poolSize, dwSALHandle_t const sal);
236 
253 
279 
307 dwStatus dwSensorManager_addCameraSensor(const char8_t* groupName, uint32_t siblingIndex,
308  dwSensorParams params, uint64_t clientData,
310 
326 
342 
358 
380 dwStatus dwSensorManager_acquireNextEvent(const dwSensorEvent** ev, dwTime_t timeoutMicroSeconds,
382 
402 
420 
438 
455 dwStatus dwSensorManager_getSensorClientData(uint64_t* cd, uint32_t sensorIndex, dwSensorManagerHandle_t sm);
456 
475  uint32_t sensorTypeIndex, dwSensorManagerHandle_t sm);
476 
496  uint32_t sensorIndex, dwSensorManagerHandle_t sm);
497 
519 
537 #ifdef __cplusplus
538 }
539 #endif
540 
542 #endif // DW_SENSORS_SENSORMANAGER_H_
dwDispatcherParams::timeout
dwTime_t timeout
Timeout value to be used in dispatcher mode for virtual files, in microsecond.
Definition: SensorManager.h:126
dwSensorManager_initialize
DW_API_PUBLIC dwStatus dwSensorManager_initialize(dwSensorManagerHandle_t *sm, size_t poolSize, dwSALHandle_t const sal)
Creates an instance of SensorManager module.
dwGPSFrame
A GPS packet containing localization information.
Definition: GPSFrame.h:284
dwSensorManager_reset
DW_API_PUBLIC dwStatus dwSensorManager_reset(dwSensorManagerHandle_t sm)
Resets all sensors.
dwSensorHandle_t
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: SensorTypes.h:42
dwSensorManagerParams::dispatcherParams
dwDispatcherParams dispatcherParams
Parameters to configure dispatcher mode.
Definition: SensorManager.h:136
dwSensorManager_stop
DW_API_PUBLIC dwStatus dwSensorManager_stop(dwSensorManagerHandle_t sm)
Stops all sensors.
dwSensorEvent::timestamp_us
dwTime_t timestamp_us
Timestamp (us)
Definition: SensorManager.h:76
dwConstRigHandle_t
struct dwRigObject const * dwConstRigHandle_t
Handle representing the const Rig interface.
Definition: Rig.h:58
dwLidarDecodedPacket_t
dwLidarDecodedPacket dwLidarDecodedPacket_t
Definition: SensorManager.h:61
dwSensorParams
Holds sets of parameters for sensor creation.
Definition: SensorTypes.h:50
dwSensorManager_initializeFromRigWithParams
DW_API_PUBLIC dwStatus dwSensorManager_initializeFromRigWithParams(dwSensorManagerHandle_t *sm, dwConstRigHandle_t rc, const dwSensorManagerParams *params, size_t poolSize, dwSALHandle_t const sal)
Creates and initializes a SensorManager module, adding enabled sensors in the provided Rig Configurat...
dwSensorManager_addSensor
DW_API_PUBLIC dwStatus dwSensorManager_addSensor(dwSensorParams params, uint64_t clientData, dwSensorManagerHandle_t sm)
Adds a sensor to the SAL instance and add it to SensorManager to manage it.
dwSensorManagerParams
Parameters for sensor manager, used to create a sensor manager.
Definition: SensorManager.h:133
dwSensorManager_getSensorIndex
DW_API_PUBLIC dwStatus dwSensorManager_getSensorIndex(uint32_t *sensorIndex, dwSensorType type, uint32_t sensorTypeIndex, dwSensorManagerHandle_t sm)
Gets sensor's index according to the dwSensorType and the sensorTypeIndex.
dwSensorManagerParams::singleVirtualCameraGroup
bool singleVirtualCameraGroup
Whether to associate virtual cameras to individual 'camera-group's (default), or to a single 'camera-...
Definition: SensorManager.h:152
dwDispatcherParams
Parameters for dispatcher, used to define some behaviors of dispatcher.
Definition: SensorManager.h:119
dwSensorEvent::radFrame
const dwRadarScan * radFrame
Radar scan in this event.
Definition: SensorManager.h:97
dwSensorEvent::rawData
const uint8_t * rawData
Raw data in this event.
Definition: SensorManager.h:100
dwSensorManager_release
DW_API_PUBLIC dwStatus dwSensorManager_release(dwSensorManagerHandle_t sm)
Releases the SensorManager module by deleting the handle.
dwCANMessage
Holds a CAN package.
Definition: CANTypes.h:89
dwSensorEvent
Structure for returning data upon any sensor event.
Definition: SensorManager.h:65
dwDispatcherParams::camFramesTimeDiffLimit
dwTime_t camFramesTimeDiffLimit
Up to how much can timestamps of camera frames accumulated in a single event differ,...
Definition: SensorManager.h:124
dwRadarScan
Defines the structure for a complete radar scan.
Definition: RadarFullTypes.h:42
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:124
DW_SENSOR_MANAGER_DATA_MODE_RAW
@ DW_SENSOR_MANAGER_DATA_MODE_RAW
Sensor manager will read only raw data.
Definition: SensorManager.h:112
dwSensorManagerHandle_t
struct dwSensorManagerObject * dwSensorManagerHandle_t
Handle of sensor manager.
Definition: SensorManager.h:52
dwSensorManager_releaseAcquiredEvent
DW_API_PUBLIC dwStatus dwSensorManager_releaseAcquiredEvent(const dwSensorEvent *ev, dwSensorManagerHandle_t sm)
Releases a previously acquired event back to the pool.
dwCameraFrameHandle_t
struct dwCameraFrame * dwCameraFrameHandle_t
Handle to captured frame.
Definition: Camera.h:73
dwSensorEvent::imuFrame
dwIMUFrame imuFrame
IMU frame in this event.
Definition: SensorManager.h:93
dwUltrasonicFrame
struct dwUltrasonicFrame dwUltrasonicFrame
Definition: SensorManager.h:56
dwSensorEvent::gpsFrame
dwGPSFrame gpsFrame
GPS frame in this event.
Definition: SensorManager.h:92
dwSensorEvent::numCamFrames
uint32_t numCamFrames
Data accessor for camera.
Definition: SensorManager.h:88
dwTime_t
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:54
dwSensorManager_getSensorTypeIndex
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.
SensorManagerConstants.h
char8_t
char char8_t
Definition: BasicTypes.h:47
dwSensorManagerDataMode
dwSensorManagerDataMode
Data mode in this unit, which determines whether read raw data.
Definition: SensorManager.h:109
dwIMUFrame
This structure contains one frame of data from a IMU sensor.
Definition: IMUTypes.h:396
DW_SENSORMANGER_MAX_CAMERAS
#define DW_SENSORMANGER_MAX_CAMERAS
Definition: SensorManagerConstants.h:24
dwLidarDecodedPacket
Defines the structure for a decoded lidar packet.
Definition: LidarTypes.h:275
dwSensorManagerDispatcher_t
void(* dwSensorManagerDispatcher_t)(const dwSensorEvent *, void *, dwStatus)
function pointer of sensormanager dispatcher.
Definition: SensorManager.h:155
WFDCommitType
WFDCommitType
Definition: wfd.h:112
dwUltrasonicEnvelope
struct dwUltrasonicEnvelope dwUltrasonicEnvelope
Not available as of current release. Will be added in future releases.
Definition: SensorManager.h:55
dwSensorManager_acquireNextEvent
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.
dwSensorType
dwSensorType
Defines the type of sensors that are available in DriveWorks.
Definition: SensorTypes.h:74
void
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
dwSensorEvent::ultrasonicFrame
const dwUltrasonicFrame * ultrasonicFrame
Ultrasonic frame in this event.
Definition: SensorManager.h:102
dwSensorManager_setTimeout
DW_API_PUBLIC dwStatus dwSensorManager_setTimeout(dwTime_t timeout, dwSensorManagerHandle_t sm)
Sets the timeout to wait for a new frame across all sensors.
dwSensorManager_getSensorClientData
DW_API_PUBLIC dwStatus dwSensorManager_getSensorClientData(uint64_t *cd, uint32_t sensorIndex, dwSensorManagerHandle_t sm)
Gets sensor's clientData according to the assigned sensorIndex.
dwSensorEvent::rawDataSize
size_t rawDataSize
Raw data size in this event.
Definition: SensorManager.h:101
dwDispatcherParams::accumCamFrames
bool accumCamFrames
Whether Dispatcher shall accumulated frames from all cameras into a single event.
Definition: SensorManager.h:122
dwSensorEvent::sensorIndex
uint32_t sensorIndex
The index of the sensor as defined by the order in which it was created.
Definition: SensorManager.h:81
dwSensorEvent::lidFrame
const dwLidarDecodedPacket_t * lidFrame
Lidar decoded packet in this event.
Definition: SensorManager.h:98
dwSALHandle_t
struct dwSALObject * dwSALHandle_t
Handle representing the Sensor Abstraction Layer interface.
Definition: SensorTypes.h:39
DW_SENSOR_MANAGER_DATA_MODE_NON_RAW
@ DW_SENSOR_MANAGER_DATA_MODE_NON_RAW
Sensor manager doesn't read raw data, but just offer decoded packet for users.
Definition: SensorManager.h:111
dwSensorEvent::sensorTypeIndex
uint32_t sensorTypeIndex
Index of the given sensor as defined by the order in which it was created and the type of sensor it i...
Definition: SensorManager.h:73
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
dwSensorManagerParams::numEnableSensors
uint32_t numEnableSensors
Number of entries in the 'enableSensors' list.
Definition: SensorManager.h:143
DW_SENSORMANGER_MAX_NUM_SENSORS
#define DW_SENSORMANGER_MAX_NUM_SENSORS
Definition: SensorManagerConstants.h:26
params
DW_API_PUBLIC dwPointCloudRangeImageCreatorParams const *const params
Definition: PointCloudRangeImageCreator.h:292
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
dwSensorManager_addCameraSensor
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 and add it to SensorManager to manage it.
dwDataPacket
Holds a data packet.
Definition: Data.h:41
dwSensorEvent::dataFrame
const dwDataPacket * dataFrame
dwDataPacket(see reference 15) in this event.
Definition: SensorManager.h:99
dwSensorManager_getSensorHandle
DW_API_PUBLIC dwStatus dwSensorManager_getSensorHandle(dwSensorHandle_t *handle, uint32_t sensorIndex, dwSensorManagerHandle_t sm)
Gets the sensor handle to the specified sensor.
dwSensorManager_getNumSensors
DW_API_PUBLIC dwStatus dwSensorManager_getNumSensors(uint32_t *count, dwSensorType type, dwSensorManagerHandle_t sm)
Gets the number of sensors in the SensorManager instantiated for a given sensor type.
dwSensorManager_start
DW_API_PUBLIC dwStatus dwSensorManager_start(dwSensorManagerHandle_t sm)
Starts all sensors.
dwSensorEvent::type
dwSensorType type
Type of sensor providing data for this event.
Definition: SensorManager.h:68
dwSensorManager_initializeFromRig
DW_API_PUBLIC dwStatus dwSensorManager_initializeFromRig(dwSensorManagerHandle_t *sm, dwConstRigHandle_t rc, size_t poolSize, dwSALHandle_t sal)
Create and initialize a SensorManager module, adding all sensors in the provided Rig Configuration.
dwSensorEvent::canFrame
dwCANMessage canFrame
CAN message frame in this event.
Definition: SensorManager.h:95
dwSensorManager_setDispatcher
DW_API_PUBLIC dwStatus dwSensorManager_setDispatcher(dwSensorManagerDispatcher_t dispatchPtr, void *const cookie, dwSensorManagerHandle_t sm)
Register sensor's dispatcher function when the feature is turned on.