How to use a D405 with Point Cloud Library / PCL
Hello,
I would like to use my D405 with this PCL tutorial project:
https://pcl.readthedocs.io/projects/tutorials/en/master/tracking.html
What would be the best way to go about this? Preferably I would use my macOS machines, either Apple Silicon or x64. I have been looking into building an OpenNI driver for Realsense, but run into errors while compiling... also I have some difficulty understanding the instructions here:
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/openni2
For instance, I'm not sure what is meant by "Run CMake on driver" exactly.
Thank you for any pointers!
-
Hi Stevenkruyswijk If your Mac is using MacOS Monterey then there are a couple of methods that you could use to install the librealsense SDK on your Mac. Both methods work for x64 and Apple Silicon Macs.
1. Use the guide at the link below..
https://lightbuzz.com/realsense-macos/
2. Or install with brew using brew install librealsense
https://formulae.brew.sh/formula/librealsense
If your Macs have the current latest MacOS, Ventura, then I would advise against attempting installation of librealsense on Ventura at the time of writing this as it currently has issues with detecting RealSense cameras.
In regard to the RealSense PCL and OpenNI2 compatibility wrappers, they are intended for use with Windows or Linux rather than MacOS. So another OS would likely have to be run on the Mac in order to use those wrappers.
PCL wrapper
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl
OpenNI2 wrapper
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/openni2
I believe that "Run CMake on driver" in the OpenNI2 instructions is stating that the OpenNI2 driver's source code on its GitHub should be built using the CMake source code compilation tool.
Alternatively, if the librealsense SDK is built from source code with CMake then you could include the flag -DBUILD_OPENNI2_BINDINGS in the CMake build instruction to build the OPenNI2 wrapper at the same time that librealsense is built.
-
Thanks MartyG - that lightbuzz tutorial looks very interesting.
My Macs run Monterey fortunately. But I guess there's no straightforward way to use my D405 in PCL by just installing (or building and installing) librealsense, right? Or is there an example somewhere of how to do this without the PCL wrapper?
Otherwise, it seems like my best option for now is to reboot my x64 Mac into Windows and see if I can get something to work there. -
If you want to generate a point cloud then you do not require PCL to do this as the librealsense SDK has built-in support for point clouds using the SDK's programming language. C++, Python and C# are supported.
Examples for each language are provided below. C++ will likely be the best option for developing a point cloud application on Mac as the SDK supports C++ built-in by default and does not require the installation of a wrapper.
C++
https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud
Python
C#
If you choose to use Windows on your Mac then setup is likely to be significantly easier. You can download and run the Intel.RealSense.SDK-WIN10 installer program from the 'Assets' list of the SDK's release page at the link below.
https://github.com/IntelRealSense/librealsense/releases/tag/v2.54.1

The installer also installs pre-built executable versions of example programs on the computer, including the rs-pointcloud example.
The installer places a shortcut launch icon for the RealSense Viewer tool on the Windows desktop, and this tool has an easy built-in point cloud generation mode.
-
Thanks, but like I mentioned in the beginning: I'd like to be able to test a specific PCL tutorial project; it deals with real-time object tracking using a particle filter. For this I need a point cloud stream, which is why I got the D405.
https://pcl.readthedocs.io/projects/tutorials/en/master/tracking.html
If you know of any similar tutorial/sample projects within the Realsense framework, I'd be happy to learn about them. -
The SDK has two official PCL example programs, pcl (a minimal point cloud) and pcl-color (a pointcloud that uses RGB texturing).
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl/pcl
https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl/pcl-color
-
I had seen those, thanks... still: they don't help me towards getting a point cloud stream into PCL; that's what I need OpenNI for.
If you know a typical Realsense example that deals with point cloud streams (with or without particle filter object tracking), I'd be keen to investigate. -
There is limited information available about using OpenNI2 with RealSense, though the OpenNI2 / PCL point cloud 'grabber' discussion at the link below may be helpful.
https://github.com/IntelRealSense/librealsense/issues/2839#issuecomment-448161616
-
Most of the options for RealSense point cloud streaming without PCL - such as C++ - are mentioned in the comments above.
The RealSense SDK supports the applying of post-processing filters to alter the depth data that is used in a point cloud. These filters can be configured in C++, Python or C# scripting.
Please sign in to leave a comment.
Comments
9 comments