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(tier4_camera_view_rviz_plugin): fix bugprone-parent-virtual-call #9815

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

kobayu858
Copy link
Contributor

Description

This is a fix based on clang-tidy bugprone-parent-virtual-call error.

/home/emb4/autoware/autoware/src/universe/autoware.universe/visualization/tier4_camera_view_rviz_plugin/src/third_person_view_controller.cpp:187:3: error: qualified name 'FramePositionTrackingViewController::mimic' refers to a member overridden in subclass; did you mean 'rviz_default_plugins::view_controllers::OrbitViewController'? [bugprone-parent-virtual-call,-warnings-as-errors]
  FramePositionTrackingViewController::mimic(source_view);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  rviz_default_plugins::view_controllers::OrbitViewController::

This error occurs in the following situations.

struct A {
  int virtual foo() {...}
};

struct B: public A {
  int foo() override {...}
};

struct C: public B {
  int foo() override { A::foo(); }
//                     ^^^^^^^^
// warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'?  [bugprone-parent-virtual-call]
};

The class definition of ThirdPersonViewControlle is shown below, and it inherits from rviz_default_plugins::view_controllers::OrbitViewController.

class ThirdPersonViewController : public rviz_default_plugins::view_controllers::OrbitViewController

However, in the function, it calls FamilyPositionTrackingViewController::mimic. Is this relationship correct?
Or is calling rviz_default_plugins::view_controllers::OrbitViewController::mimic the correct intent?

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: kobayu858 <[email protected]>
Signed-off-by: kobayu858 <[email protected]>
Copy link

github-actions bot commented Dec 27, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@kobayu858 kobayu858 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 27, 2024
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 29.63%. Comparing base (ab845fb) to head (cae846f).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...w_rviz_plugin/src/third_person_view_controller.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9815      +/-   ##
==========================================
+ Coverage   29.59%   29.63%   +0.04%     
==========================================
  Files        1451     1450       -1     
  Lines      108919   108420     -499     
  Branches    42597    42533      -64     
==========================================
- Hits        32232    32129     -103     
+ Misses      73589    73135     -454     
- Partials     3098     3156      +58     
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 29.63% <ø> (+0.04%) ⬆️ Carriedforward from 7e4a7de

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

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

@kobayu858
Copy link
Contributor Author

@yabuta @Owen-Liuyuxuan
Please confirm the PR. Thank you very much.

@kobayu858 kobayu858 merged commit e2accc5 into autowarefoundation:main Jan 7, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants