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(ekf_localizer): add a warning class #1837

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

IshitaTakeshi
Copy link
Contributor

@IshitaTakeshi IshitaTakeshi commented Sep 12, 2022

Description

Add a warning class to simplify displaying messages

Related links

Tests performed

Tests need to be performed to validate the displayed messages, but they should be done in another PR.

Notes for reviewers

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #1837 (a1f70c9) into main (cb2552b) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1837      +/-   ##
==========================================
- Coverage   10.44%   10.41%   -0.03%     
==========================================
  Files        1221     1222       +1     
  Lines       87728    87926     +198     
  Branches    20493    20653     +160     
==========================================
  Hits         9160     9160              
- Misses      69091    69274     +183     
- Partials     9477     9492      +15     
Flag Coverage Δ *Carryforward flag
differential 17.50% <0.00%> (?)
total 10.42% <0.00%> (ø) Carriedforward from cb2552b

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

Impacted Files Coverage Δ
..._localizer/include/ekf_localizer/ekf_localizer.hpp 0.00% <ø> (ø)
...on/ekf_localizer/include/ekf_localizer/warning.hpp 0.00% <0.00%> (ø)
localization/ekf_localizer/src/ekf_localizer.cpp 0.00% <0.00%> (ø)
...include/behavior_velocity_planner/planner_data.hpp 0.00% <0.00%> (ø)
planning/behavior_velocity_planner/src/node.cpp 0.42% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kminoda kminoda added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Sep 12, 2022
@kminoda
Copy link
Contributor

kminoda commented Sep 12, 2022

Would you mind explaining the aim of this PR more concretely?

I personally think that the original warnings using RCLCPP_WARNs is also not too bad.
The other packages also use the same warning formats for now, so I'd say it's better to leave it as it is as long as we don't have strong reason to change it as in this PR.

What do you think?

@IshitaTakeshi
Copy link
Contributor Author

For people who read the code, for example, the line

    RCLCPP_WARN_THROTTLE(
      get_logger(), *get_clock(), std::chrono::milliseconds(1000).count(),
      "Twist delay exceeds the compensation limit, ignored. delay: %f[s], limit = "
      "extend_state_step * ekf_dt : %f [s]",
      delay_time, extend_state_step_ * ekf_dt_);

is too noisy. For readers, it is not necessary to know how to obtain the logger from the node and clock, i.e., get_logger and get_clock respectively, and it is not necessary to see how to represent the duration std::chrono::milliseconds(duration).count().

The basic strategy to improve readability and maintainability is to improve cohesion, and it is what I did here.

Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

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

LGTM!

@IshitaTakeshi IshitaTakeshi merged commit 7e2370d into main Sep 15, 2022
@IshitaTakeshi IshitaTakeshi deleted the refactor/warning-class branch September 15, 2022 08:04
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Sep 28, 2022
* refactor(ekf_localizer): add a warning class to simplify displaying messages
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 3, 2022
* refactor(ekf_localizer): add a warning class to simplify displaying messages
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 3, 2022
* refactor(ekf_localizer): add a warning class to simplify displaying messages
boyali pushed a commit to boyali/autoware.universe that referenced this pull request Oct 19, 2022
* refactor(ekf_localizer): add a warning class to simplify displaying messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:localization Vehicle's position determination in its environment. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants