DriveWorks SDK Reference
5.20.37 Release
For Test and Development only

Sensors.h
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
54#ifndef DW_SENSORS_COMMON_SENSORS_H_
55#define DW_SENSORS_COMMON_SENSORS_H_
56
61
62#include "SensorTypes.h"
63#include "SensorStats.h"
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
82
94
108
127
144
158
171
184dwStatus dwSAL_getPlatformInfo(char8_t const** const osName, dwPlatformOS const os, dwSALHandle_t const sal);
185
201dwStatus dwSAL_getNumSensors(uint32_t* const num, dwPlatformOS const os, dwSALHandle_t const sal);
202
216dwStatus dwSAL_getSensorProtocol(const char** const name, uint32_t const idx, dwPlatformOS const os, dwSALHandle_t const sal);
217
232dwStatus dwSAL_getSensorParameterString(const char** const parameters, uint32_t const idx,
233 dwPlatformOS const os, dwSALHandle_t const sal);
234
248
262
284
297
310
333dwStatus dwSensor_readRawData(const uint8_t** const data, size_t* const size,
334 dwTime_t const timeoutUs,
335 dwSensorHandle_t const sensor);
336
351dwStatus dwSensor_returnRawData(const uint8_t* const data, dwSensorHandle_t const sensor);
352
369dwStatus dwSensor_getSeekRange(size_t* const eventCount,
370 dwTime_t* const startTimestampUs, dwTime_t* const endTimestampUs,
371 dwSensorHandle_t const sensor);
372
388
401dwStatus dwSensor_getHeader(uint8_t const** const buffer, size_t* bufferSize, dwSensorHandle_t const sensor);
402
419dwStatus dwSensor_seekToTime(dwTime_t const timestampUs, dwSensorHandle_t const sensor);
420
436dwStatus dwSensor_seekToEvent(size_t const event, dwSensorHandle_t const sensor);
437
456
470
485dwStatus dwSensor_getSeekTableEntries(dwSensorSeekTableEntry* const entries, size_t const numEntries, dwSensorHandle_t const sensor);
486
510dwStatus dwSensor_saveSeekTable(const char* const fileName, dwSensorHandle_t const sensor);
511
532dwStatus dwSensor_setThreadPriority(int32_t const priority, dwSensorHandle_t const sensor);
533
554dwStatus dwSensor_setThreadAffinity(uint32_t const affinityMask, dwSensorHandle_t const sensor);
555
569
570#ifdef __cplusplus
571}
572#endif
573
575#endif // DW_SENSORS_COMMON_SENSORS_H_
NVIDIA DriveWorks API: Core Methods
dwStatus
Status definition.
Definition: ErrorDefs.h:44
NVIDIA DriveWorks API: Health Signal Methods
NVIDIA DriveWorks API: SensorTypes
Egomotion State inputs.
DriveWorks API: Signal Status Library
NVIDIA DriveWorks API: Core Exports
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:65
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:85
#define DW_API_PUBLIC
Definition: Exports.h:56
DW_API_PUBLIC dwStatus dwSensor_getNumSeekTableEntries(size_t *const size, dwSensorHandle_t const hsensor)
Get the number of entries in the seek Table.
DW_API_PUBLIC dwStatus dwSensor_createSeekTable(dwSensorHandle_t const sensor)
Forces recreation of the seek table, for sensors that support seeking.
DW_API_PUBLIC dwStatus dwSensor_getStats(dwSensorStats *const stats, dwSensorHandle_t const sensor)
Gets sensor statistics (if available).
DW_API_PUBLIC dwStatus dwSensor_reset(dwSensorHandle_t const sensor)
Resets the sensor.
DW_API_PUBLIC dwStatus dwSAL_getPlatform(dwPlatformOS *const os, dwSALHandle_t sal)
Gets current platform the SDK is running on.
DW_API_PUBLIC dwStatus dwSensor_setThreadPriority(int32_t const priority, dwSensorHandle_t const sensor)
Sets the priority of the internal thread, for sensors that use an internal thread to communicate to t...
DW_API_PUBLIC dwStatus dwSensor_saveSeekTable(const char *const fileName, dwSensorHandle_t const sensor)
Saves the seek table for the sensor to a file, for sensors that support seek tables.
DW_API_PUBLIC dwStatus dwSAL_setVehicleState(dwSensorVehicleState *const vehicleState, dwSALHandle_t const sal)
Pass vehicle state to all sensors.
dwStatus dwSensor_getHeader(uint8_t const **const buffer, size_t *bufferSize, dwSensorHandle_t const sensor)
Returns a pointer to the shared buffer with the contents of the sensor header and bufferSize will con...
DW_API_PUBLIC dwStatus dwSAL_createSensor(dwSensorHandle_t *const sensor, dwSensorParams const params, dwSALHandle_t const sal)
Creates a new sensor managed by the SAL module with the given parameters.
DW_API_PUBLIC dwStatus dwSensor_start(dwSensorHandle_t const sensor)
Starts the sensor previously successfully created with 'dwSAL_createSensor()'.
DW_API_PUBLIC dwStatus dwSAL_start(dwSALHandle_t const sal)
Bootstraps all sensors managed by the SAL module.
struct dwSALObject * dwSALHandle_t
Handle representing the Sensor Abstraction Layer interface.
Definition: SensorTypes.h:72
DW_API_PUBLIC dwStatus dwSensor_getSeekRange(size_t *const eventCount, dwTime_t *const startTimestampUs, dwTime_t *const endTimestampUs, dwSensorHandle_t const sensor)
Retrieves the valid range of seek parameters, for sensors that support seeking.
DW_API_PUBLIC dwStatus dwSAL_release(dwSALHandle_t const sal)
Releases the SAL (sensor abstraction layer) module.
DW_API_PUBLIC dwStatus dwSensor_seekToEvent(size_t const event, dwSensorHandle_t const sensor)
Seeks the sensor to an event, for sensors that support seeking.
DW_API_PUBLIC dwStatus dwSAL_getNumSensors(uint32_t *const num, dwPlatformOS const os, dwSALHandle_t const sal)
Gets number of available sensors for a platform.
DW_API_PUBLIC dwStatus dwSensor_stop(dwSensorHandle_t const sensor)
Stops the sensor.
DW_API_PUBLIC dwStatus dwSAL_initialize(dwSALHandle_t *const sal, dwContextHandle_t const context)
Creates and initializes a SAL (sensor abstraction layer) module.
DW_API_PUBLIC dwStatus dwSensor_readRawData(const uint8_t **const data, size_t *const size, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
Reads RAW data from sensor as byte array at a given time (TimeoutUs).
DW_API_PUBLIC dwStatus dwSensor_returnRawData(const uint8_t *const data, dwSensorHandle_t const sensor)
Returns RAW data to sensor as a byte array.
DW_API_PUBLIC dwStatus dwSAL_getPlatformInfo(char8_t const **const osName, dwPlatformOS const os, dwSALHandle_t const sal)
Gets detailed information about the running hardware platform and operating system.
DW_API_PUBLIC dwStatus dwSAL_getSensorProtocol(const char **const name, uint32_t const idx, dwPlatformOS const os, dwSALHandle_t const sal)
Gets protocol name of a sensor for a given index, e.g., 'camera.gmsl' or 'can.file'.
DW_API_PUBLIC dwStatus dwSAL_releaseSensor(dwSensorHandle_t const sensor)
Releases a sensor managed by the SAL module.
dwPlatformOS
Defines the operating system in use.
Definition: SensorTypes.h:57
DW_API_PUBLIC dwStatus dwSensor_setThreadAffinity(uint32_t const affinityMask, dwSensorHandle_t const sensor)
Sets the affinity of the internal thread, for sensors that use an internal thread to communicate to t...
DW_API_PUBLIC dwStatus dwSAL_setEgomotionState(dwSensorEgomotionState *const egomotionState, dwSALHandle_t const sal)
Pass egomotion state to all sensors.
DW_API_PUBLIC dwStatus dwSAL_getSensorParameterString(const char **const parameters, uint32_t const idx, dwPlatformOS const os, dwSALHandle_t const sal)
Gets the parameter string acceptable by a sensor whose type is determined by the index.
DW_API_PUBLIC dwStatus dwSensor_getSeekTableEntries(dwSensorSeekTableEntry *const entries, size_t const numEntries, dwSensorHandle_t const sensor)
Fill in the pre-allocated dwSensorSeekTableEntry array.
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: SensorTypes.h:75
DW_API_PUBLIC dwStatus dwSensor_getCurrentSeekPosition(size_t *const event, dwSensorHandle_t const sensor)
Gets the current seek position of the sensor.
DW_API_PUBLIC dwStatus dwSensor_seekToTime(dwTime_t const timestampUs, dwSensorHandle_t const sensor)
Seeks the sensor to a specific timestamp, for sensors that support seeking.
DW_API_PUBLIC dwStatus dwSAL_reset(dwSALHandle_t const sal)
Resets the SAL (sensor abstraction layer) module.
Holds sets of parameters for sensor creation.
Definition: SensorTypes.h:84
A seek structure is made of memory offset, eventcount and timestamp.
Definition: SensorTypes.h:132