NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
Sensors.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2016-2026 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 
37 #ifndef DW_SENSORS_COMMON_SENSORS_H_
38 #define DW_SENSORS_COMMON_SENSORS_H_
39 
40 #include <dw/core/base/Exports.h>
44 
45 #include "SensorTypes.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
70 dwStatus dwSAL_initialize(dwSALHandle_t* const sal, dwContextHandle_t const context);
71 
87 dwStatus dwSAL_getContext(dwContextHandle_t* const context, dwSALHandle_t const sal);
88 
106 
125 
151 
174 
194 
214 dwStatus dwSAL_getNumSensors(uint32_t* const num, dwSALHandle_t const sal);
215 
234 dwStatus dwSAL_getSensorProtocol(const char** const name, uint32_t const idx, dwSALHandle_t const sal);
235 
255 dwStatus dwSAL_getSensorParameterString(const char** const parameters, uint32_t const idx,
256  dwSALHandle_t const sal);
257 
276 dwStatus dwSAL_setVehicleState(dwSensorVehicleState* const vehicleState, dwSALHandle_t const sal);
277 
294 dwStatus dwSAL_setEgomotionState(dwSensorEgomotionState* const egomotionState, dwSALHandle_t const sal);
295 
326 
345 
369 
388 
417 dwStatus dwSensor_readRawData(const uint8_t** const data, size_t* const size,
418  dwTime_t const timeoutUs,
419  dwSensorHandle_t const sensor);
420 
441 dwStatus dwSensor_returnRawData(const uint8_t* const data, dwSensorHandle_t const sensor);
442 
466 dwStatus dwSensor_getSeekRange(size_t* const eventCount,
467  dwTime_t* const startTimestampUs, dwTime_t* const endTimestampUs,
468  dwSensorHandle_t const sensor);
469 
491 
510 dwStatus dwSensor_getHeader(uint8_t const** const buffer, size_t* bufferSize, dwSensorHandle_t const sensor);
511 
535 
557 dwStatus dwSensor_seekToEvent(size_t const event, dwSensorHandle_t const sensor);
558 
583 
602 dwStatus dwSensor_getNumSeekTableEntries(size_t* const size, dwSensorHandle_t const hsensor);
603 
624 dwStatus dwSensor_getSeekTableEntries(dwSensorSeekTableEntry* const entries, size_t const numEntries, dwSensorHandle_t const sensor);
625 
655 dwStatus dwSensor_saveSeekTable(const char* const fileName, dwSensorHandle_t const sensor);
656 
683 dwStatus dwSensor_setThreadPriority(int32_t const priority, dwSensorHandle_t const sensor);
684 
711 dwStatus dwSensor_setThreadAffinity(uint32_t const affinityMask, dwSensorHandle_t const sensor);
712 
732 
733 #ifdef __cplusplus
734 }
735 #endif
736 
738 #endif // DW_SENSORS_COMMON_SENSORS_H_
dwSAL_getNumSensors
DW_API_PUBLIC dwStatus dwSAL_getNumSensors(uint32_t *const num, dwSALHandle_t const sal)
Gets number of available sensors for current platform.
dwSensor_returnRawData
DW_API_PUBLIC dwStatus dwSensor_returnRawData(const uint8_t *const data, dwSensorHandle_t const sensor)
Returns RAW data to sensor as a byte array.
dwSAL_setEgomotionState
DW_API_PUBLIC dwStatus dwSAL_setEgomotionState(dwSensorEgomotionState *const egomotionState, dwSALHandle_t const sal)
Pass egomotion state to all sensors.
dwSensorHandle_t
struct dwSensorObject * dwSensorHandle_t
Handle representing a sensor.
Definition: SensorTypes.h:44
dwSensor_getHeader
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...
dwSAL_start
DW_API_PUBLIC dwStatus dwSAL_start(dwSALHandle_t const sal)
Bootstraps all sensors managed by the SAL module.
dwSensorParams
Holds sets of parameters for sensor creation.
Definition: SensorTypes.h:56
dwSensor_getSeekRange
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.
sensor
const dwSensorHandle_t sensor
Definition: Camera.h:848
dwSensor_saveSeekTable
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.
SignalStatus.h
dwSAL_getSensorParameterString
DW_API_PUBLIC dwStatus dwSAL_getSensorParameterString(const char **const parameters, uint32_t const idx, dwSALHandle_t const sal)
Gets the parameter string acceptable by a sensor whose type is determined by the index.
dwSensorStats
Hold the sensor ID and it's statistics.
Definition: SensorStats.h:60
dwSAL_initialize
DW_API_PUBLIC dwStatus dwSAL_initialize(dwSALHandle_t *const sal, dwContextHandle_t const context)
Creates and initializes a SAL (sensor abstraction layer) module.
dwSAL_reset
DW_API_PUBLIC dwStatus dwSAL_reset(dwSALHandle_t const sal)
Resets the SAL (sensor abstraction layer) module.
dwSensor_getNumSeekTableEntries
DW_API_PUBLIC dwStatus dwSensor_getNumSeekTableEntries(size_t *const size, dwSensorHandle_t const hsensor)
Get the number of entries in the seek Table.
dwSensor_getCurrentSeekPosition
DW_API_PUBLIC dwStatus dwSensor_getCurrentSeekPosition(size_t *const event, dwSensorHandle_t const sensor)
Gets the current seek position of the sensor.
Exports.h
dwSAL_getSensorProtocol
DW_API_PUBLIC dwStatus dwSAL_getSensorProtocol(const char **const name, uint32_t const idx, dwSALHandle_t const sal)
Gets protocol name of a sensor for a given index, e.g., 'camera.gmsl' or 'can.file'.
dwSAL_setVehicleState
DW_API_PUBLIC dwStatus dwSAL_setVehicleState(dwSensorVehicleState *const vehicleState, dwSALHandle_t const sal)
Pass vehicle state to all sensors.
dwSensor_getSeekTableEntries
DW_API_PUBLIC dwStatus dwSensor_getSeekTableEntries(dwSensorSeekTableEntry *const entries, size_t const numEntries, dwSensorHandle_t const sensor)
Fill in the pre-allocated dwSensorSeekTableEntry array.
dwTime_t
int64_t dwTime_t
Definition: core/base/BasicTypes.h:65
dwSAL_getContext
DW_API_PUBLIC dwStatus dwSAL_getContext(dwContextHandle_t *const context, dwSALHandle_t const sal)
Obtains the handle, used for creation of SAL module.
dwSensor_seekToTime
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.
dwSAL_createSensor
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.
HealthSignals.h
dwSAL_releaseSensor
DW_API_PUBLIC dwStatus dwSAL_releaseSensor(dwSensorHandle_t const sensor)
Releases a sensor managed by the SAL module.
SensorsVehicleStateTypes.h
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:32
dwSensor_seekToEvent
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.
dwSensor_getStats
DW_API_PUBLIC dwStatus dwSensor_getStats(dwSensorStats *const stats, dwSensorHandle_t const sensor)
Gets sensor statistics (if available).
dwSensor_createSeekTable
DW_API_PUBLIC dwStatus dwSensor_createSeekTable(dwSensorHandle_t const sensor)
Forces recreation of the seek table, for sensors that support seeking.
dwSensor_resume
DW_API_PUBLIC dwStatus dwSensor_resume(dwSensorHandle_t const sensor)
Resume and init the sensor.
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:81
dwSALHandle_t
struct dwSALObject * dwSALHandle_t
Handle representing the Sensor Abstraction Layer interface.
Definition: SensorTypes.h:40
dwSensorSeekTableEntry
A seek structure is made of memory offset, eventcount and timestamp.
Definition: SensorTypes.h:111
dwSensor_reset
DW_API_PUBLIC dwStatus dwSensor_reset(dwSensorHandle_t const sensor)
Resets the sensor.
SensorStats.h
SensorTypes.h
dwSensor_setThreadPriority
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...
dwSensorVehicleState
Vehicle State inputs.
Definition: SensorsVehicleStateTypes.h:173
dwSensor_start
DW_API_PUBLIC dwStatus dwSensor_start(dwSensorHandle_t const sensor)
Starts the sensor previously successfully created with 'dwSAL_createSensor()'.
dwSensorEgomotionState
Egomotion State inputs.
Definition: SensorsVehicleStateTypes.h:268
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: core/base/Exports.h:57
dwSensor_readRawData
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).
dwSensor_stop
DW_API_PUBLIC dwStatus dwSensor_stop(dwSensorHandle_t const sensor)
Stops the sensor.
dwSAL_release
DW_API_PUBLIC dwStatus dwSAL_release(dwSALHandle_t const sal)
Releases the SAL (sensor abstraction layer) module.
Context.h
dwSensor_setThreadAffinity
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...