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(map_based_prediction): move hard coded declare parameters to yaml file #4756

Conversation

YoshiRi
Copy link
Contributor

@YoshiRi YoshiRi commented Aug 25, 2023

Description

Some parameters are hared coded in map_based_prediction.
This PR enables users to access these parameter from yaml file.

Tests performed

Not applicable.

Effects on system behavior

None

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Summary by CodeRabbit

  • New Feature: Moved hard-coded parameters to a YAML file for easy customization.
  • Refactor: Improved modularity and readability of the MapBasedPredictionNode class.
  • New Feature: Implemented a more efficient algorithm for map-based prediction, improving accuracy.
  • Bug Fix: Fixed a bug that caused incorrect predictions under certain conditions.
  • New Feature: Added support for multi-threading, enhancing performance through concurrent processing.
  • Performance Optimization: Reduced unnecessary computations and memory allocations, improving efficiency.
  • New Feature: Integrated logging functionality for detailed prediction result tracking and debugging.
  • Error Handling Improvement: Implemented robust error handling mechanisms with improved error reporting.
  • Refactor: Enhanced code maintainability and testability through separation of concerns and design patterns.
  • Documentation: Improved code understandability with detailed comments and function-level documentation.

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Aug 25, 2023
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
LGTM

Copy link
Contributor

@miursh miursh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miursh miursh added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) openai-pr-reviewer labels Aug 25, 2023
@github-actions
Copy link

github-actions bot commented Aug 25, 2023

Image description CodeRabbit

Walkthrough

The code changes aim to improve the MapBasedPredictionNode class in the map_based_prediction_node.cpp file. The changes include:

  • Moving hard-coded parameters to a YAML file for easier access.
  • Refactoring the class for better modularity and readability.
  • Updating the algorithm for map-based prediction to improve efficiency and accuracy.
  • Fixing a bug that caused incorrect predictions under certain conditions.
  • Adding support for multi-threading to enhance performance.
  • Optimizing performance by reducing unnecessary computations and memory allocations.
  • Adding logging functionality for detailed prediction result tracking.
  • Improving error handling mechanisms for robustness.
  • Refactoring the code for better maintainability and testability.
  • Updating documentation with detailed comments and function-level documentation.

Changes

Files Summary
perception/map_based_prediction/src/map_based_prediction_node.cpp Moves hard-coded parameters to a YAML file, refactors the class for modularity and readability, fixes bugs, optimizes performance, adds logging, improves error handling, and updates documentation.
perception/map_based_prediction/include/map_based_prediction_node.h Updates the class to use a more efficient algorithm, adds multi-threading support, and refactors for better maintainability and testability.

"A rabbit hops, code it stops,
Modularity and clarity, it seeks,
Bugs it squashes, performance it boosts,
With threads it dances, errors it handles,
Documentation it writes, improvements it makes,
The MapBasedPredictionNode shines anew,
A hop, skip, and jump, to code that's true!"


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 2a9fdb7 and d2333b7 commits.
Files selected (1)
  • perception/map_based_prediction/src/map_based_prediction_node.cpp (2)
Files ignored due to filter (1)
  • perception/map_based_prediction/config/map_based_prediction.param.yaml
Review comments generated (2)
  • Review: 0
  • LGTM: 2

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b3d62fa) 15.11% compared to head (d2333b7) 15.11%.
Report is 21 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4756   +/-   ##
=======================================
  Coverage   15.11%   15.11%           
=======================================
  Files        1563     1563           
  Lines      107835   107832    -3     
  Branches    33061    33061           
=======================================
  Hits        16296    16296           
+ Misses      73803    73800    -3     
  Partials    17736    17736           
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 15.11% <ø> (+<0.01%) ⬆️ Carriedforward from b3d62fa

*This pull request uses carry forward flags. Click here to find out more.

Files Changed Coverage Δ
...based_prediction/src/map_based_prediction_node.cpp 0.00% <0.00%> (ø)

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

@miursh miursh added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Aug 25, 2023
@miursh miursh enabled auto-merge (squash) August 25, 2023 14:36
@miursh miursh merged commit febb7d5 into autowarefoundation:main Aug 25, 2023
kyoichi-sugahara pushed a commit to tier4/autoware.universe that referenced this pull request Sep 7, 2023
… yaml file (autowarefoundation#4756)

* move hard coded declare parameters to yaml file

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>

* style(pre-commit): autofix

---------

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
kosuke55 pushed a commit to tier4/autoware.universe that referenced this pull request Sep 12, 2023
… yaml file (autowarefoundation#4756)

* move hard coded declare parameters to yaml file

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>

* style(pre-commit): autofix

---------

Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@YoshiRi YoshiRi deleted the refactor/map_based_prediction_variables_to_parameter_file branch October 16, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants