-
Notifications
You must be signed in to change notification settings - Fork 1
Add latency checker heartbeat topics to domain bridge configurations #13
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
base: niel/rearch-august
Are you sure you want to change the base?
Add latency checker heartbeat topics to domain bridge configurations #13
Conversation
Co-authored-by: nielmistry <10933146+nielmistry@users.noreply.github.com>
nielmistry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| --- | ||
| # Bridge topics from host domain 0 to this drone domain | ||
| name: host_to_drone_bridge | ||
| from_domain: 0 | ||
| to_domain: {{ drone_num }} | ||
| topics: | ||
| # Host latency checker heartbeat to drone | ||
| /{{ host_hostname | map('regex_replace', '\\.local', '') | map('regex_replace', '-', '_') | join('') }}/latency_checker/heartbeat: | ||
| type: latency_checker_ros2/msg/Heartbeat | ||
| # Other drones' latency checker heartbeats to this drone | ||
| {% for peer in groups['drones'] %} | ||
| {% set peer_num = peer | regex_replace('\\.local', '') | regex_search('[0-9]+$') %} | ||
| {% if peer_num != drone_num %} | ||
| /nxt{{ peer_num }}/latency_checker/heartbeat: | ||
| type: latency_checker_ros2/msg/Heartbeat | ||
| {% endif %} | ||
| {% endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| --- | |
| # Bridge topics from host domain 0 to this drone domain | |
| name: host_to_drone_bridge | |
| from_domain: 0 | |
| to_domain: {{ drone_num }} | |
| topics: | |
| # Host latency checker heartbeat to drone | |
| /{{ host_hostname | map('regex_replace', '\\.local', '') | map('regex_replace', '-', '_') | join('') }}/latency_checker/heartbeat: | |
| type: latency_checker_ros2/msg/Heartbeat | |
| # Other drones' latency checker heartbeats to this drone | |
| {% for peer in groups['drones'] %} | |
| {% set peer_num = peer | regex_replace('\\.local', '') | regex_search('[0-9]+$') %} | |
| {% if peer_num != drone_num %} | |
| /nxt{{ peer_num }}/latency_checker/heartbeat: | |
| type: latency_checker_ros2/msg/Heartbeat | |
| {% endif %} | |
| {% endfor %} |
no need to have this here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unnecessary second bridge configuration from drone bridge config. Now only bridges drone's own topics from drone domain to host domain 0. (b8aa47c)
| {% endfor %} | ||
| # Latency checker topics: host heartbeat to all drone domains | ||
| {% for drone in groups['drones'] %} | ||
| {% set num = drone | regex_replace('\\.local', '') | regex_search('[0-9]+$') %} | ||
| /{{ host_hostname | map('regex_replace', '\\.local', '') | map('regex_replace', '-', '_') | join('') }}/latency_checker/heartbeat: | ||
| type: latency_checker_ros2/msg/Heartbeat | ||
| to_domain: {{ num }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't have to make a whole new for block. its the same as the above so just roll it in!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consolidated the latency checker topics into the existing for loop alongside the optitrack topics. Now both topics are bridged together for each drone domain. (b8aa47c)
| {% endfor %} | ||
|
|
||
| --- | ||
| # Bridge drone latency checker heartbeats from each drone domain to host domain 0 | ||
| {% for drone in groups['drones'] %} | ||
| {% set num = drone | regex_replace('\\.local', '') | regex_search('[0-9]+$') %} | ||
| name: drone{{ num }}_to_host_bridge | ||
| from_domain: {{ num }} | ||
| to_domain: 0 | ||
| topics: | ||
| /nxt{{ num }}/latency_checker/heartbeat: | ||
| type: latency_checker_ros2/msg/Heartbeat | ||
|
|
||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unnecessary additional bridge configurations. The latency checker topics are now handled within the existing single bridge configuration. (b8aa47c)
Co-authored-by: nielmistry <10933146+nielmistry@users.noreply.github.com>
This PR adds the necessary topic bridging configuration to enable the latency checker nodes to communicate across ROS 2 domains in the swarm system.
Problem
The latency checker nodes publish and subscribe to heartbeat topics to measure network latency between peers (host and drones). However, these topics were not configured in the domain bridge configurations, preventing cross-domain communication between:
Solution
Added latency checker heartbeat topic bridging to both bridge configuration templates:
Host Bridge Config (
host_bridge_config.yaml.j2)Drone Bridge Config (
drone_bridge_config.yaml.j2)Topic Pattern
The latency checker uses the following topic naming convention:
/{namespace}/latency_checker/heartbeatlatency_checker_ros2/msg/HeartbeatWhere
{namespace}is:.localremoved and-replaced with_nxt{N}where N is the drone numberBridge Flow
This enables full peer-to-peer latency monitoring between the host and all drones through the existing domain bridge infrastructure.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.