Class for Lidar control and data retrieval.
It provides methods to initialize the Lidar, retrieve data, and enable positional tracking.
Supports both live sensor input and OSF file playback.
More...
Functions | |
| Lidar () | |
| Lidar constructor. More... | |
| ~Lidar () | |
| Lidar destructor. More... | |
| sl::ERROR_CODE | open (InitLidarParameters params) |
| Opens the Lidar. More... | |
| bool | isOpened () const |
| Checks if the Lidar is opened. More... | |
| InitLidarParameters | getInitParameters () const |
| Returns the initialization parameters used to open the Lidar. More... | |
| LidarInformation | getLidarInformation () const |
| Returns the Lidar information. More... | |
| CUcontext | getCUDAContext () const |
| Returns the CUDA context used by the Lidar when GPU mode is enabled. More... | |
| sl::ERROR_CODE | read () |
| Reads the next data chunk. More... | |
| sl::ERROR_CODE | grab () |
| Grabs a new frame. More... | |
| sl::ERROR_CODE | retrieveMeasure (sl::Mat &mat, sl::LIDAR_MEASURE measure, sl::Resolution res=sl::Resolution(0, 0), sl::MEM type=sl::MEM::CPU, sl::VIEW_COLOR_MAP color_map=sl::VIEW_COLOR_MAP::AUTO, cudaStream_t stream=0) |
| Retrieves a measure texture (raw float data). More... | |
| sl::ERROR_CODE | retrieveView (sl::Mat &mat, sl::LIDAR_VIEW view, sl::Resolution res=sl::Resolution(0, 0), sl::VIEW_COLOR_MAP color_map=sl::VIEW_COLOR_MAP::AUTO, cudaStream_t stream=0) |
| Retrieves a view texture (visual data). More... | |
| sl::Timestamp | getTimestamp (sl::TIME_REFERENCE reference_time) const |
| Returns the timestamp of the frame or the current time. More... | |
| float | getCurrentFPS () const |
| Returns the current framerate at which the grab() method is successfully called. More... | |
| sl::ERROR_CODE | getSensorsData (sl::SensorsData &data, sl::TIME_REFERENCE reference_time=sl::TIME_REFERENCE::CURRENT) |
| Retrieves sensors data (IMU). More... | |
| sl::ERROR_CODE | enablePositionalTracking (PositionalTrackingLidarParameters params=PositionalTrackingLidarParameters()) |
| Enables positional tracking. More... | |
| void | disablePositionalTracking () |
| Disables positional tracking. More... | |
| sl::POSITIONAL_TRACKING_STATE | getPosition (sl::Pose &pose, sl::REFERENCE_FRAME reference_frame=sl::REFERENCE_FRAME::WORLD) |
| Retrieves the current position. More... | |
| sl::ERROR_CODE | enableRecording (RecordingLidarParameters params) |
| Enables recording. More... | |
| void | disableRecording () |
| Disables recording. More... | |
| int | getSVOPosition () const |
| Gets the current SVO/OSF playback position (frame index). More... | |
| sl::ERROR_CODE | setSVOPosition (int frame_number) |
| Sets the SVO/OSF playback position (frame index). More... | |
| int | getSVONumberOfFrames () const |
| Gets the total number of frames in the SVO/OSF file. More... | |
| int | getSVOPositionAtTimestamp (sl::Timestamp timestamp) const |
| Retrieves the frame index within the SVO/OSF file corresponding to the provided timestamp. More... | |
| void | setTimestampBaseOffset (int64_t offset) |
| Sets the base timestamp offset for converting OSF sensor timestamps to Unix epoch. More... | |
| int64_t | getTimestampBaseOffset () const |
| Gets the base timestamp offset for OSF playback. More... | |
| void | pauseSVOReading (bool status) |
| Pauses or resumes SVO/OSF reading. More... | |
| void | close () |
| Closes the Lidar. More... | |
Static Functions | |
| static std::vector< LidarDeviceProperties > | getDeviceList () |
| Returns a list of available Lidar devices. More... | |
| static std::vector< LidarDeviceProperties > | getStreamingDeviceList () |
| Returns a list of streaming Lidar devices. More... | |
Class for Lidar control and data retrieval.
It provides methods to initialize the Lidar, retrieve data, and enable positional tracking.
Supports both live sensor input and OSF file playback.
|
static |
Returns a list of available Lidar devices.
|
static |
Returns a list of streaming Lidar devices.
| sl::ERROR_CODE open | ( | InitLidarParameters | params | ) |
Opens the Lidar.
| params | : The initialization parameters. |
| bool isOpened | ( | ) | const |
Checks if the Lidar is opened.
| InitLidarParameters getInitParameters | ( | ) | const |
Returns the initialization parameters used to open the Lidar.
| LidarInformation getLidarInformation | ( | ) | const |
Returns the Lidar information.
| CUcontext getCUDAContext | ( | ) | const |
Returns the CUDA context used by the Lidar when GPU mode is enabled.
This method allows you to retrieve the CUDA context created by or provided to the SDK, enabling shared GPU memory operations with other CUDA-enabled libraries.
| sl::ERROR_CODE read | ( | ) |
Reads the next data chunk.
| sl::ERROR_CODE grab | ( | ) |
Grabs a new frame.
| sl::ERROR_CODE retrieveMeasure | ( | sl::Mat & | mat, |
| sl::LIDAR_MEASURE | measure, | ||
| sl::Resolution | res = sl::Resolution(0, 0), |
||
| sl::MEM | type = sl::MEM::CPU, |
||
| sl::VIEW_COLOR_MAP | color_map = sl::VIEW_COLOR_MAP::AUTO, |
||
| cudaStream_t | stream = 0 |
||
| ) |
Retrieves a measure texture (raw float data).
| mat | : The sl::Mat to store the measure. |
| measure | : The type of measure to retrieve. |
| res | : The resolution to resize the measure (optional). |
| type | : The memory type (CPU or GPU). |
| color_map | : The colormap if applicable. |
| stream | : The CUDA stream for asynchronous operations (optional, GPU mode only). |
| sl::ERROR_CODE retrieveView | ( | sl::Mat & | mat, |
| sl::LIDAR_VIEW | view, | ||
| sl::Resolution | res = sl::Resolution(0, 0), |
||
| sl::VIEW_COLOR_MAP | color_map = sl::VIEW_COLOR_MAP::AUTO, |
||
| cudaStream_t | stream = 0 |
||
| ) |
Retrieves a view texture (visual data).
| mat | : The sl::Mat to store the view. |
| view | : The type of view to retrieve. |
| res | : The resolution to resize the view (optional). |
| color_map | : The colormap to use. |
| stream | : The CUDA stream for asynchronous operations (optional, GPU mode only). |
| sl::Timestamp getTimestamp | ( | sl::TIME_REFERENCE | reference_time | ) | const |
Returns the timestamp of the frame or the current time.
This function can also be used when playing back an OSF file.
| reference_time | : The selected TIME_REFERENCE. - TIME_REFERENCE::IMAGE : timestamp of the last grabbed frame. - TIME_REFERENCE::CURRENT : current system time. |
| float getCurrentFPS | ( | ) | const |
Returns the current framerate at which the grab() method is successfully called.
The returned value is based on the difference of timestamps between two successful grab() calls.
| sl::ERROR_CODE getSensorsData | ( | sl::SensorsData & | data, |
| sl::TIME_REFERENCE | reference_time = sl::TIME_REFERENCE::CURRENT |
||
| ) |
Retrieves sensors data (IMU).
| data | : The SensorsData object to store the data. |
| reference_time | : The reference time for the data. |
| sl::ERROR_CODE enablePositionalTracking | ( | PositionalTrackingLidarParameters | params = PositionalTrackingLidarParameters() | ) |
Enables positional tracking.
| params | : The positional tracking parameters (optional). |
| void disablePositionalTracking | ( | ) |
Disables positional tracking.
| sl::POSITIONAL_TRACKING_STATE getPosition | ( | sl::Pose & | pose, |
| sl::REFERENCE_FRAME | reference_frame = sl::REFERENCE_FRAME::WORLD |
||
| ) |
Retrieves the current position.
| pose | : The Pose object to store the position. |
| reference_frame | : The reference frame for the position. |
| sl::ERROR_CODE enableRecording | ( | RecordingLidarParameters | params | ) |
Enables recording.
| params | : The recording parameters. |
| void disableRecording | ( | ) |
Disables recording.
| int getSVOPosition | ( | ) | const |
Gets the current SVO/OSF playback position (frame index).
| sl::ERROR_CODE setSVOPosition | ( | int | frame_number | ) |
Sets the SVO/OSF playback position (frame index).
| frame_number | : The frame index to seek to. |
| int getSVONumberOfFrames | ( | ) | const |
Gets the total number of frames in the SVO/OSF file.
| int getSVOPositionAtTimestamp | ( | sl::Timestamp | timestamp | ) | const |
Retrieves the frame index within the SVO/OSF file corresponding to the provided timestamp.
| timestamp | : The timestamp to search for (in nanoseconds). |
| void setTimestampBaseOffset | ( | int64_t | offset | ) |
Sets the base timestamp offset for converting OSF sensor timestamps to Unix epoch.
OSF files store sensor-relative timestamps (nanoseconds since sensor boot). This method sets an offset that is added to OSF timestamps when returning frame timestamps via getTimestamp(IMAGE), and subtracted when seeking via getSVOPositionAtTimestamp().
This is used by Sensors::syncSVO() to align LiDAR timestamps with camera timestamps for multi-sensor synchronized playback.
| offset | : The offset in nanoseconds to add to OSF timestamps. |
| int64_t getTimestampBaseOffset | ( | ) | const |
Gets the base timestamp offset for OSF playback.
| void pauseSVOReading | ( | bool | status | ) |
Pauses or resumes SVO/OSF reading.
| status | : If true, the reading is paused. If false, the reading is resumed. |
| void close | ( | ) |
Closes the Lidar.