autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
1.03k stars 655 forks source link

fix(autoware_pose_estimator_arbiter): add missing include #9376

Closed veqcc closed 1 week ago

veqcc commented 1 week ago

Description

Added functional include. This solves the following clang-tidy error

/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:43:32: error: invalid range expression of type 'const auto'; no viable 'begin' function available [clang-diagnostic-error]
    for (const auto & callback : callbacks_) {
                               ^ ~~~~~~~~~~
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:43:34: error: use of undeclared identifier 'callbacks_'; did you mean 'callback'? [clang-diagnostic-error]
    for (const auto & callback : callbacks_) {
                                 ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:43:23: note: 'callback' declared here
    for (const auto & callback : callbacks_) {
                      ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:55:31: error: no template named 'function' in namespace 'std' [clang-diagnostic-error]
  void register_callback(std::function<void(T)> callback) const { callbacks_.push_back(callback); }
                         ~~~~~^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:55:67: error: use of undeclared identifier 'callbacks_'; did you mean 'callback'? [clang-diagnostic-error]
  void register_callback(std::function<void(T)> callback) const { callbacks_.push_back(callback); }
                                                                  ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:55:49: note: 'callback' declared here
  void register_callback(std::function<void(T)> callback) const { callbacks_.push_back(callback); }
                                                ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:62:17: error: no member named 'bind' in namespace 'std'; did you mean 'find'? [clang-diagnostic-error]
    return std::bind(&CallbackInvokingVariable::set_and_invoke, this, std::placeholders::_1);
           ~~~~~^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:3843:5: note: 'find' declared here
    find(_InputIterator __first, _InputIterator __last,
    ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:62:76: error: no member named 'placeholders' in namespace 'std' [clang-diagnostic-error]
    return std::bind(&CallbackInvokingVariable::set_and_invoke, this, std::placeholders::_1);
                                                                      ~~~~~^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:70:28: error: no member named 'function' in namespace 'std' [clang-diagnostic-error]
  mutable std::vector<std::function<void(T)>> callbacks_;
                      ~~~~~^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:70:42: error: 'T' does not refer to a value [clang-diagnostic-error]
  mutable std::vector<std::function<void(T)>> callbacks_;
                                         ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:30:20: note: declared here
template <typename T>
                   ^
/home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/shared_data.hpp:70:45: error: expected member name or ';' after declaration specifiers [clang-diagnostic-error]
  mutable std::vector<std::function<void(T)>> callbacks_;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
9 errors generated.
Error while processing /home/veqcc/work/autoware/src/universe/autoware.universe/localization/autoware_pose_estimator_arbiter/src/switch_rule/enable_all_rule.cpp.
Found compiler error(s).

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

github-actions[bot] commented 1 week ago

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 29.81%. Comparing base (a0c4ab4) to head (ac65938). Report is 25 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9376 +/- ## ========================================== + Coverage 29.79% 29.81% +0.02% ========================================== Files 1338 1339 +1 Lines 103211 103228 +17 Branches 40212 40217 +5 ========================================== + Hits 30748 30775 +27 + Misses 69477 69464 -13 - Partials 2986 2989 +3 ``` | [Flag](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9376/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | Coverage Δ | | *Carryforward flag | |---|---|---|---| | [differential](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9376/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | `14.05% <ø> (?)` | | | | [total](https://app.codecov.io/gh/autowarefoundation/autoware.universe/pull/9376/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | `29.79% <ø> (ø)` | | Carriedforward from [a0c4ab4](https://app.codecov.io/gh/autowarefoundation/autoware.universe/commit/a0c4ab45d78f64ef9c7c1022af2c8f61682ae32a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autowarefoundation) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: