![]() |
DriveWorks SDK Reference| 0.6.67 Release |
Defines the Lidar sensor methods.
Data Structures | |
struct | dwLidarDecodedPacket |
struct | dwLidarPointRTheta |
struct | dwLidarPointXYZI |
Holds a Lidar point cloud XYZ and the associated intensity. More... | |
struct | dwLidarProperties |
Enumerations | |
enum | dwLidarDecodeFormat { DW_LIDAR_DECODE_FORMAT_XYZI = 0, DW_LIDAR_DECODE_FORMAT_RTHI = 1 } |
struct dwLidarDecodedPacket |
Data Fields | ||
---|---|---|
uint64_t | duration |
Time difference between the first measurement and the last. |
uint64_t | hostTimestamp |
Timestamp measured on the host. |
uint32_t | maxPoints |
Maximum number of points in the packet. |
uint32_t | nPoints |
Current number of valid points in the packet. |
const void * | points |
Pointer to the array of points. To be casted to one of the point structures |
uint64_t | sensorTimestamp |
Timestamp of the first point in the point cloud packet. |
uint32_t | stride |
Number of |
struct dwLidarPointRTheta |
struct dwLidarPointXYZI |
struct dwLidarProperties |
Data Fields | ||
---|---|---|
char | deviceString[256] |
ASCII string identifying the device. |
uint32_t | packetsPerSecond |
Number of packets per second the sensor produces. |
uint32_t | packetsPerSpin |
Number of packets per sensor full spin. |
uint32_t | pointsPerPacket |
Maximum number of points in a packet. |
uint32_t | pointsPerSecond |
Number of points per second the sensor provides. |
uint32_t | pointsPerSpin |
Maximum number of points on a full sensor spin. |
uint32_t | pointStride |
Number of |
float32_t | spinFrequency |
Current spin frequency. |
enum dwLidarDecodeFormat |
DW_API_PUBLIC dwStatus dwSensorLidar_disableDecoding | ( | dwSensorHandle_t | sensor | ) |
Disable the decoding of the Lidar packets, which frees additional CPU load.
Method fails if the sensor has been started and is capturing data. Stop the sensor first. The default state is to have decoding on. If on, dwSensor_readRawData returns DW_CALL_NOT_ALLOWED.
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_enableDecoding | ( | dwSensorHandle_t | sensor | ) |
Enables the decoding of the Lidar packets, which incurs an additional CPU load.
Method fails if the sensor has been started and is capturing data. Stop the sensor first. The default state is to have decoding on. If on, dwSensor_readRawData returns DW_CALL_NOT_ALLOWED.
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_getDecodingFormat | ( | dwLidarDecodeFormat * | format, |
dwSensorHandle_t | sensor | ||
) |
Gets the selected decoding format of the point cloud.
The default decoding format is DW_LIDAR_DECODE_FORMAT_XYZI.
[in] | format | A pointer to retrieve the specified packet decoding format. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_getProperties | ( | dwLidarProperties * | lidarProperties, |
dwSensorHandle_t | sensor | ||
) |
Gets information about the Lidar sensor.
[out] | lidarProperties | A pointer to the struct containing the properties of the Lidar. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_isDecodingEnabled | ( | dwBool * | enable, |
dwSensorHandle_t | sensor | ||
) |
Retrieves the state of packet decoding.
[out] | enable | Contains the result of the query, which is true when decoding. False if RAW data. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_processRawData | ( | const dwLidarDecodedPacket ** | data, |
const uint8_t * | rawData, | ||
size_t | size, | ||
dwSensorHandle_t | sensor | ||
) |
Decodes RAW data previously read and returns a pointer to it.
This happens on the CPU thread where the function is called, incurring on additional load on that thread. The data is valid until the application calls dwSensor_returnRawData.
[out] | data | A pointer to the memory pool owned by the sensor. |
[in] | rawData | A pointer for the non-decoded Lidar packet, returned by dwSensor_readRawData() . |
[in] | size | Specifies the size in bytes of the raw data. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_readPacket | ( | const dwLidarDecodedPacket ** | data, |
dwTime_t | timeout_us, | ||
dwSensorHandle_t | sensor | ||
) |
Reads one scan packet.
The pointer returned is to the internal data pool. DW guarantees that the data remains constant until returned by the application. The data must be explicitly returned by the application.
[out] | data | A pointer to a pointer that can data read from the sensor. The struct contains the numbers of points read, which depends on the sensor used. |
[in] | timeout_us | Specifies the timeout in microseconds. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_returnPacket | ( | const dwLidarDecodedPacket * | scan, |
dwSensorHandle_t | sensor | ||
) |
Returns the data read to the internal pool.
At this point the pointer is still be valid, but data is change based on newer readings of the sensor.
[in] | scan | A pointer to the scan data previously read from the Lidar to be returned to the pool. |
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
DW_API_PUBLIC dwStatus dwSensorLidar_setDecodingFormat | ( | dwLidarDecodeFormat | format, |
dwSensorHandle_t | sensor | ||
) |
Sets decoding format of the point cloud.
Method fails if the sensor has been started and is capturing data. Stop the sensor first. The default decoding format is DW_LIDAR_DECODE_FORMAT_XYZI.
[in] | sensor | Specifies the sensor handle of the sensor previously created with dwSAL_createSensor() . |
[in] | format | Specifies the format for decoding the packets. |