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
Use CBOR compression for PointCloud2 #239
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we have this configurable as a parameter in
options
in the constructor? This way it can be set by the user. Might be good to default to no compression to maintain backwards compatibility.Which makes me wonder why this was not using png compression as default in the first place. In an adapted fork I have good experience with png compression with quite big clouds.
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 don't see any reason to make this configurable. None of the other ROS3D underlying subscriptions have configurable compression.
If "cbor" compression is requested but not available on the server, it will use JSON, so it's already backwards compatible.
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.
When the cbor compression PR lands in
rosbridge
we will have 3 options: none (JSON), png, and cbor. I have no problem with making the defaultcbor
if omitted (and if it proves robust and bug-free), but I would like the user to have the option for choosing the other 2 types as well.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.
Is there a good reason to use another type of compression?
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 think it would be reasonable for all the visualizer classes to have their topic options exposed. I'd like to be able to override
throttle_rate
for example. Maybe this should be a separate PR?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.
So maybe a bytestream of floating point numbers does have enough redundancy for deflate to get value, but not if it is base64 encoded first.
For clients and/or transports that do not support binary messages or per-message deflate, it's possible that we could get good results png encoding a CBOR payload instead of JSON, "cbor_png" compression. This is a good experiment for another day.
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.
It's still possible to have a broken combination:
So I'll add the optional compression soon and maybe fix roslibjs to not request compression types from the server that it can not decode.
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.
@mvollrath Hi, have you tried visualization_msgs/MarkerArray from octomap_server. It is a bunch of cubes.
My test result with MarkerArray is different from Pointcloud2. The performance for ros3djs when receiving MarkerArray is not acceptable.
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.
CBOR is bad for MarkerArray iirc, because most of the data is string keys and there's not a lot of content. JSON is generally faster for messages with a lot of different fields, CBOR is generally faster for messages with a few fields and large numeric arrays. Using no roslib compression (plain JSON) is probably best, and I recommend setting up rosbridge to use websocket compression.
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 answer. It's very useful to me:D