NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

Defines A API for the GPSsensor.

Data Structures

struct  dwGPSSignalValidityInfo
 This structure contains validity of each signal provided by GPS sensors. More...
 
struct  dwGPSFrame
 A GPS packet containing localization information. More...
 

Typedefs

typedef enum dwGPSTimestampFormat dwGPSTimestampFormat
 Timestamp format of the GPS sensor, should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value). More...
 
typedef enum dwGPSJamState dwGPSJamState
 The GPS jam state gives jamming state detected by the GNSS-receiver. More...
 
typedef enum dwGPSSpoofState dwGPSSpoofState
 The GPS spoof state gives spoofing-state detected by the GNSS-receiver. More...
 
typedef enum dwGPSMode dwGPSMode
 The GPS mode gives the status of the GNSS data. More...
 
typedef enum dwGPSFixStatus dwGPSFixStatus
 GPS satellite fix status. More...
 
typedef enum dwGPSTimestampQuality dwGPSTimestampQuality
 GPS timestamp quality. More...
 
typedef enum dwGPSAlignmentStatus dwGPSAlignmentStatus
 High rate data output from GNSS-IMU device requires fusion of GNSS and IMU. More...
 
typedef struct dwGPSSignalValidityInfo dwGPSSignalValidityInfo
 This structure contains validity of each signal provided by GPS sensors. More...
 
typedef struct dwGPSFrame dwGPSFrame
 A GPS packet containing localization information. More...
 

Enumerations

enum  dwGPSTimestampFormat {
  DW_GPS_TIMESTAMP_FORMAT_UNSPECIFIED = 0,
  DW_GPS_TIMESTAMP_FORMAT_PTP64 = 1,
  DW_GPS_TIMESTAMP_FORMAT_PTP16 = 2,
  DW_GPS_TIMESTAMP_FORMAT_CCPLEX_TSC = 3,
  DW_GPS_TIMESTAMP_FORMAT_FORCE32 = 0x7fffffff
}
 Timestamp format of the GPS sensor, should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value). More...
 
enum  dwGPSJamState {
  DW_GPS_JAM_STATE_UNSPECIFIED = 0,
  DW_GPS_JAM_STATE_OK = 1,
  DW_GPS_JAM_STATE_WARN = 2,
  DW_GPS_JAM_STATE_CRITICAL = 3,
  DW_GPS_JAM_STATE_INIT = 4,
  DW_GPS_JAM_STATE_FORCE32 = 0x7fffffff
}
 The GPS jam state gives jamming state detected by the GNSS-receiver. More...
 
enum  dwGPSSpoofState {
  DW_GPS_SPOOF_STATE_UNSPECIFIED = 0,
  DW_GPS_SPOOF_STATE_NO = 1,
  DW_GPS_SPOOF_STATE_YES = 2,
  DW_GPS_SPOOF_STATE_MULTI = 3,
  DW_GPS_SPOOF_STATE_INIT = 4,
  DW_GPS_SPOOF_STATE_FORCE32 = 0x7fffffff
}
 The GPS spoof state gives spoofing-state detected by the GNSS-receiver. More...
 
enum  dwGPSMode {
  DW_GPS_MODE_UNKNOWN = 0,
  DW_GPS_MODE_INVALID_GPS = 1,
  DW_GPS_MODE_DEAD_RECKONING = 2,
  DW_GPS_MODE_STAND_ALONE = 3,
  DW_GPS_MODE_PRECISE_POINT = 4,
  DW_GPS_MODE_CODE_DIFFERENTIAL = 5,
  DW_GPS_MODE_RTK_FLOAT = 6,
  DW_GPS_MODE_RTK_FIXED = 7,
  DW_GPS_MODE_PPP_CONVERGING = 8,
  DW_GPS_MODE_PPP_CONVERGED = 9,
  DW_GPS_MODE_FORCE32 = 0x7fffffff
}
 The GPS mode gives the status of the GNSS data. More...
 
enum  dwGPSFixStatus {
  DW_GPS_FIX_STATUS_NO_FIX = 0,
  DW_GPS_FIX_STATUS_2D_FIX = 1,
  DW_GPS_FIX_STATUS_3D_FIX = 2,
  DW_GPS_FIX_STATUS_FORCE32 = 0x7fffffff
}
 GPS satellite fix status. More...
 
enum  dwGPSTimestampQuality {
  DW_GPS_TIMESTAMP_QUALITY_NOT_INIT = 0,
  DW_GPS_TIMESTAMP_QUALITY_OK = 1,
  DW_GPS_TIMESTAMP_QUALITY_SYNC_LOST = 2,
  DW_GPS_TIMESTAMP_QUALITY_FORCE32 = 0x7fffffff
}
 GPS timestamp quality. More...
 
enum  dwGPSAlignmentStatus {
  DW_GPS_ALIGNMENT_STATUS_UNKNOWN = 0,
  DW_GPS_ALIGNMENT_STATUS_INVALID = 1,
  DW_GPS_ALIGNMENT_STATUS_COARSE = 2,
  DW_GPS_ALIGNMENT_STATUS_FINE = 3,
  DW_GPS_ALIGNMENT_STATUS_FORCE32 = 0x7fffffff
}
 High rate data output from GNSS-IMU device requires fusion of GNSS and IMU. More...
 

Functions

DW_API_PUBLIC dwStatus dwSensorGPS_readFrame (dwGPSFrame *const frame, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
 Reads the next available GPS data frame with a given timeout. More...
 
DW_API_PUBLIC dwStatus dwSensorGPS_processRawData (uint8_t const *const data, size_t const size, dwSensorHandle_t const sensor)
 Decodes RAW data previously read. More...
 
DW_API_PUBLIC dwStatus dwSensorGPS_popFrame (dwGPSFrame *const frame, dwSensorHandle_t const sensor)
 Returns any GPS frame previously processed through RAW data stream. More...
 

Typedef Documentation

◆ dwGPSAlignmentStatus

High rate data output from GNSS-IMU device requires fusion of GNSS and IMU.

The data can only be accurate if the GNSS/IMU device has gone through an internal alignment initialization, which allows the device to know the orientation of the GPS. This status indicates the quality of GPS alignment.

◆ dwGPSFixStatus

GPS satellite fix status.

◆ dwGPSFrame

typedef struct dwGPSFrame dwGPSFrame

A GPS packet containing localization information.

Flags are used to define information available in this frame.

◆ dwGPSJamState

The GPS jam state gives jamming state detected by the GNSS-receiver.

◆ dwGPSMode

typedef enum dwGPSMode dwGPSMode

The GPS mode gives the status of the GNSS data.

Note that modes 1-7 are increasing in accuracy. Modes 8 and 9 are not quite as good as 6 and 7, respectively.

◆ dwGPSSignalValidityInfo

This structure contains validity of each signal provided by GPS sensors.

Access fields in this structure with APIs provided by SignalStatus.h

◆ dwGPSSpoofState

The GPS spoof state gives spoofing-state detected by the GNSS-receiver.

◆ dwGPSTimestampFormat

Timestamp format of the GPS sensor, should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value).

◆ dwGPSTimestampQuality

GPS timestamp quality.

Enumeration Type Documentation

◆ dwGPSAlignmentStatus

High rate data output from GNSS-IMU device requires fusion of GNSS and IMU.

The data can only be accurate if the GNSS/IMU device has gone through an internal alignment initialization, which allows the device to know the orientation of the GPS. This status indicates the quality of GPS alignment.

Enumerator
DW_GPS_ALIGNMENT_STATUS_UNKNOWN 

Unknown status means the device does not or has not yet provided this information.

DW_GPS_ALIGNMENT_STATUS_INVALID 

Invalid means the GPS alignment is not yet valid, and the output data is not accurate.

DW_GPS_ALIGNMENT_STATUS_COARSE 

Coarse means the GPS is roughly aligned, so the data is useful, but not of the highest quality.

DW_GPS_ALIGNMENT_STATUS_FINE 

Fine means the GPS alignment is complete, and the device can output high quality data.

DW_GPS_ALIGNMENT_STATUS_FORCE32 

Definition at line 169 of file GPSFrame.h.

◆ dwGPSFixStatus

GPS satellite fix status.

Enumerator
DW_GPS_FIX_STATUS_NO_FIX 

No fix.

DW_GPS_FIX_STATUS_2D_FIX 

2D fix

DW_GPS_FIX_STATUS_3D_FIX 

3D fix

DW_GPS_FIX_STATUS_FORCE32 

Definition at line 134 of file GPSFrame.h.

◆ dwGPSJamState

The GPS jam state gives jamming state detected by the GNSS-receiver.

Enumerator
DW_GPS_JAM_STATE_UNSPECIFIED 

GPS jam state unspecified.

DW_GPS_JAM_STATE_OK 

GPS jam state ok.

DW_GPS_JAM_STATE_WARN 

GPS jam state warn.

DW_GPS_JAM_STATE_CRITICAL 

GPS jam state critical.

DW_GPS_JAM_STATE_INIT 

GPS jam state init.

DW_GPS_JAM_STATE_FORCE32 

Definition at line 52 of file GPSFrame.h.

◆ dwGPSMode

enum dwGPSMode

The GPS mode gives the status of the GNSS data.

Note that modes 1-7 are increasing in accuracy. Modes 8 and 9 are not quite as good as 6 and 7, respectively.

Enumerator
DW_GPS_MODE_UNKNOWN 

GPS mode unknown. The device cannot or has not reported the mode.

DW_GPS_MODE_INVALID_GPS 

GPS mode invalid. This GPS data cannot be used.

DW_GPS_MODE_DEAD_RECKONING 

GPS mode dead reckoning. Device relying on IMU alone for updates.

DW_GPS_MODE_STAND_ALONE 

GPS mode stand alone. No RTK or PPP correction.

DW_GPS_MODE_PRECISE_POINT 

GPS mode precise point. No RTK or PPP correction.

DW_GPS_MODE_CODE_DIFFERENTIAL 

GPS mode code differential. No RTK or PPP correction.

DW_GPS_MODE_RTK_FLOAT 

GPS mode RTK float.

DW_GPS_MODE_RTK_FIXED 

GPS mode RTK fixed. This is the highest accuracy mode.

DW_GPS_MODE_PPP_CONVERGING 

GPS mode PPP converging. Using PPP, but solution has not finished converging, so the data is not yet as accurate as it can be.

DW_GPS_MODE_PPP_CONVERGED 

GPS mode PPP converged. Most accurate mode for using PPP.

DW_GPS_MODE_FORCE32 

Definition at line 97 of file GPSFrame.h.

◆ dwGPSSpoofState

The GPS spoof state gives spoofing-state detected by the GNSS-receiver.

Enumerator
DW_GPS_SPOOF_STATE_UNSPECIFIED 

GPS spoof state unspecified.

DW_GPS_SPOOF_STATE_NO 

GPS spoof state no.

DW_GPS_SPOOF_STATE_YES 

GPS spoof state yes.

DW_GPS_SPOOF_STATE_MULTI 

GPS spoof state multi.

DW_GPS_SPOOF_STATE_INIT 

GPS spoof state init.

DW_GPS_SPOOF_STATE_FORCE32 

Definition at line 74 of file GPSFrame.h.

◆ dwGPSTimestampFormat

Timestamp format of the GPS sensor, should be identical to dwVioTimestampFormat(i.e. each field should have identical meaning and value).

Enumerator
DW_GPS_TIMESTAMP_FORMAT_UNSPECIFIED 

Timestamp format not specified.

DW_GPS_TIMESTAMP_FORMAT_PTP64 

64-bit PTP timestamp format. This format is assumed in case the validityInfo field does not indicate sensorTimestampFormat is valid.

DW_GPS_TIMESTAMP_FORMAT_PTP16 

16-bit fragment from PTP timer with resolution of 100us. Obtained by the following computation ((PTP_US / 100) % 1 << 16).

DW_GPS_TIMESTAMP_FORMAT_CCPLEX_TSC 

CCPLEX TSC timestamp format.

DW_GPS_TIMESTAMP_FORMAT_FORCE32 

Definition at line 33 of file GPSFrame.h.

◆ dwGPSTimestampQuality

GPS timestamp quality.

Enumerator
DW_GPS_TIMESTAMP_QUALITY_NOT_INIT 

Not Initialized. still initializing.

DW_GPS_TIMESTAMP_QUALITY_OK 

Normal Operation. Functional and Electrical Checks Passed.

DW_GPS_TIMESTAMP_QUALITY_SYNC_LOST 

Synchronization lost.

DW_GPS_TIMESTAMP_QUALITY_FORCE32 

Definition at line 150 of file GPSFrame.h.

Function Documentation

◆ dwSensorGPS_popFrame()

DW_API_PUBLIC dwStatus dwSensorGPS_popFrame ( dwGPSFrame *const  frame,
dwSensorHandle_t const  sensor 
)

Returns any GPS frame previously processed through RAW data stream.

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

@req{GID-AV_REQ-6792434}

This function returns only the first single decoded GPS frame from cached GPS frames(and removes it from cache). If no frames are available in queue, DW_NOT_AVAILABLE is returned and no GPS frame is returned.

This function should only be called after sensor is started. From above descriptions, this function requires previous callings to function dwSensorGPS_readFrame or dwSensorGPS_processRawData returns success otherwise this function will return DW_NOT_AVAILABLE.

This function is a synchronous function. Customers have to wait till the polling of GPS frame queue is finished.

Parameters
[out]framePointer to an GPS frame structure to be filled with new data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid. Only handles returned by dwSAL_createSensor with GPS sensor protocols are allowed.
DW_INVALID_ARGUMENTS - if given arguments are invalid. Here it means input pointer 'frame' is empty
DW_NOT_AVAILABLE - if no more data is available
DW_SUCCESS - An GPS frame is dequeued from internal GPS frame queue into frame
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwSensorGPS_processRawData()

DW_API_PUBLIC dwStatus dwSensorGPS_processRawData ( uint8_t const *const  data,
size_t const  size,
dwSensorHandle_t const  sensor 
)

Decodes RAW data previously read.

Any processed messages can be picked up using the dwSensorGPS_popMessage() method. This happens on the CPU thread where the function is called, incurring on additional load on that thread.

@req{GID-AV_REQ-6792439}

This API function will achieve functionality of this software unit:

  • Decode GPS sensor packets into GPS frames and cache decoded GPS frames

This API function will push specified GPS sensor packet into its internal GPS decoders. Since internal GPS decoder will return once an GPS frame is decoded, or no GPS frames could be decoded from remaining bytes from specified GPS sensor packet, thus this API function will keep driving the decoder to return as many GPS frames as possible, until decoder could return no new GPS frames. All decoded GPS frames are cached internally and could be accessed by dwSensorGPS_readFrame() or dwSensorGPS_popFrame(). Based on sensor configuration value 'output-timestamp=', decoded GPS frames would be modified in their hostTimestamp field values accordingly.

See also
https://developer.nvidia.com/docs/drive/drive-os/6.0.8.1/public/driveworks-nvsdk/nvsdk_dw_html/sensors_usecase4.html for description of available option values for 'output-timestamp=' sensor parameter.

This function should only be called after sensor is started, and with raw GPS sensor packet(s) returned from dwSensor_readRawData. After this raw sensor packet is processed by this function, user should also call dwSensor_returnRawData to return the memory block to SAL.

This function is a synchronous function. Customers have to wait till the raw GPS sensor data is processed.

Parameters
[in]dataUndecoded gps data.
[in]sizeSize in bytes of the raw data.
[in]sensorSensor handle of the sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid. Only handles returned by dwSAL_createSensor with GPS sensor protocols are allowed.
DW_INVALID_ARGUMENTS - if given arguments are invalid, Here it means input pointer 'data' is empty
DW_NOT_READY - if more data needs to be passed in (loop while it returns 'DW_NOT_READY').
DW_SUCCESS - specified raw GPS sensor packet was decoded into one or more GPS frames. Please read decoded GPS frames via dwSensorGPS_readFrame or dwSensorGPS_popFrame
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes

◆ dwSensorGPS_readFrame()

DW_API_PUBLIC dwStatus dwSensorGPS_readFrame ( dwGPSFrame *const  frame,
dwTime_t const  timeoutUs,
dwSensorHandle_t const  sensor 
)

Reads the next available GPS data frame with a given timeout.

The method blocks until either a new valid frame is received from the sensor or the given timeout exceeds. Frames read from the sensor do not have to be returned because the messages are copied.

@req{GID-AV_REQ-6792427} @req{GID-AV_REQ-6792434} @req{GID-AV_REQ-6792439} @req{GID-AV_REQ-6792440} @req{GID-AV_REQ-6829678} @req{GID-AV_REQ-6792441}

This API function will achieve two functionalities of this software unit:

  • Read a GPS sensor packet from physical GPS sensor
  • Decode this GPS sensor packet and add cache decoded GPS frames

This API function will firstly check if there are already decoded GPS frames available, if there are decoded GPS frames then this API function returns the first decoded GPS frame then return; otherwise it will read GPS sensor packet then decode it and return first decoded GPS frames, or return DW_TIME_OUT if no GPS frames could be decoded till timeout is detected.

This function is only used after the GPS sensor is initialized and started successfully.

Parameters
[out]frameA pointer to a GPS frame structure to be filled with new localization data.
[in]timeoutUsSpecify the timeout in us to wait for a new message. Special values:
  • DW_TIMEOUT_INFINITE - to wait infinitly.
  • Zero - mean polling of internal queue. - if there are already decoded GPS frames, return first frame immediately; otherwise return DW_TIME_OUT directly.
[in]sensorSpecify the sensor handle of the GPS sensor previously created with 'dwSAL_createSensor()'.
Returns
DW_INVALID_HANDLE - if given sensor handle is invalid.
DW_INVALID_ARGUMENTS - if the internal member m_decoder of GPS object is equal to nullptr.
DW_TIME_OUT - if operation has timeout.
DW_NOT_AVAILABLE - if sensor has not been started or data is not available in polling mode.
DW_END_OF_STREAM - if end of stream reached (virtual sensor only).
DW_SAL_SENSOR_ERROR - if there was an i/o or bus error.
DW_SUCCESS - if read frame successful.
API Group
  • Init: Yes
  • Runtime: Yes
  • De-Init: Yes
Note
This function will block until a frame is decoded or timeout is detected, if timeoutUs is specified as non-zero values.
If no valid GPS packets could be returned from physical GPS sensors(for Vehicle GPS sensors, this means either all received GPS packets have wrong packet size. or no GPS packets are received at all) till timeout, no GPS frames could be decoded.