-
Notifications
You must be signed in to change notification settings - Fork 406
Point cloud integration #19
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
Conversation
|
I was thinking about using CUDA to remap Depth Mat to pointcloud. Furthermore Depth and RGB information are available in GPU memory, so you have not bottleneck... |
Point cloud integration and refactoring
|
Could you not have squashed these commits a little? |
| SET(OPENCV_DIR $ENV{OPENCV_DIR}) | ||
| ELSE() # Linux | ||
| find_package(ZED 0.9 REQUIRED) | ||
| ENDIF(WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change remove windows support?
| for (int i = 0; i < size; i++) { | ||
| if(p_cloud[index4+2] < 0) { // Check if it's an unvalid point, the depth is lower than 0 | ||
| index4 += 4; | ||
| continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continue is not ok here - you've now left one of the entries in point_cloud.points with unitialized memory, which is impossible for anything downsteam to detect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what we can think, but when you read the std::vector::resize documentation, you see that if no default object is given to the resize as second arg, the default constructor is use the create the new objects. So the continue is possible because all the points in the cloud are initialized by the resize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably the default constructor for this type is zero-filled? Isn't NaN more desirable for a missing data point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a logic that should be handled by the PointCloud object itself and it will be a bad idea to try to overwrite it. You can see in rviz that the "missing" points aren't displayed, so the information is already in the message.
|
Ok, there's definitely a bug here due to the multithreading. This worked just fine with the I think the issue is a concurrent interaction like this: |
Now the wrapper is able to provide the 3D point cloud, the depth map and the camera images at the same time. There is only one zed.launch now, the wrapper automatically adapts on subscribers change.