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(vehicle_cmd_gate): fix publisher HZ in the unit test by introducing variable window length #6665

Merged
merged 11 commits into from
Mar 26, 2024

Conversation

xmfcx
Copy link
Contributor

@xmfcx xmfcx commented Mar 21, 2024

Description

Continuation from:

Attempts to fix:

@takayuki5168 -san, I've implemented this variable window length calculation to smooth out the control values.

checkFilter(2);
checkFilter(3);
checkFilter(4);

checkFilter(2) should work same as the original implementation.

But higher values will will average over 3 or more values for buffering spiky test results.

Tests performed

Local machine

colcon test --event-handlers console_cohesion+ --packages-select vehicle_cmd_gate passes successfully with or without this PR.

CI runners

Test with checkFilter(2) ❌, 👌

Ok, with checkFilter(2), it has failed the same way as expected.

1: last_x:        2 
1: /__w/autoware.universe/autoware.universe/control/vehicle_cmd_gate/test/src/test_filter_in_vehicle_cmd_gate_node.cpp:304: Failure
1: Expected: (std::abs(avg_lon_jerk)) < (max_lon_jerk_lim * threshold_scale), actual: 1.59257 vs 1.54

Now removing the checkFilter(2).

Test with checkFilter(3) and checkFilter(4)

It worked for the both tests 😄

Now will remove the redundant print line.

Effects on system behavior

Not applicable.

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.

takayuki5168 and others added 3 commits March 21, 2024 13:20
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
@xmfcx xmfcx self-assigned this Mar 21, 2024
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Mar 21, 2024
@xmfcx xmfcx added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Mar 21, 2024
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 69.44444% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 14.79%. Comparing base (872cbdd) to head (21f5296).
Report is 16 commits behind head on main.

Files Patch % Lines
.../test/src/test_filter_in_vehicle_cmd_gate_node.cpp 69.44% 0 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6665      +/-   ##
==========================================
+ Coverage   14.78%   14.79%   +0.01%     
==========================================
  Files        1925     1925              
  Lines      132734   132750      +16     
  Branches    39529    39531       +2     
==========================================
+ Hits        19625    19641      +16     
+ Misses      91137    91136       -1     
- Partials    21972    21973       +1     
Flag Coverage Δ *Carryforward flag
differential 42.11% <69.44%> (?)
total 14.77% <ø> (-0.01%) ⬇️ Carriedforward from 233f352

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

M. Fatih Cırıt and others added 5 commits March 22, 2024 00:22
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
@xmfcx xmfcx requested a review from takayuki5168 March 21, 2024 21:33
@xmfcx
Copy link
Contributor Author

xmfcx commented Mar 21, 2024

@takayuki5168 -san I think this is ready for review.

I've updated the TODO comments to help future developers to adjust the test to the fixed vehicle_cmd_gate filter.

I will now sleep, hopefully the CI passes now 💤

@xmfcx
Copy link
Contributor Author

xmfcx commented Mar 21, 2024

https://github.com/autowarefoundation/autoware.universe/actions/runs/8382024394/job/22954909850?pr=6665#step:8:441

Ok 3 also failed but 4 has passed. 4 would correspond to 30ms window. I think it should be ok.

@xmfcx
Copy link
Contributor Author

xmfcx commented Mar 25, 2024

@takayuki5168 is it ok to merge this?

Copy link
Contributor

@takayuki5168 takayuki5168 left a comment

Choose a reason for hiding this comment

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

Sorry to be late. LGTM!

@xmfcx xmfcx merged commit 93dfcbb into main Mar 26, 2024
28 of 29 checks passed
@xmfcx xmfcx deleted the fix/vehicle-cmd-gate-test branch March 26, 2024 16:05
@xmfcx xmfcx mentioned this pull request Apr 1, 2024
3 tasks
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…ng variable window length (autowarefoundation#6665)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) tag: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