From dd38c16b0b99aa291ba765ff8466f0b675692ad5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:12:19 +0000 Subject: [PATCH 1/3] Initial plan From 5a3cbf757cd9b19d5a493a7922913579e9a7a2d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:16:57 +0000 Subject: [PATCH 2/3] Add latency checker heartbeat topics to bridge configs Co-authored-by: nielmistry <10933146+nielmistry@users.noreply.github.com> --- ansible/templates/drone_bridge_config.yaml.j2 | 22 ++++++++++++++++++- ansible/templates/host_bridge_config.yaml.j2 | 21 ++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/ansible/templates/drone_bridge_config.yaml.j2 b/ansible/templates/drone_bridge_config.yaml.j2 index c831324..11a7004 100644 --- a/ansible/templates/drone_bridge_config.yaml.j2 +++ b/ansible/templates/drone_bridge_config.yaml.j2 @@ -4,4 +4,24 @@ to_domain: 0 topics: {{ns}}/mavros/state: type: mavros_msgs/msg/State - \ No newline at end of file + # Latency checker topic: drone heartbeat to host domain + {{ns}}/latency_checker/heartbeat: + type: latency_checker_ros2/msg/Heartbeat + +--- +# 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 newline at end of file diff --git a/ansible/templates/host_bridge_config.yaml.j2 b/ansible/templates/host_bridge_config.yaml.j2 index dd826e0..8c8f65f 100644 --- a/ansible/templates/host_bridge_config.yaml.j2 +++ b/ansible/templates/host_bridge_config.yaml.j2 @@ -7,4 +7,25 @@ topics: /optitrack_multiplexer_node/rigid_body/nxt{{ num }}: type: optitrack_multiplexer_ros2_msgs/msg/RigidBodyStamped to_domain: {{ num }} +{% 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 }} +{% 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 + +--- {% endfor %} \ No newline at end of file From b8aa47c4fcf7e9e3f7dec406776d9a928070842e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:12:25 +0000 Subject: [PATCH 3/3] Simplify bridge configs by consolidating latency checker topics Co-authored-by: nielmistry <10933146+nielmistry@users.noreply.github.com> --- ansible/templates/drone_bridge_config.yaml.j2 | 20 +------------------ ansible/templates/host_bridge_config.yaml.j2 | 19 +----------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/ansible/templates/drone_bridge_config.yaml.j2 b/ansible/templates/drone_bridge_config.yaml.j2 index 11a7004..c519c3b 100644 --- a/ansible/templates/drone_bridge_config.yaml.j2 +++ b/ansible/templates/drone_bridge_config.yaml.j2 @@ -6,22 +6,4 @@ topics: type: mavros_msgs/msg/State # Latency checker topic: drone heartbeat to host domain {{ns}}/latency_checker/heartbeat: - type: latency_checker_ros2/msg/Heartbeat - ---- -# 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 newline at end of file + type: latency_checker_ros2/msg/Heartbeat \ No newline at end of file diff --git a/ansible/templates/host_bridge_config.yaml.j2 b/ansible/templates/host_bridge_config.yaml.j2 index 8c8f65f..455f781 100644 --- a/ansible/templates/host_bridge_config.yaml.j2 +++ b/ansible/templates/host_bridge_config.yaml.j2 @@ -7,25 +7,8 @@ topics: /optitrack_multiplexer_node/rigid_body/nxt{{ num }}: type: optitrack_multiplexer_ros2_msgs/msg/RigidBodyStamped to_domain: {{ num }} -{% 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]+$') %} + # Latency checker topic: host heartbeat to drone domain {{ num }} /{{ host_hostname | map('regex_replace', '\\.local', '') | map('regex_replace', '-', '_') | join('') }}/latency_checker/heartbeat: type: latency_checker_ros2/msg/Heartbeat to_domain: {{ num }} -{% 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 - ---- {% endfor %} \ No newline at end of file