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(autoware_map_based_prediction): fix syntaxError #7813

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

veqcc
Copy link
Contributor

@veqcc veqcc commented Jul 3, 2024

Description

This is a fix based on cppcheck syntaxError error.

perception/autoware_map_based_prediction/src/map_based_prediction_node.cpp:1774:16: error: The code contains unhandled character(s) (character code=206). Neither unicode nor extended ascii is supported. [syntaxError]
  const double λ = std::log(2) / acceleration_exponential_half_life_;
               ^
perception/autoware_map_based_prediction/src/path_generator.cpp:424:15: error: The code contains unhandled character(s) (character code=206). Neither unicode nor extended ascii is supported. [syntaxError]
  const float λ = std::log(2) / acceleration_exponential_half_life_;
              ^

Changes are only renaming λ to lambda.

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: Ryuta Kambe <ryuta.kambe@tier4.jp>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jul 3, 2024
@veqcc veqcc self-assigned this Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@veqcc veqcc added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 3, 2024
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.

LGTM!

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 28.54%. Comparing base (fbbc44c) to head (2ad9c58).

Files Patch % Lines
...toware_map_based_prediction/src/path_generator.cpp 0.00% 9 Missing ⚠️
...based_prediction/src/map_based_prediction_node.cpp 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7813      +/-   ##
==========================================
- Coverage   28.55%   28.54%   -0.01%     
==========================================
  Files        1586     1588       +2     
  Lines      115879   115917      +38     
  Branches    49384    49387       +3     
==========================================
  Hits        33093    33093              
- Misses      73823    73861      +38     
  Partials     8963     8963              
Flag Coverage Δ *Carryforward flag
differential 1.15% <0.00%> (?)
total 28.56% <ø> (+<0.01%) ⬆️ Carriedforward from 4e90378

*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.

Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
@veqcc
Copy link
Contributor Author

veqcc commented Jul 3, 2024

@kyoichi-sugahara

The cppcheck raises the following new warnings.
This is because the syntaxError has been preventing cppcheck to analyze these files properly so far.

Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/map_based_prediction_node.cpp:1779:53: style: Expression 'exp(x) - 1' can be replaced by 'expm1(x)' to avoid loss of precision. [unpreciseMathCall]
      obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
                                                    ^
Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/map_based_prediction_node.cpp:1[7](https://github.com/autowarefoundation/autoware.universe/actions/runs/9779459222/job/26998789870?pr=7813#step:12:8)97:53: style: Expression 'exp(x) - 1' can be replaced by 'expm1(x)' to avoid loss of precision. [unpreciseMathCall]
      obj_acc * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) + obj_vel * t_f +
                                                    ^
Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/path_generator.cpp:450:44: style: Expression 'log(1 + x)' can be replaced by 'log1p(x)' to avoid loss of precision. [unpreciseMathCall]
      auto t_stop = (-1.0 / lambda) * std::log(1 + (v * lambda / a));
                                           ^
Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/path_generator.cpp:455:4[9](https://github.com/autowarefoundation/autoware.universe/actions/runs/9779459222/job/26998789870?pr=7813#step:12:10): style: Expression 'exp(x) - 1' can be replaced by 'expm1(x)' to avoid loss of precision. [unpreciseMathCall]
        a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_h) - 1);
                                                ^
Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/path_generator.cpp:466:56: style: Expression 'exp(x) - 1' can be replaced by 'expm1(x)' to avoid loss of precision. [unpreciseMathCall]
             (a / (t_h * std::pow(lambda, 2))) * (std::exp(-lambda * t_h) - 1);
                                                       ^
Error: /home/runner/work/autoware.universe/autoware.universe/perception/autoware_map_based_prediction/src/path_generator.cpp:476:74: style: Expression 'exp(x) - 1' can be replaced by 'expm1(x)' to avoid loss of precision. [unpreciseMathCall]
      a * (1.0 / lambda) * t_f + a * (1.0 / std::pow(lambda, 2)) * (std::exp(-lambda * t_f) - 1) +
                                                                         ^

veqcc and others added 2 commits July 3, 2024 23:29
Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp>
@kyoichi-sugahara
Copy link
Contributor

@veqcc

The cppcheck raises the following new warnings.

It's not funny, but I laughed at the interesting behavior.
I think the new changes are still LGTM 👍

@veqcc
Copy link
Contributor Author

veqcc commented Jul 3, 2024

Thank you!

@veqcc veqcc merged commit 4214697 into autowarefoundation:main Jul 3, 2024
29 of 30 checks passed
@veqcc veqcc deleted the fix/cppcheck_syntax_error2 branch July 3, 2024 15:09
palas21 pushed a commit to palas21/autoware.universe that referenced this pull request Jul 12, 2024
…on#7813)

* fix(autoware_map_based_prediction): fix syntaxError

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

* style(pre-commit): autofix

* fix spellcheck

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

* fix new cppcheck warnings

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: palas21 <palas21@itu.edu.tr>
tby-udel pushed a commit to tby-udel/autoware.universe that referenced this pull request Jul 14, 2024
…on#7813)

* fix(autoware_map_based_prediction): fix syntaxError

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

* style(pre-commit): autofix

* fix spellcheck

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

* fix new cppcheck warnings

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(autoware_map_based_prediction): fix syntaxError

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

* style(pre-commit): autofix

* fix spellcheck

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

* fix new cppcheck warnings

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>
Ariiees pushed a commit to Ariiees/autoware.universe that referenced this pull request Jul 22, 2024
…on#7813)

* fix(autoware_map_based_prediction): fix syntaxError

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

* style(pre-commit): autofix

* fix spellcheck

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

* fix new cppcheck warnings

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