Items with no label
3335 Discussions

What exactly is the Low Level API in librealsense?

smcdo5
Beginner
1,865 Views

I'm just getting started here and wanted to assess my options. I'm not using the SDK, I'm using librealsense (linux). I've got everything setup fine, but in going through the documentation I found this article:

https://github.com/IntelRealSense/librealsense/blob/master/doc/api_arch.md librealsense/api_arch.md at master · IntelRealSense/librealsense · GitHub

My understanding of that is rs2::pipeline is always the high level API. What classes are involved in the low-level API?

None of the examples use the low level API, and I'm not asking for a full-blown example. Being new to the API in general, I'm just wondering what classes are involved in wielding the low level API

Thanks for any suggestions!

0 Kudos
3 Replies
MartyG
Honored Contributor III
668 Views

About 30 years ago, low level development was known by some as 'hitting the metal' because of accessing hardware components directly with very hard to understand programming such as binary numbers, instead of writing scripts with English-like instructions (which is called high level programming).

Back then, the major benefit of low level development was the speed that code ran at compared to English-instruction languages that acted as an intermediary between the user and the hardware that had the side effect of slowing down the processing of tasks.

These days though with super fast hardware, there is little advantage in hitting the metal for most types of applications. A high level interface is likely to meet your needs.

The main benefit of low level would likely be if you wanted to communicate with external sensors that may not have connection instructions for them defined in the high level Librealsense API.

smcdo5
Beginner
668 Views

Hehehe. So I guess we'll call that the ultra low level interface. I'm definitely not game for that, I care not to learn how to process USB packets / send data back and forth.

I think in this case the "medium" level interface (stated as low level on the original linked document) is literally just using the device class directly:

https://github.com/IntelRealSense/librealsense/blob/master/src/device.h librealsense/device.h at master · IntelRealSense/librealsense · GitHub

From the document

The user of the device interface provides a callback to be invoked whenever new data frames become available. This callback runs immediately on the OS thread providing the best possible latency. The callback provides a frame with the relevant data type according to the stream, which produced the data. Data frames can be extended to offer the additional functionality relevant to their stream type. For example, video stream frame data includes image resolution and information how to parse the image raw buffer.

bold is my emphasis. I was totally misreading that!

Thanks for the response, though Marty. Makes me really appreciate my compiler!

0 Kudos
MartyG
Honored Contributor III
668 Views

You're very welcome.

Yes, high level languages have come a long way in the last few decades, to the point where using a high level API is just as efficient as working in assembly language or machine code at low level like our early Eighties pioneer ancestors.

0 Kudos
Reply