feat(hesai_hw_interface): configure and check SO_RCVBUF
automatically
#186
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.
PR Type
Related Links
Description
High-bandwidth sensors such as the OT128 may experience packet loss due to the UDP socket's receive buffer being too small by default. This PR adds functionality to set and confirm that buffer size.
The buffer has to be set to a size that
For now, the chosen (hard-coded) size is
1500 B * 3600 = 5.4 MB
, which is the MTU size (1500 B
) times the maximum number of packets in one full scan of OT128.The memory footprint is still 'kind of' small compared to the size of pointcloud buffers etc., so condition 1 is fulfilled for the moment. In the future, computing the optimal buffer size based on sensor bandwidth would be preferable.
Review Procedure
Setting
rmem_default
andrmem_max
is done like:sudo sysctl -w net.core.rmem_default=123
.rmem_default
andrmem_max
to a size smaller than5.4 MB
, e.g.500000
for500 KB
. Nebula should refuse to launch with an error message telling you to increasermem_max
.rmem_default
to a small size like above, and setrmem_max
to a value greater than5.4 MB
, e.g.1000000000
for1 GB
. Nebula should now run, set its socket's buffer size to5.4 MB
and there should be no packet loss.For the easiest review experience, comment out all point filters in
hesai_decoder.hpp
and hard-code the points' distance to be a fixed value. That way, you will see a perfect circle and immediately notice any missing secitons.Pre-Review Checklist for the PR Author
PR Author should check the checkboxes below when creating the PR.
Checklist for the PR Reviewer
Reviewers should check the checkboxes below before approval.
Post-Review Checklist for the PR Author
PR Author should check the checkboxes below before merging.
CI Checks