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

Remove linear_algebra #1261

Closed
wants to merge 2 commits into from
Closed

Remove linear_algebra #1261

wants to merge 2 commits into from

Conversation

TakanoTaiga
Copy link
Member

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

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 May 22, 2024
@TakanoTaiga TakanoTaiga self-assigned this May 22, 2024
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 TakanoTaiga deleted the fix_remove_linear_algebra branch May 24, 2024 01:24
@github-actions github-actions bot restored the fix_remove_linear_algebra branch May 24, 2024 01:25
@TakanoTaiga TakanoTaiga deleted the fix_remove_linear_algebra branch May 30, 2024 05:44
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant