Skip to content
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

Decimal places limit for depth Camera #608

Merged

Conversation

elandini84
Copy link
Contributor

@elandini84 elandini84 commented Jan 27, 2022

The possibility to limit the decimal places of the pixels values has
been added to the DepthCameraDriver class.

The main reason behind this PR relies on the great bandwidth consumption of the depth images (32 bit float data and up to 7-8 significant digits.) even after lossless compression.

The following set of tests should provide a good explanation of the benefits of this new feature (thanks to @DatSpace for preforming the tests and for the useful table)

Data

For the experiment we try different quantization values (significant digits) for a depth image from gazebo, while the robot is looking turned 45 degrees at a wall 1m away from the camera. The bandwidth bellow is per frame averaged over 10 seconds, transmitted through LAN with zlib compression.

Significant Digits Bandwidth Percentage Change Comments
8 7.23 Mbps -
7 7.35 Mbps +1.66% It appears that at that many digits it has no effect and it just seems random
6 7.04 Mbps -4.2%
5 6.05 Mbps -14.0%
4 1.77 Mbps -70.7%
3 0.311 Mbps -82.4% Millimeter accuracy
2 0.11 Mbps -64.6% Centimeter accuracy. This seems to be the most logical for our use case with R1 since the camera currently used (Realsense D455) has a theoretical accuracy on the z axis of <2% at 4m, which makes it to have an error of 8cm at worst, at 4m.
1 0.099 Mbps -9.9% Decimeter accuracy with visible quantitation in the depth image color.
0 0.069 Mbps -29.7% This represents only integer values in meters and obviously cannot be used.

Note: There was some background data transfer at the range of 30kbps that is significant for the lowest measurements. Still the numbers are so small that it doesn't really matter.

NB: If the configuration parameters passed to the plugin do not contain the group QUANT_PARAM this feature is disabled and the plugin will work as it always had.

EDIT: An example of configuration file with the parameters group needed for this feature can be seen in PR #35 for the cer-sim repo.

The possibility to limit the decimal places of the pixels values has
been added to the DepthCameraDriver class.
@traversaro
Copy link
Member

traversaro commented Feb 2, 2022

Hi @elandini84, sorry, I had missed this PR (feel free to ping me if you see I do not reply in a few days).

@traversaro
Copy link
Member

This is quite a cool feature! Before merging, can you:

Thanks!

@elandini84
Copy link
Contributor Author

This is quite a cool feature! Before merging, can you:

Thanks!

I added the requested changes. Just one thig: I added the parameter inside a separate section ([QUANT_PARAM]). Do you think that it would be better to get rid of the config file section? If so, just tell and I'll modify the code.

@traversaro
Copy link
Member

Thanks! I modified a bit the changelog to be a bit more clear. For what regards the name of the parameter for me the choice of group/not group is indifferent, if you like it like this we can proceed.

@elandini84
Copy link
Contributor Author

Thanks! I modified a bit the changelog to be a bit more clear. For what regards the name of the parameter for me the choice of group/not group is indifferent, if you like it like this we can proceed.

Thanks for the changes.

@traversaro
Copy link
Member

@elandini84 so the current name is ok for you?

@elandini84
Copy link
Contributor Author

@elandini84 so the current name is ok for you?

Yes, absolutely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants