Skip to content
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

Refactor curvature sampling loop to avoid using float counter #1428

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

TakanoTaiga
Copy link
Member

@TakanoTaiga TakanoTaiga commented Oct 23, 2024

Description

Refactor curvature sampling loop to avoid using float counter

Abstract

Refactor of the curvature sampling loop in hermite_curve.cpp to avoid using a float counter, improving precision and readability.

Background

This refactor addresses the potential issues with floating-point precision in the curvature sampling loop.

Details

The original loop used a floating-point counter (for (double s = 0; s <= 1; s = s + 0.1)). This has been refactored to an integer-based loop with a fixed sample count of 10, which eliminates the need for floating-point arithmetic in the loop control.

References

Destructive Changes

N/A

Known Limitations

N/A

@TakanoTaiga TakanoTaiga added the bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 label Oct 23, 2024
@TakanoTaiga TakanoTaiga self-assigned this Oct 23, 2024
Copy link

github-actions bot commented Oct 23, 2024

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@TakanoTaiga TakanoTaiga marked this pull request as ready for review October 23, 2024 12:04
Copy link

sonarcloud bot commented Nov 6, 2024

@hakuturu583 hakuturu583 merged commit 7b06e34 into master Nov 11, 2024
16 checks passed
@github-actions github-actions bot deleted the fix/dont-float-loop branch November 11, 2024 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants