DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

PilotNetDetector.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed
3 // under the Mutual Non-Disclosure Agreement.
4 //
5 // Notice
6 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
7 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
8 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
9 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
10 //
11 // NVIDIA Corporation assumes no responsibility for the consequences of use of such
12 // information or for any infringement of patents or other rights of third parties that may
13 // result from its use. No license is granted by implication or otherwise under any patent
14 // or patent rights of NVIDIA Corporation. No third party distribution is allowed unless
15 // expressly authorized by NVIDIA. Details are subject to change without notice.
16 // This code supersedes and replaces all information previously supplied.
17 // NVIDIA Corporation products are not authorized for use as critical
18 // components in life support devices or systems without express written approval of
19 // NVIDIA Corporation.
20 //
21 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
22 //
23 // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
24 // rights in and to this software and related documentation and any modifications thereto.
25 // Any use, reproduction, disclosure or distribution of this software and related
26 // documentation without an express license agreement from NVIDIA Corporation is
27 // strictly prohibited.
28 //
30 
48 #ifndef DW_PILOTNETDETECTOR_H_
49 #define DW_PILOTNETDETECTOR_H_
50 
51 #include <dw/core/Config.h>
52 #include <dw/core/Types.h>
53 #include <dw/image/Image.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
62 #define DW_PILOTNET_MAX_TRAJ_LEN 200
63 
65 #define DW_PILOTNET_MAX_CAMERA_COUNT 7
66 #define DW_PILOTNET_MAX_ROI_VIEWS_PER_CAMERA 3
67 #define DW_PILOTNET_MAX_ROI_VIEWS DW_PILOTNET_MAX_CAMERA_COUNT* DW_PILOTNET_MAX_ROI_VIEWS_PER_CAMERA
68 
73 typedef enum dwPilotNetDrivingMode {
87 
93 typedef enum {
119 
123 typedef struct
124 {
126  dwPilotNetCameraType camera;
128  cudaStream_t stream;
132  uint32_t sensorId;
140 
145 typedef struct
146 {
150  uint32_t numSensors;
152 
156 typedef struct
157 {
163 
167 typedef struct
168 {
178 
183 typedef struct
184 {
200  bool lcStatusValid[DW_PILOTNET_MAX_DRIVING_MODES];
204  bool trajectoryValid[DW_PILOTNET_MAX_DRIVING_MODES];
208  size_t trajectoryLen[DW_PILOTNET_MAX_DRIVING_MODES];
210 
214 typedef struct dwPilotNetDetectorObject* dwPilotNetDetectorHandle_t;
215 
229  dwPilotNetHandle_t pilotnetDNN);
230 
244 dwStatus dwPilotNetDetector_initialize(dwPilotNetDetectorHandle_t* pilotnet,
245  const dwPilotNetDetectorParams* params,
246  dwPilotNetHandle_t pilotnetDNN);
247 
254 dwStatus dwPilotNetDetector_release(dwPilotNetDetectorHandle_t pilotnet);
255 
262 dwStatus dwPilotNetDetector_reset(dwPilotNetDetectorHandle_t pilotnet);
263 
276  dwPilotNetDetectorHandle_t pilotnet);
277 
290  dwPilotNetDetectorHandle_t pilotnet);
291 
308  uint32_t sensorId,
309  dwPilotNetDetectorHandle_t pilotnet);
310 
323 dwStatus dwPilotNetDetector_processFrames(dwPilotNetDetectorHandle_t pilotnet);
324 
336 dwStatus dwPilotNetDetector_infer(dwPilotNetDetectorHandle_t pilotnet);
337 
348 dwStatus dwPilotNetDetector_processOutput(dwPilotNetDetectorHandle_t pilotnet);
349 
365  uint32_t* numROI,
366  uint32_t sensorId,
367  dwPilotNetDetectorHandle_t pilotnet);
368 
384  uint32_t* numROI,
385  uint32_t sensorId,
386  dwPilotNetDetectorHandle_t pilotnet);
387 
406  uint32_t* numROI,
407  uint32_t sensorId,
408  dwPilotNetDetectorHandle_t pilotnet);
409 
426  size_t numPoints,
427  const dwVector3f* trajPoints,
428  size_t numTrajPoints,
429  uint32_t sensorId,
430  dwPilotNetDetectorHandle_t pilotnet);
431 
448  const uint32_t sensorId,
449  dwPilotNetDetectorHandle_t pilotnet);
450 
465  dwPilotNetDetectorHandle_t pilotnet);
466 
478  dwPilotNetDrivingMode drivingMode);
479 
480 #ifdef __cplusplus
481 }
482 #endif
483 
484 #endif // DW_PILOTNETDETECTOR_H_
DW_API_PUBLIC dwStatus dwPilotNetDetector_initialize(dwPilotNetDetectorHandle_t *pilotnet, const dwPilotNetDetectorParams *params, dwPilotNetHandle_t pilotnetDNN)
Creates and initializes the PilotNetDetector module with the given dwPilotNetHandle that is used for ...
NVIDIA DriveWorks API: Camera Methods
Holds the parameters to initialize the PilotNetDetector module.
bool rotationValid
If set to true, off-orientation output is valid.
uint32_t sensorId
Sensor ID of the sensor from the vehicle rig.
NVIDIA DriveWorks API: Core Types
float float32_t
Specifies POD types.
Definition: Types.h:70
Defines a rectangle.
Definition: Types.h:189
Forward facing right cross camera with 120deg FOV.
Defines a three-element floating-point vector.
Definition: Types.h:319
Defines a two-element single-precision floating-point vector.
Definition: Types.h:291
DW_API_PUBLIC dwStatus dwPilotNetDetector_initParams(dwPilotNetDetectorParams *params, dwPilotNetHandle_t pilotnetDNN)
Initializes the PilotNetDetector module params with the given dwPilotNetHandle.
NVIDIA DriveWorks API: PilotNet Module
dwTime_t commandTimeStamp
Timestamp when the output values are filled in.
float32_t rotation
Off-orientation position (yaw) of vehicle in degrees.
Defines a CUDA image.
Definition: Image.h:266
DW_API_PUBLIC dwStatus dwPilotNetDetector_setState(dwPilotNetDetectorState inputState, dwPilotNetDetectorHandle_t pilotnet)
Sets the driving state for the current frame.
DW_API_PUBLIC dwStatus dwPilotNetDetector_setSensorExtrinsics(const dwTransformation3f *tx, const uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Setting PilotNetDetector extrinsic camera calibration parameters .
uint32_t numSensors
PilotNetDetector camera type.
float32_t cameraPitch
Predicted camera pitch.
DW_API_PUBLIC dwStatus dwPilotNetDetector_getPatchU8(const dwImageCUDA **dwImg, uint32_t *numROI, uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Get a pointer to the CUDA patch buffer.
NVIDIA DriveWorks API: Image Conversion and Streaming Functionality
Definition: Types.h:204
Forward facing center camera with 120deg FOV.
float32_t fps
Update rate of the data from this sensor.
dwCameraModelHandle_t cameraModel
Camera model.
Holds the left and right lane dividers for a single lane type.
bool cameraPitchValid
If set to true, camera pitch is valid.
Specifies a 3D rigid transformation.
Definition: Types.h:462
DW_API_PUBLIC dwStatus dwPilotNetDetector_getROIParams(dwRectf *roi, uint32_t *numROI, uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Get the parameters for the region of interest (ROI) calculated by dwPilotNetDetector_processFrames.
bool rightLaneDividerValid
Right lane divider validity.
DW_API_PUBLIC dwStatus dwPilotNetDetector_getVisMaskU8(const dwImageCUDA **dwImg, uint32_t *numROI, uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Gets a pointer to the CUDA visualization mask buffer.
dwPilotNetCameraType camera
PilotNetDetector camera type.
dwStatus
Status definition.
Definition: Status.h:178
Holds the output trajectories and other predictions of PilotNetDetector.
#define DW_PILOTNET_MAX_TRAJ_LEN
The maximum trajectory length.
float32_t lcLength
Lane change length in m.
DW_API_PUBLIC dwStatus dwPilotNetDetector_release(dwPilotNetDetectorHandle_t pilotnet)
Releases the PilotNetDetector module.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: Types.h:82
dwRect inDimensions
Input Image dimensions of the data from this sensor.
Forward facing right offset camera with 120deg FOV.
dwTransformation3f cameraExtrinsics
Camera Extrinsics.
DW_API_PUBLIC dwStatus dwPilotNetDetector_bindOutput(dwPilotNetDetectorOutput *output, dwPilotNetDetectorHandle_t pilotnet)
Bind the memory of the output to a pre-allocated memory in the application.
cudaStream_t stream
Stream to be used for a particular sensor.
DW_API_PUBLIC dwStatus dwPilotNetDetector_reset(dwPilotNetDetectorHandle_t pilotnet)
Resets the PilotNetDetector module.
dwPilotNetCameraType
The cameras supported by the PilotNetDetector module.
dwTime_t inputTimestamp
Timestamp of the input image.
struct dwPilotNetDetectorObject * dwPilotNetDetectorHandle_t
Handle for PilotNetDetector.
DW_API_PUBLIC dwStatus dwPilotNetDetector_getDrivingModeString(const char **string, dwPilotNetDrivingMode drivingMode)
Getting the driving mode enum as a string.
float32_t curSpeed
Speed in m/s.
Forward facing left cross camera with 120deg FOV.
DW_API_PUBLIC dwStatus dwPilotNetDetector_convertPointsRigToSensor(dwVector2f *points, size_t numPoints, const dwVector3f *trajPoints, size_t numTrajPoints, uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Get the trajectory points based on the network output in image space.
DW_API_PUBLIC dwStatus dwPilotNetDetector_getAvailableDrivingModes(bool *modes, dwPilotNetDetectorHandle_t pilotnet)
Getting supported driving modes from PilotNetDetector.
#define DW_PILOTNET_MAX_CAMERA_COUNT
The maximum supported ROI Views.
struct dwPilotNetObject * dwPilotNetHandle_t
Handle for PilotNet DNN object.
Definition: PilotNet.h:61
struct dwCameraModelObject * dwCameraModelHandle_t
A pointer to the handle representing a calibrated camera model.
Definition: CameraModel.h:68
DW_API_PUBLIC dwStatus dwPilotNetDetector_setCameraFrame(const dwImageCUDA *inputFrame, uint32_t sensorId, dwPilotNetDetectorHandle_t pilotnet)
Sets the input camera frame for inferencing.
DW_API_PUBLIC dwStatus dwPilotNetDetector_infer(dwPilotNetDetectorHandle_t pilotnet)
Runs the inference on the patch produced by dwPilotNetDetector_processFrames to output the driving tr...
dwPilotNetDrivingMode
Defines the different driving trajectories produced by the PilotNet network.
bool leftLaneDividerValid
Left lane divider validity.
Holds the camera properties for PilotNetDetector.
#define DW_API_PUBLIC
Definition: Exports.h:56
DW_API_PUBLIC dwStatus dwPilotNetDetector_processOutput(dwPilotNetDetectorHandle_t pilotnet)
Gets the driving state (mode, commands) for the last processed image.
Forward facing left offset camera with 120deg FOV.
Forward facing center camera with 60deg FOV.
Holds the input state values for PilotNetDetector.
DW_API_PUBLIC dwStatus dwPilotNetDetector_processFrames(dwPilotNetDetectorHandle_t pilotnet)
Processes the input image(s) by calculating a patch for the region of interest (ROI) by compensating ...