-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(hesai): add filtered pointcloud counter function #247
base: main
Are you sure you want to change the base?
feat(hesai): add filtered pointcloud counter function #247
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
==========================================
+ Coverage 26.07% 26.40% +0.33%
==========================================
Files 101 101
Lines 9232 9171 -61
Branches 2213 2185 -28
==========================================
+ Hits 2407 2422 +15
+ Misses 6436 6362 -74
+ Partials 389 387 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 PR! Here is the review so far. Performance looks good but there are some more counters and naming changes I'd like to request 🙇
NebulaPointCloud point_azimuth_start; | ||
NebulaPointCloud point_azimuth_end; | ||
NebulaPointCloud point_timestamp_start; | ||
NebulaPointCloud point_timestamp_end; |
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.
Please change these from NebulaPointCloud
to their respective data types (e.g. float
for azimuth, uint64_t
for timestamp.
uint16_t distance_counter = 0; | ||
uint16_t fov_counter = 0; | ||
uint16_t timestamp_counter = 0; |
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.
Please add filtered
to the names, e.g. n_filtered_distance
, n_filtered_fov
etc.
@@ -36,6 +37,52 @@ | |||
namespace nebula::drivers | |||
{ | |||
|
|||
struct HesaiDecodeFilteredInfo |
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.
Please also add counters for
- invalid points (distance == 0), line 198
- points filtered due to dual_return_threshold (line 238)
- points filtered due to identical return type (line 217)
- points kept in total (= not filtered) (shall be equal to the final pointcloud size)
/// @brief For each channel, its firing offset relative to the block in nanoseconds | ||
std::array<int, SensorT::packet_t::n_channels> channel_firing_offset_ns_; | ||
/// @brief For each return mode, the firing offset of each block relative to its packet in | ||
/// nanoseconds | ||
std::array<std::array<int, SensorT::packet_t::n_blocks>, SensorT::packet_t::max_returns> | ||
block_firing_offset_ns_; | ||
|
||
void get_minmax_info(const NebulaPoint & point) |
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.
This can be moved into HesaiDecodeFilteredInfo
so it is clear to readers that it belongs to that struct.
NebulaPointCloud point_timestamp_start; | ||
NebulaPointCloud point_timestamp_end; | ||
|
||
void clear() |
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.
Please make sure that all fields are reset (e.g. timestamp_counter is missing)
float distance_start = 0; | ||
float distance_end = 0; | ||
float raw_azimuth_start = 0; | ||
float raw_azimuth_end = 0; | ||
std::uint32_t packet_timestamp_start = 0; | ||
std::uint32_t packet_timestamp_end = 0; | ||
NebulaPointCloud point_azimuth_start; | ||
NebulaPointCloud point_azimuth_end; | ||
NebulaPointCloud point_timestamp_start; | ||
NebulaPointCloud point_timestamp_end; |
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.
- Please rename from
start/end
tomin/max
. - Please also add unit suffixes like
_ns
for nanoseconds,_rad
for radians,_m
for meters etc. packet_timestamp_min/max
should probably have typeuint64_t
(uint32_t
cannot represent absolute timestamps in nanoseconds)
Instead of point_
, please rename to cloud_
so that it is clear that those values are among the points that were not filtered.
I would suggest replacing raw_
with packet_
as well, so we have packet_
(before filtering) vs. cloud_
(after filtering).
j["distance_counter"] = distance_counter; | ||
j["fov_counter"] = fov_counter; | ||
j["timestamp_counter"] = timestamp_counter; |
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.
For filters, let's output them as a JSON array instead:
"filter_pipeline": [
{ "filter": "distance", "count": 50 },
{ "filter": "fov", "count": 120 }
]
PR Type
Description
This pr will be able to watch filtered pointcloud's count by each filtering such as distance, fov and so on. It is usefull for finding filtering error while seeking causes of lidar pointclouds error.
Review Procedure
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