Added U-turn detection function (issue #362)
Added an U-turn detection function.
Description
What is this PR
- [ ] Bug fix
- [x] Addition of a new feature
- [ ] Other
Why is this PR needed?
This PR implements U-turn detection, as requested in issue #362.
What does this PR do?
Using the extreme value difference of the accumulated rotation angle to judge. (support setting extreme value threshold)
References
How has this PR been tested?
The new code has been tested using a fixture that provides a mock dataset for U-turn detection, ensuring that the function detect_u_turns works correctly for both "forward_vector" and "displacement" directions. Tests also verify that the U-turn detection results match the expected values, with results under different thresholds all meeting the expectations.
Is this a breaking change?
No
Does this PR require an update to the documentation?
The docstring has been updated to explain the new detection method and parameters.
Checklist:
- [x] The code has been tested locally
- [x] Tests have been added to cover all new functionality
- [x] The documentation has been updated to reflect any changes
- [x] The code has been formatted with pre-commit
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.87%. Comparing base (
e199c86) to head (272a6c3).
Additional details and impacted files
@@ Coverage Diff @@
## main #507 +/- ##
=======================================
Coverage 99.87% 99.87%
=======================================
Files 28 28
Lines 1568 1579 +11
=======================================
+ Hits 1566 1577 +11
Misses 2 2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Hi @Angelneer926, you may have noticed some CI checks are not passing.
It seems some added lines of code are not covered by tests.
Would you mind investigating this? As per our guidelines, all our code contributions should be fully tested.
Thanks!
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Hey @sfmig! , I saw your review on this PR and was wondering ā is there anything I can help with or contribute to here? Iād love to get involved and assist in wrapping this up if needed š
Let me know!
@vtushar06