-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is an error when generating point clouds with "rs2::pointcloud::calculate()". #10672
Comments
Hi @Shannon-Law Does you RealSense camera model have an RGB sensor? If it does, do you experience similar problems with the rs-pcl-color example? |
@MartyG-RealSense Yes, I have tried. And the same error like it above, exists. |
Can you confirm please that you installed the RealSense PCL wrapper using the installation instructions at the link below, please? https://github.com/IntelRealSense/librealsense/tree/master/wrappers/pcl |
@MartyG-RealSense Yes, I confirmed. However, the source of the problem resides in the fact that the outputs of the function "rs2::pointcloud::calculate()", namely, the values of "points = pc.calculate(depth)", are zeros. It has nothing to do with PCL. The codes below from rs2::pointcloud pc; |
Your simple code listing above looks okay. Do you receive any depth values with the script below?
If your depth values are still zeroes, would it be possible to provide an RGB image of the scene that the camera is observing to see whether there are aspects of the scene that may make it difficult for the camera to analyze it for depth information, please? |
In different scenes, the depth values are normal, but all the coordinates of the generated point clouds are zeros. |
I researched this problem extensively but was unable to find a potential cause for your particular problem, unfortunately. Are you able to generate a pointcloud in the 3D mode of the RealSense Viewer tool (realsense-viewer) please? You can generate a depth-only pointcloud by enabling the depth stream in the Viewer and going to 3D mode using the '3D' option in the top corner of the Viewer window, or a color-textured pointcloud by first enabling depth and then enabling RGB secondly. |
@MartyG-RealSense @RealSenseCustomerSupport |
The RealSense Viewer applies a range of post-processing and depth colorization presets by default, so a depth image in the Viewer may not resemble one generated by a self-created script, as the preset settings applied by default in the Viewer have to be deliberately programmed into a script manually to replicate the appearance of a Viewer image. Can you describe how the point cloud provided by rs2::pointcloud::calculate() looks abnormal please? Thanks! |
In the codes below, the outputs of the function "rs2::pointcloud::calculate()", namely, the values of "points = pc.calculate(depth)", are zeros. But, in RealSense Viewer, the depth maps and the point clouds are normal. The codes below from rs2::pointcloud pc; |
If the librealsense SDK was built with example programs included, could you check at the folder location usr/local/bin whether there is a pre-built version of the rs-pointcloud example that can be launched to see whether this pre-built version of rs-pontcloud.cpp has the same problem with zeroes? |
At the folder location usr/local/bin of my Jetson system, there is not any pre-built version of the rs-pointcloud example. |
Okay, thank you. If the SDK is built from source code with CMake then including the build flag DBUILD_GRAPHICAL_EXAMPLES=true in the CMake build instruction should include executable versions of the SDK's set of graphics-using example programs and tools in the build. The problem that you are experiencing sounds similar to the one in #5728 |
Yes, this error is similar to the one in #5728. And I install the SDK through the way described in https://github.com/IntelRealSense/librealsense/blob/c94410a420b74e5fb6a414bd12215c05ddd82b69/doc/installation_jetson.md, instead of using source codes with CMake. @MartyG-RealSense Thanks for your patience and reply! |
You are very welcome! In #5728 the problem was occurring for that user only when they ran the code on a virtual machine (VM). If they ran the code directly on a Jetson Nano instead of using a VM then it worked correctly. Are you using a VM, please? |
No, I'm not using a virtual machine. Instead, I run the codes above directly on a Jetson TX2 and a Jetson AGX Xavier. |
Here's another C++ example to try:
|
Thank you so much! I tested the codes above and printed the coordinates on my Jetson AGX Xavier. Same as before, all the values of "vertices" and "tex_coords" are zeros. |
If pc.calculate is not working at all, let's next try getting the coordinates printed with rs2_deproject_pixel_to_point to confirm whether the problem is with pc.calculate in particular or all point cloud scripts.
|
@MartyG-RealSense Compared to the function rs2::pointcloud::calculate(), the running speed of it is much faster than rs2_deproject_pixel_to_point(). What's more, the accuracy of point clouds generated by rs2_deproject_pixel_to_point() are lower than that of rs2::pointcloud::calculate(). Last but not least, thank you for the codes! |
You are very welcome :) RealSense team members discuss at #4315 how obtaining coordinates with rs2_deproject_pixel_to_point can be less accurate compared to doing so with points.get_vertices due to the alignment process. Advice for improving results is given at #4315 (comment) |
@MartyG-RealSense |
Hi @Shannon-Law Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
@MartyG-RealSense Okay. I'm sorry for replying you late! |
When I use the codes from https://github.com/IntelRealSense/librealsense/blob/master/wrappers/pcl/pcl/rs-pcl.cpp, and compile them in a Jetson board, to generate point clouds, all the point coordinates of "points = pc.calculate(depth);" are zeros, while the depth maps are normal. What's more, the camera I use is RealSense D435, and the SDK version is 2.50.0. Why is that and how to solve it?
The text was updated successfully, but these errors were encountered: