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

Fix/remove linear algebra #1263

Merged
merged 17 commits into from
Jun 10, 2024
Merged

Fix/remove linear algebra #1263

merged 17 commits into from
Jun 10, 2024

Conversation

TakanoTaiga
Copy link
Member

@TakanoTaiga TakanoTaiga commented May 24, 2024

Description

Solving the problem of the same vector manipulation function being implemented in multiple locations.

Abstract

Fixes:

  1. Removed operator overloading from lenear_albebra. Consequently, revised /geometry/vector3/operator.hpp to support lenear_albebra-specific features.
  2. Due to change 1, the quaternion operator overloading in lenear_albebra was interfering, so it was migrated to operator.hpp.
  3. Change 1 caused cases where the getInternalAngle and innerProduct functions in lenear_albebra could not be used, so they were moved to /geometry/vector3/ and templated.
  4. The getSize function in lenear_albebra was removed because it had the same functionality as norm.
  5. Applied these changes to each module of ScenarioSimulator.
  6. Some tests were migrated and deleted due to these changes.

Background

Issue: #1256

Details

  • These newly added files are templated versions of functions that were in linear_algebra. The functionality itself has not been changed.

    • common/math/geometry/include/geometry/vector3/inner_product.hpp
    • common/math/geometry/include/geometry/vector3/internal_angle.hpp
    • common/math/geometry/include/geometry/vector3/vector3.hpp
  • In common/math/geometry/include/geometry/vector3/is_like_vector3.hpp, the following additions were made:

    • Created a helper template to detect if w is not included as an element.
    • Used the above helper template to set IsLikeVector3 to exclude Quaternions.
    • Added a new IsLikeQuaternion to detect Quaternions.
  • In common/math/geometry/include/geometry/vector3/operator.hpp, the following changes were made:

    • Added an option to return the Point type when overloading operators.
    • Added an overload to handle Quaternion calculations.
  • Tests were modified to accommodate these changes. There is no change in the coverage rate.

  • To accommodate these changes, the following files were modified:

    • common/math/geometry/src/polygon/line_segment.cpp
    • common/math/geometry/src/spline/catmull_rom_spline.cpp
    • simulation/do_nothing_plugin/src/plugin.cpp
    • simulation/traffic_simulator/src/behavior/follow_trajectory.cpp
    • simulation/traffic_simulator/src/behavior/longitudinal_speed_planning.cpp
    • simulation/traffic_simulator/src/entity/entity_manager.cpp
    • simulation/traffic_simulator/src/hdmap_utils/hdmap_utils.cpp

References

https://github.com/OUXT-Polaris/quaternion_operation/blob/2c0bf2a60c50262921f9f1858e474030a39560a0/src/quaternion_operation.cpp#L30-L50

https://github.com/tier4/sim_evaluation_tools/issues/294

Destructive Changes

N/A

Known Limitations

N/A

@TakanoTaiga TakanoTaiga marked this pull request as draft May 24, 2024 01:28
Copy link

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 and others added 3 commits May 24, 2024 14:00
Co-authored-by: Masaya Kataoka <ms.kataoka@gmail.com>
Co-authored-by: Masaya Kataoka <ms.kataoka@gmail.com>
Co-authored-by: Masaya Kataoka <ms.kataoka@gmail.com>
@hakuturu583 hakuturu583 added the bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 label May 27, 2024
@TakanoTaiga TakanoTaiga marked this pull request as ready for review May 31, 2024 14:43
@hakuturu583 hakuturu583 merged commit ac4d86d into master Jun 10, 2024
19 checks passed
@TakanoTaiga TakanoTaiga deleted the fix/remove_linear_algebra branch June 11, 2024 08:52
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.

None yet

2 participants