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

fix(hesai_hw_interface): change to synchronous requests to prevent undefined sensor behavior #126

Merged
merged 42 commits into from
Mar 14, 2024

Conversation

mojomex
Copy link
Collaborator

@mojomex mojomex commented Mar 14, 2024

PR Type

  • Bug Fix

Related Links

TIER IV INTERNAL LINK -- Issue
TIER IV INTERNAL LINK -- Investigation

Description

OT128 had 2s of packets dropped per minute, which was caused by multiple TCP streams being executed concurrently.
Fixing this issue required to

  • remove tcp_driver_s_ and local TCP drivers in hesai_hw_interface.cpp
  • change from asynchronous requests and nested callbacks to blocking/synchronous-style communication

In the wake of this big refactoring, I made the following other changes:

  • remove superfluous function overloads in HW interface
  • move PTC header handling and TCP send/receive logic to its own function in HW interface, accessed by all Get/Set functions

Review Procedure

Refer to the investigation above.
Things I checked (on 40P, QT128, OT128):

  • TCP streams not concurrent
  • No UDP packet drops
  • Pointclouds are correct and at 10Hz without drops
  • PTP works as expected

Remarks

Functionality in #ifdef WITH_DEBUG_STDOUT_HESAI_HW_INTERFACE etc. has not been tested.

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

amc-nu and others added 30 commits November 13, 2023 14:14
Signed-off-by: amc-nu <[email protected]>
Signed-off-by: David Wong <[email protected]>
@mojomex mojomex requested a review from drwnz March 14, 2024 11:02
@mojomex mojomex self-assigned this Mar 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 51 lines in your changes are missing coverage. Please review.

Project coverage is 8.94%. Comparing base (490069e) to head (adf43fe).

Files Patch % Lines
nebula_ros/src/hesai/hesai_decoder_ros_wrapper.cpp 0.00% 26 Missing ⚠️
...ula_ros/src/hesai/hesai_hw_monitor_ros_wrapper.cpp 0.00% 19 Missing ⚠️
...a_ros/src/hesai/hesai_hw_interface_ros_wrapper.cpp 0.00% 6 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #126      +/-   ##
========================================
+ Coverage   6.53%   8.94%   +2.40%     
========================================
  Files        136      64      -72     
  Lines      11073    7253    -3820     
  Branches     869     814      -55     
========================================
- Hits         724     649      -75     
+ Misses      9763    6040    -3723     
+ Partials     586     564      -22     
Flag Coverage Δ
differential 8.94% <0.00%> (?)
total ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mojomex mojomex marked this pull request as ready for review March 14, 2024 11:16
Copy link
Collaborator

@drwnz drwnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@drwnz drwnz merged commit 99cb035 into main Mar 14, 2024
7 checks passed
@drwnz drwnz deleted the ot128-2second-drops-fix branch March 14, 2024 12:30
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.

4 participants