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

feat(autoware_vehicle_cmd_gate): accept same topic unless mode change occurs #8479

Conversation

shtokuda
Copy link
Contributor

@shtokuda shtokuda commented Aug 15, 2024

Description

In this PR, we check the timestamp of input topics to avoid using old topics. However, if the timer callback function of vehicle_cmd_gate has higher rate than subscribed topics, the callback function subscribes same topic and shows debug message.
I think it's ok to subscribe same topic if there is no mode change and make this PR.
In addition, not all topics should be published after mode change, such as warning light. I modified getContinuousTopic function to select whether to show debug message for each topic.

Related links

#8084

Tests performed

Notes for reviewers

By accepting the same topics, it is not possible to check if the topics is updated within the same mode, but this is not a problem because other functions monitor rate drops

Interface changes

None

ROS Topic Changes

ROS Parameter Changes

Effects on system behavior

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

shtokuda and others added 26 commits July 17, 2024 19:32
Signed-off-by: shtokuda <[email protected]>
Signed-off-by: shtokuda <[email protected]>
…ontinuity of topics


Signed-off-by: shtokuda <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Aug 15, 2024
Copy link

github-actions bot commented Aug 15, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

Copy link
Contributor

@yuki-takagi-66 yuki-takagi-66 left a comment

Choose a reason for hiding this comment

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

LGTM Thank you

@shtokuda shtokuda enabled auto-merge (squash) August 15, 2024 08:53
@tkimura4 tkimura4 added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

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

Project coverage is 23.87%. Comparing base (a612530) to head (9b6b2ac).
Report is 2 commits behind head on main.

Files Patch % Lines
...autoware_vehicle_cmd_gate/src/vehicle_cmd_gate.cpp 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8479   +/-   ##
=======================================
  Coverage   23.86%   23.87%           
=======================================
  Files        1380     1384    +4     
  Lines      101866   101910   +44     
  Branches    38798    38800    +2     
=======================================
+ Hits        24314    24327   +13     
- Misses      75120    75153   +33     
+ Partials     2432     2430    -2     
Flag Coverage Δ *Carryforward flag
differential 12.01% <0.00%> (?)
total 23.86% <ø> (+<0.01%) ⬆️ Carriedforward from a612530

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

@shtokuda shtokuda merged commit 8e8e19e into autowarefoundation:main Aug 16, 2024
29 of 30 checks passed
@shtokuda shtokuda deleted the feat/vehicle_cmd_gate_check_cmd_continuity branch August 16, 2024 01:31
shtokuda added a commit to tier4/autoware.universe that referenced this pull request Aug 21, 2024
… occurs (autowarefoundation#8479)

* add prev_commands_ and check cmd's time stamp

Signed-off-by: shtokuda <[email protected]>

* add timestamp when is_engaged is false

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* add initialization for hazard_light timestamp in Commands

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* update README.md

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* fix typo

Signed-off-by: shtokuda <[email protected]>

* fix(autoware_vehicle_cmd_gate): rename the function that checks the continuity of topics

Signed-off-by: shtokuda <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>

* style(pre-commit): autofix

* feat(autoware_vehicle_cmd_gate): check continuity using shared_ptr

Signed-off-by: shtokuda <[email protected]>

* feat(autoware_vehicle_cmd_gate): add INFO message for topics  that are not receiving

Signed-off-by: shtokuda <[email protected]>

* fix template function to pass build-and-test-differential

Signed-off-by: shtokuda <[email protected]>

* fix(autoware_vehicle_cmd_gate): add #include <string>  according to pre-commit.ci

Signed-off-by: shtokuda <[email protected]>

* fix(vehicle_cmd_gate) add underscores to member variable names for consistency

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* feat(vehicle_cmd_gate): accept same topic unless mode change occurs

Signed-off-by: shtokuda <[email protected]>

* feat(vehicle_cmd_gate): add default topic_name to getContinuousTopic function

Signed-off-by: shtokuda <[email protected]>

---------

Signed-off-by: shtokuda <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Takamasa Horibe <[email protected]>
Co-authored-by: Shumpei Wakabayashi <[email protected]>
shmpwk added a commit to tier4/autoware.universe that referenced this pull request Aug 23, 2024
… occurs (autowarefoundation#8479)

* add prev_commands_ and check cmd's time stamp

Signed-off-by: shtokuda <[email protected]>

* add timestamp when is_engaged is false

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* add initialization for hazard_light timestamp in Commands

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* update README.md

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* fix typo

Signed-off-by: shtokuda <[email protected]>

* fix(autoware_vehicle_cmd_gate): rename the function that checks the continuity of topics

Signed-off-by: shtokuda <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>

* style(pre-commit): autofix

* feat(autoware_vehicle_cmd_gate): check continuity using shared_ptr

Signed-off-by: shtokuda <[email protected]>

* feat(autoware_vehicle_cmd_gate): add INFO message for topics  that are not receiving

Signed-off-by: shtokuda <[email protected]>

* fix template function to pass build-and-test-differential

Signed-off-by: shtokuda <[email protected]>

* fix(autoware_vehicle_cmd_gate): add #include <string>  according to pre-commit.ci

Signed-off-by: shtokuda <[email protected]>

* fix(vehicle_cmd_gate) add underscores to member variable names for consistency

Signed-off-by: shtokuda <[email protected]>

* style(pre-commit): autofix

* feat(vehicle_cmd_gate): accept same topic unless mode change occurs

Signed-off-by: shtokuda <[email protected]>

* feat(vehicle_cmd_gate): add default topic_name to getContinuousTopic function

Signed-off-by: shtokuda <[email protected]>

---------

Signed-off-by: shtokuda <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Takamasa Horibe <[email protected]>
Co-authored-by: Shumpei Wakabayashi <[email protected]>
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.

4 participants