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
This PR refactors the Hesai unit tests to a generic form.
This is motivated by another PR I will open shortly, which implements a new unit test for each sensor, which I did not want to implement over and over again for each sensor model.
Previously, for each sensor model, a
hesai_ros_decoder_test_XYZ.cpp
containing a full implementation of theHesaiRosDecoderTest
node and ahesai_ros_decoder_test_main_XYZ.cpp
handling the launch of said node were implemented.Looking at the
diff
between the implementations for e.g. Pandar40P and Pandar64, the only differences are the ROS parameter values (such asmodel_name
,bag_path
, etc.):This makes for a very straight-forward refactoring, where the parameters are passed into
HesaiRosDecoderTest
as a parameter struct, and the test cases being replaced by a parametrized one.Further, to accomodate for future test cases, the
HesaiRosDecoderTest::ReadBag()
function has been modified to take a callback function as a parameter which is called on each decoded pointcloud and which can then perform functions specific to a given unit test.Review Procedure
Compile and run unit tests
Remarks
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