movement icon indicating copy to clipboard operation
movement copied to clipboard

Added U-turn detection function (issue #362)

Open Angelneer926 opened this issue 9 months ago • 4 comments

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

#362

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

Angelneer926 avatar Mar 22 '25 18:03 Angelneer926

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.

codecov[bot] avatar Mar 25 '25 10:03 codecov[bot]

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!

sfmig avatar Mar 26 '25 13:03 sfmig

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

vtushar06 avatar Jun 29 '25 12:06 vtushar06