Skip to content

Added U-turn detection function (issue #362) #507

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Angelneer926
Copy link

Added an U-turn detection function.

Description

What is this PR

  • Bug fix
  • 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:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Make the error message more detailed

Co-authored-by: Vasco Schiavo <[email protected]>
@niksirbi niksirbi self-requested a review March 24, 2025 11:40
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sfmig
Copy link
Contributor

sfmig commented Mar 26, 2025

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants