-
Notifications
You must be signed in to change notification settings - Fork 6
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
[RSDK-7954] Add PCD support and organize encoding helpers #41
Conversation
Since we put PCD processing in the |
return response; | ||
} | ||
|
||
std::vector<unsigned char> rsPointsToPCDBytes(const rs2::points& points, const rs2::frame& colorFrame) { |
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.
[q] Do you have any resources/examples or more info on how the pcd transformation is done here?
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.
I followed this resource https://pointclouds.org/documentation/tutorials/pcd_file_format.html
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.
LGTM.
Seems great to have pointclouds native to the module now!
- Makes sense that the
get_point_cloud
calls would not affect the performance of background image loop thread.- Looks like cpp sdk grpc stuff uses CompletionQueue async interface (ref), so long response times here should not affect anything on the main thread either.
- Any info you have to help me grok
rsPointsToPCDBytes
helper addition would be awesome (Not up to speed yet with librealsense/pc formatting).
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.
Thanks for the addition - we'll want to make sure that the points created by the function are actually scaled to real-world distances. Also the 4MB grpc message limit is just a default, it is not a real limit, you don't want to destroy data with no way of recovering it. Potentially could create a new optional config for scaling down point clouds, or telling the user to use a smaller resolution of image
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.
few minor nits but this looks good to me!
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.
LGTM!
Co-authored-by: randhid <[email protected]>
RSDK-7954
Before removing
join_color_depth
, we wanted to try out adding PCD support directly into the Realsense module since that was the main use case forjoin_color_depth
anyways. After some trial and error, it looks like adding this logic intoget_point_cloud
is the right path forward. Since we do PCD computation using the latest depth frame and color frame on invocation, it doesn't slow down the logic of frame loop or get_image/images.I implemented the above in this PR along with some re-organization of the encoding helpers into a separate file since the main file is getting quite large.
As for testing, I tested
little_endian_depth
set totrue
and the PCD came out fine. I tested getting color images and viewing point clouds on the App stream with 640x480 and 1280x720 with both sensors. I also verified that using only the depth sensor works for non-color PCDs.