Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(ring_outlier_filter): a cache friendly impl (continuation of VRi…
…chardJP's work) (autowarefoundation#4185) * perf(ring_outlier_filter): a cache friendly impl Signed-off-by: Vincent Richard <[email protected]> style(pre-commit): autofix fix(ring_outlier_filter): cleanup code with ranges Signed-off-by: Vincent Richard <[email protected]> [breaking] fix autoware point type padding for faster memory access can memcpy between input data buffer and PointXYZI* make assumption on memory layout for faster data fetch misc optimization (reordering, constexpr, etc) Signed-off-by: Vincent Richard <[email protected]> style(pre-commit): autofix comment limitations Signed-off-by: Vincent Richard <[email protected]> feat(ring_outlier_filter): add accurate isCluster impl Signed-off-by: Vincent Richard <[email protected]> style(pre-commit): autofix fix autowarefoundation#3218 Signed-off-by: Vincent Richard <[email protected]> cleaning Signed-off-by: Vincent Richard <[email protected]> style(pre-commit): autofix * style(pre-commit): autofix * resize vector to data size Signed-off-by: Vincent Richard <[email protected]> * cleaning Signed-off-by: Vincent Richard <[email protected]> * cleaner utilities impl Signed-off-by: Vincent Richard <[email protected]> * Correct ring_outlier_filter algorithm The implementation by VRichardJP was erroneously using indices into the input->fields array as byte offsets for copying values from the input. Added the missing step to access the offset of the field pointed at by the respective index. When combining the first and last walk, the num_points fields of the two walks need to be summed up as well. isCluster checks for num_points as well as distance. Signed-off-by: Maximilian Schmeller <[email protected]> * Optimize memory usage of walks array The walks array in the previous implementation could in the worst case grow to the number of input points (if every point is an outlier). This increased computation time for gradually growing the walks vector. The current implementation only saves the first and current walk for every ring. The isCluster check is performed right when a walk is completed, and a bool vector akin to the previous walk_is_cluster vector is maintained. Signed-off-by: Maximilian Schmeller <[email protected]> * Remove debug timers and outputs Signed-off-by: Maximilian Schmeller <[email protected]> * style(pre-commit): autofix * Reduce amount of helper functions and data structures Remove functions for finding field offsets of Pointcloud2 points, replace them with the previous approach of assuming their position. This is okay since the ring_outlier_filter specification clearly states the expected pointcloud format. Remove accessor lambda functions for ring/azimuth/etc. because they are onlu used once anyways. Remove the walks vector and save the first/current walk structs directly in the RingWalkInfo struct. This makes the code more readable and maintainable. Signed-off-by: Maximilian Schmeller <[email protected]> * style(pre-commit): autofix * Check for invalid pointcloud format In the previous revision (and before this PR), pointcloud field indices in ring_outlier_filter were hardcoded and fields were assumed to exist. VRichardJP solved this by implementing individual accessor functions, which ended up to be a bit verbose for this small piece of functionality. Now, there is one generic accessor function and the faster_filter function exits if any of the fields expected does not exist. The expected field data type is also checked. Signed-off-by: Maximilian Schmeller <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Vincent Richard <[email protected]> Signed-off-by: Maximilian Schmeller <[email protected]> Co-authored-by: Vincent Richard <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maximilian Schmeller <[email protected]>
- Loading branch information