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_topic_relay_controller): add topic relay controller node #9964

Conversation

TetsuKawa
Copy link
Contributor

@TetsuKawa TetsuKawa commented Jan 19, 2025

Description

This PR adds topic relay controller node which subscribes to a specified topic, remaps it, and republishes it. Additionally, it has the capability to continue publishing the last received value if the subscription stops.
The motivation for developing this node was to control the release of topics from the Main ECU to the Sub ECUs in a redundant system of Main ECUs and Sub ECUs.

Related links

This node requires the following msg.

How was this PR tested?

  1. build autoware
  2. cp and rebuild https://github.com/TetsuKawa/tier4_autoware_msgs/tree/feat/add-change-topic-relay-control-service and this branch.
  3. launch set

/**:
ros__parameters:
topic: "/default"
topic_type: "std_msgs/msg/String" # neccessary for /tf or /tf_static
remap_topic: "/remap_default"
#frame_id: neccessary for /tf or /tf_static
#child_frame_id: neccessary for /tf or /tf_static
qos_depth: 1
transient_local: false
best_effort: false
enable_relay_control: true
srv_name: "/system/topic_relay_controller_defalt/operate" # neccessary for enable_relay_control is true
enable_keep_publishing: false
#update_rate: #neccessary for enable_keep_publishing is true

ros2 launch autoware_topic_relay_controller topic_relay_controller.launch.xml
ros2 topic pub /default std_msgs/msg/String "{}"
ros2 topic echo /remap_default
$ ros2 service call /system/topic_relay_controller_default/operate tier4_system_msgs/srv/ChangeTopicRelayControl "{relay_on: false}"

Screencast.from.2025.01.22.21.53.33.webm

/**:
ros__parameters:
topic: "/default"
topic_type: "std_msgs/msg/String" # neccessary for /tf or /tf_static
remap_topic: "/remap_default"
#frame_id: neccessary for /tf or /tf_static
#child_frame_id: neccessary for /tf or /tf_static
qos_depth: 1
transient_local: false
best_effort: false
enable_relay_control: true
srv_name: "/system/topic_relay_controller_default/operate" # neccessary for enable_relay_control is true
enable_keep_publishing: true
update_rate: 1 #neccessary for enable_keep_publishing is true

Screencast.from.2025.01.22.21.56.53.webm

/**:
ros__parameters:
topic: "/tf"
#topic_type: "std_msgs/msg/String" neccessary for /tf or /tf_static
remap_topic: "/remap_tf"
frame_id: "parent" #neccessary for /tf or /tf_static
child_frame_id: "child" #neccessary for /tf or /tf_static
qos_depth: 1
transient_local: false
best_effort: false
enable_relay_control: true
srv_name: "/system/topic_relay_controller_default/operate" # neccessary for enable_relay_control is true
enable_keep_publishing: true
update_rate: 1 #neccessary for enable_keep_publishing is true

Screencast.from.2025.01.22.22.03.24.webm

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:system System design and integration. (auto-assigned) labels Jan 19, 2025
Copy link

github-actions bot commented Jan 19, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

@TetsuKawa TetsuKawa added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test run:clang-tidy-pr-review labels Jan 19, 2025
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

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

Project coverage is 29.11%. Comparing base (67ab350) to head (9430a16).
Report is 58 commits behind head on main.

Files with missing lines Patch % Lines
...lay_controller/src/topic_relay_controller_node.cpp 0.00% 61 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9964      +/-   ##
==========================================
- Coverage   29.13%   29.11%   -0.02%     
==========================================
  Files        1425     1426       +1     
  Lines      107853   107920      +67     
  Branches    42251    42271      +20     
==========================================
  Hits        31419    31419              
- Misses      73391    73458      +67     
  Partials     3043     3043              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 29.13% <ø> (ø) Carriedforward from e3f5d05

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

@TetsuKawa TetsuKawa requested a review from mkuri January 20, 2025 00:10
@TetsuKawa TetsuKawa self-assigned this Jan 20, 2025
@TetsuKawa TetsuKawa marked this pull request as ready for review January 20, 2025 00:13
@TetsuKawa TetsuKawa marked this pull request as draft January 20, 2025 03:25
@TetsuKawa TetsuKawa force-pushed the feat/add-topic-relay-conrtoller-node-base branch from dc51f9a to af68862 Compare January 20, 2025 03:59
TetsuKawa and others added 17 commits January 20, 2025 13:03
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
Signed-off-by: TetsuKawa <[email protected]>
@TetsuKawa TetsuKawa force-pushed the feat/add-topic-relay-conrtoller-node-base branch from af68862 to 4f353b7 Compare January 20, 2025 04:03
@TetsuKawa
Copy link
Contributor Author

TetsuKawa commented Jan 22, 2025

f8a6bb5
add config and delete unnecessary launch arg tag.
TIER IV INTERNAL

@mkuri mkuri self-requested a review January 22, 2025 14:44
Copy link
Contributor

@mkuri mkuri left a comment

Choose a reason for hiding this comment

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

LGTM

@TetsuKawa TetsuKawa merged commit 0c118ba into autowarefoundation:main Jan 22, 2025
32 of 34 checks passed
@TetsuKawa TetsuKawa deleted the feat/add-topic-relay-conrtoller-node-base branch January 22, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:system System design and integration. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) run:clang-tidy-pr-review tag:require-cuda-build-and-test type:documentation Creating or refining documentation. (auto-assigned)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants