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(bytetrack): fix cppcheck warnings #7576

Merged
merged 6 commits into from
Jun 24, 2024

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Jun 19, 2024

Description

This is a fix based on cppcheck warnings

perception/bytetrack/lib/src/lapjv.cpp:184:56: style: Parameter 'd' can be declared as pointer to const [constParameterPointer]
uint_t _find_dense(const uint_t n, uint_t lo, cost_t * d, int_t * cols, [[maybe_unused]] int_t * y)
                                                       ^
perception/bytetrack/lib/src/lapjv.cpp:206:25: style: Parameter 'y' can be declared as pointer to const [constParameterPointer]
  int_t * pred, int_t * y, cost_t * v)
                        ^
perception/bytetrack/lib/src/lapjv.cpp:206:37: style: Parameter 'v' can be declared as pointer to const [constParameterPointer]
  int_t * pred, int_t * y, cost_t * v)
                                    ^
perception/bytetrack/lib/src/strack.cpp:120:27: style: Variable 'xyah' is assigned a value that is never used. [unreadVariable]
  std::vector<float> xyah = tlwh_to_xyah(_tlwh_tmp);
                          ^
perception/bytetrack/lib/src/strack.cpp:135:27: style: Variable 'xyah' is assigned a value that is never used. [unreadVariable]
  std::vector<float> xyah = tlwh_to_xyah(new_track.tlwh);
                          ^
perception/bytetrack/lib/src/strack.cpp:159:27: style: Variable 'xyah' is assigned a value that is never used. [unreadVariable]
  std::vector<float> xyah = tlwh_to_xyah(new_track.tlwh);
                          ^
perception/bytetrack/lib/src/utils.cpp:280:35: style: The scope of the variable 'cost_c_extended' can be reduced. [variableScope]
  std::vector<std::vector<float>> cost_c_extended;
                                  ^
perception/bytetrack/lib/src/utils.cpp:193:24: style: Unused variable: ious_tmp [unusedVariable]
    std::vector<float> ious_tmp;
                       ^
perception/bytetrack/src/bytetrack_visualizer_node.cpp:131:15: style: Variable 'feat_obj' can be declared as reference to const [constVariableReference]
  for (auto & feat_obj : rect_msg->feature_objects) {
              ^
perception/bytetrack/src/bytetrack_visualizer_node.cpp:138:15: style: Variable 'dynamic_obj' can be declared as reference to const [constVariableReference]
  for (auto & dynamic_obj : uuid_msg->objects) {
              ^

Tests performed

Not applicable.

Effects on system behavior

Not applicable.

Interface changes

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.

veqcc added 5 commits June 19, 2024 11:18
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
@veqcc veqcc requested review from manato and YoshiRi as code owners June 19, 2024 02:26
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jun 19, 2024
@veqcc veqcc added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 19, 2024
Copy link
Contributor

@manato manato left a comment

Choose a reason for hiding this comment

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

@veqcc
I appreciate your contribution and am sorry for the delay in the review.
LGTM! I also confirmed the modified bytetrack node works fine on my local environment

@veqcc veqcc merged commit ed0c45d into autowarefoundation:main Jun 24, 2024
23 of 24 checks passed
@veqcc veqcc deleted the fix_bytetrack branch June 24, 2024 04:01
simon-eisenmann-driveblocks pushed a commit to simon-eisenmann-driveblocks/autoware.universe that referenced this pull request Jun 26, 2024
* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix variableScope

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unusedVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix constParameterPointer

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Simon Eisenmann <simon.eisenmann@driveblocks.ai>
tby-udel pushed a commit to tby-udel/autoware.universe that referenced this pull request Jul 14, 2024
* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix variableScope

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unusedVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix constParameterPointer

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix variableScope

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unusedVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix constParameterPointer

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* fix unreadVariable

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

2 participants