rosotacom-dev 2.5.dev71__py3-none-any.whl → 2.5.dev73__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rosotacom/cli.py CHANGED
@@ -794,6 +794,31 @@ def _new_instance_id() -> str:
794
794
  return hashlib.sha1(seed.encode("utf-8")).hexdigest()[:8]
795
795
 
796
796
 
797
+ #: The timestamp every instance directory carries between its session slug and
798
+ #: its id: `<slug>_YYYY-MM-DD_HH-MM-SS_<id>`. Spelled out digit by digit rather
799
+ #: than left as `*`, because a session's name may be a *prefix* of another
800
+ #: session's name and `f"{slug}_*"` then collects the other session's instances
801
+ #: too. `ccng_remote_assist_*` matches every `ccng_remote_assist_kilted_dds_*`,
802
+ #: and because the matches are ordered by name, `[-1]` answers with the wrong
803
+ #: session's run whenever the longer name sorts after a digit — which `k` does.
804
+ #:
805
+ #: That is not hypothetical. On 2026-08-21 it made `rosotacom status
806
+ #: ccng_remote_assist` report a `ccng_remote_assist_kilted_dds` run that had
807
+ #: been shut down 45 minutes earlier, so three two-host runs concluded their
808
+ #: link never came up while it was in fact carrying traffic for eleven minutes.
809
+ #: Nothing in the reading said it came from another session.
810
+ _INSTANCE_STAMP_GLOB = "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]_[0-9][0-9]-[0-9][0-9]-[0-9][0-9]"
811
+
812
+
813
+ def _instance_glob(session_slug: str, instance_id: str | None = None) -> str:
814
+ """The pattern matching this session's instances, and no other session's.
815
+
816
+ With the stamp pinned, the names sort chronologically, so `sorted(...)[-1]`
817
+ is the newest instance rather than merely the last name.
818
+ """
819
+ return f"*/{session_slug}_{_INSTANCE_STAMP_GLOB}_{instance_id or '*'}"
820
+
821
+
797
822
  def _session_instances_root(runtime: RuntimeConfig) -> Path:
798
823
  return (runtime.session_instances_dir or (Path.cwd() / "session-instances")).resolve()
799
824
 
@@ -818,7 +843,7 @@ def _resolve_session_instance(
818
843
  resolved_instance_id = _safe_path_token(instance_id or _new_instance_id())
819
844
 
820
845
  if instance_id:
821
- matches = sorted(root.glob(f"*/{session_slug}_*_{resolved_instance_id}"))
846
+ matches = sorted(root.glob(_instance_glob(session_slug, resolved_instance_id)))
822
847
  if matches:
823
848
  host_dir = matches[-1].resolve()
824
849
  else:
@@ -8781,10 +8806,7 @@ def smoke(args: argparse.Namespace) -> int:
8781
8806
  def _find_latest_instance_dir(runtime: RuntimeConfig, session: ResolvedSession, instance_id: str | None) -> Path:
8782
8807
  root = _session_instances_root(runtime)
8783
8808
  session_slug = _session_instance_slug(session, runtime)
8784
- if instance_id:
8785
- pattern = f"*/{session_slug}_*_{_safe_path_token(instance_id)}"
8786
- else:
8787
- pattern = f"*/{session_slug}_*"
8809
+ pattern = _instance_glob(session_slug, _safe_path_token(instance_id) if instance_id else None)
8788
8810
  matches = sorted(p for p in root.glob(pattern) if p.is_dir())
8789
8811
  if not matches:
8790
8812
  raise RuntimeError(
@@ -47,8 +47,9 @@ template, not a replacement, and a session that does not name it is unchanged.
47
47
  </Interfaces>
48
48
  <MulticastRecvNetworkInterfaceAddresses>none</MulticastRecvNetworkInterfaceAddresses>
49
49
  <!-- Strictly below MaxMessageSize; see cyclonedds_tuned.xml for what
50
- making them equal cost. -->
51
- <FragmentSize>1024B</FragmentSize>
50
+ making them equal cost, and for why the number is settable
51
+ (`shared.rmw.<side>.cyclone.fragment_size`) rather than literal. -->
52
+ <FragmentSize>#fragment_size</FragmentSize>
52
53
  <MaxMessageSize>1200B</MaxMessageSize>
53
54
  <MaxRexmitMessageSize>1200B</MaxRexmitMessageSize>
54
55
  </General>
@@ -16,8 +16,15 @@
16
16
  sample: 1200/1200 delivers nothing on 11.0.1 and everything on
17
17
  0.10.5; 1024/1200 delivers on both. The datagram stays inside the
18
18
  same MTU budget the 1200B was chosen for; only the header room is
19
- added. -->
20
- <FragmentSize>1024B</FragmentSize>
19
+ added.
20
+
21
+ The default is that 1024B. It is a placeholder rather than a literal
22
+ because both values are correct on 0.10.5, so which one a run used is
23
+ a property of the session and not of the installed package version:
24
+ `shared.rmw.<side>.cyclone.fragment_size`. Asking for one that fills
25
+ the datagram is allowed — it is what the Kilted-era link ran — and
26
+ get_ota_xml.py says so on stderr rather than refusing. -->
27
+ <FragmentSize>#fragment_size</FragmentSize>
21
28
  <MaxMessageSize>1200B</MaxMessageSize>
22
29
  <MaxRexmitMessageSize>1200B</MaxRexmitMessageSize>
23
30
  </General>
@@ -2,8 +2,9 @@
2
2
  """Unified OTA DDS XML generator.
3
3
 
4
4
  Loads an XML template from /ws/ota_configs/<config>(.template), detects which
5
- placeholders it uses (#host_ip, #peer, #easy_mode_ip, #spdp_interval),
6
- substitutes already resolved addresses, and prints the resulting XML to stdout.
5
+ placeholders it uses (#host_ip, #peer, #easy_mode_ip, #spdp_interval,
6
+ #fragment_size), substitutes already resolved addresses, and prints the
7
+ resulting XML to stdout.
7
8
 
8
9
  Replaces the old per-template scripts (get_fastdds_xml.py,
9
10
  get_fastdds_easy_mode_xml.py, get_cyclonedds_xml.py).
@@ -28,9 +29,22 @@ KNOWN_PLACEHOLDERS = {
28
29
  #: profile and half the local one.
29
30
  "#local_domain",
30
31
  "#ota_domain",
32
+ #: How large an RTPS fragment this link sends. A template resolves it so
33
+ #: that the number is a property of the session rather than of the
34
+ #: installed package: 1024B and 1200B are both correct on CycloneDDS
35
+ #: 0.10.5, only the smaller one is correct on 11.0.1, and a run comparing
36
+ #: the two ROS distributions has to be able to say which it used.
37
+ "#fragment_size",
31
38
  }
32
39
  PLACEHOLDER_PATTERN = re.compile(r"#[A-Za-z_][A-Za-z0-9_]*")
33
40
  DEFAULT_SPDP_INTERVAL = "30s"
41
+ #: Strictly below the templates' MaxMessageSize; see cyclonedds_tuned.xml for
42
+ #: what making the two equal cost under ROS 2 Lyrical.
43
+ DEFAULT_FRAGMENT_SIZE = "1024B"
44
+
45
+ #: CycloneDDS size suffixes, and what each one is worth in bytes.
46
+ SIZE_UNITS = {"B": 1, "KB": 1000, "KIB": 1024, "MB": 1000_000, "MIB": 1024 * 1024}
47
+ SIZE_PATTERN = re.compile(r"(\d+)\s*(B|kB|KB|KiB|MB|MiB)?\Z")
34
48
 
35
49
 
36
50
  def _template_path(name: str) -> str:
@@ -86,6 +100,60 @@ def _resolved_spdp_interval(value: str) -> str:
86
100
  return interval
87
101
 
88
102
 
103
+ def _parse_size(value: str) -> int:
104
+ """A CycloneDDS size, in bytes, or None when it is not one this script wrote.
105
+
106
+ Used both to validate what a session asked for and to read the template's
107
+ own MaxMessageSize back out of the rendered XML, so the warning below can
108
+ compare the two.
109
+ """
110
+ match = SIZE_PATTERN.fullmatch(value.strip())
111
+ if not match:
112
+ return None
113
+ return int(match.group(1)) * SIZE_UNITS[(match.group(2) or "B").upper()]
114
+
115
+
116
+ def _resolved_fragment_size(value: str) -> str:
117
+ size = value.strip()
118
+ if not size:
119
+ raise ValueError("Fragment size must be a non-empty size.")
120
+ parsed = _parse_size(size)
121
+ if parsed is None:
122
+ raise ValueError("Fragment size must be a byte size, e.g. '1024B', '1200B' or '4KiB'.")
123
+ if parsed <= 0:
124
+ raise ValueError("Fragment size must be > 0.")
125
+ return size
126
+
127
+
128
+ def _warn_if_fragment_fills_the_datagram(content: str, path: str) -> None:
129
+ """Say so when the rendered profile is the one Lyrical cannot carry.
130
+
131
+ An RTPS message carries headers as well as its fragment, so a fragment of
132
+ exactly MaxMessageSize cannot be sent at all. CycloneDDS 0.10.5 coped with
133
+ that; 11.0.1 drops every fragmented sample and drops it silently, with the
134
+ endpoints matched and small samples still arriving. That combination is a
135
+ legitimate thing to ask for -- it is what the Kilted-era link ran, and
136
+ reproducing it is the reason the fragment size is settable -- so this warns
137
+ rather than refuses. Refusing would make the older profile unreachable; not
138
+ saying anything would let it be chosen by accident.
139
+ """
140
+ fragment = re.search(r"<FragmentSize>([^<]+)</FragmentSize>", content)
141
+ maximum = re.search(r"<MaxMessageSize>([^<]+)</MaxMessageSize>", content)
142
+ if not fragment or not maximum:
143
+ return
144
+ fragment_bytes = _parse_size(fragment.group(1))
145
+ maximum_bytes = _parse_size(maximum.group(1))
146
+ if fragment_bytes is None or maximum_bytes is None or fragment_bytes < maximum_bytes:
147
+ return
148
+ print(
149
+ f"WARNING - {os.path.basename(path)} renders FragmentSize {fragment.group(1)} against "
150
+ f"MaxMessageSize {maximum.group(1)}. A fragment leaves no room for the RTPS header, so "
151
+ "on CycloneDDS 11.0.1 (ROS 2 Lyrical) no fragmented sample will arrive, silently. "
152
+ "Correct on 0.10.5 (Kilted), which is what this profile reproduces.",
153
+ file=sys.stderr,
154
+ )
155
+
156
+
89
157
  def _resolve_peer_ips(value: str) -> list:
90
158
  seen = set()
91
159
  unique = []
@@ -162,6 +230,7 @@ def main(
162
230
  peer: str = None,
163
231
  easy_mode_ip: str = None,
164
232
  spdp_interval: str = DEFAULT_SPDP_INTERVAL,
233
+ fragment_size: str = DEFAULT_FRAGMENT_SIZE,
165
234
  local_domain: str = None,
166
235
  ota_domain: str = None,
167
236
  ) -> str:
@@ -195,6 +264,9 @@ def main(
195
264
  if "#spdp_interval" in found:
196
265
  content = content.replace("#spdp_interval", _resolved_spdp_interval(spdp_interval))
197
266
 
267
+ if "#fragment_size" in found:
268
+ content = content.replace("#fragment_size", _resolved_fragment_size(fragment_size))
269
+
198
270
  for placeholder, value, option in (
199
271
  ("#local_domain", local_domain, "--local-domain"),
200
272
  ("#ota_domain", ota_domain, "--ota-domain"),
@@ -211,6 +283,7 @@ def main(
211
283
  raise RuntimeError(f"Template '{os.path.basename(path)}' uses #peer but --peer was not provided.")
212
284
  content = _expand_peer_block(content, _resolve_peer_ips(peer))
213
285
 
286
+ _warn_if_fragment_fills_the_datagram(content, path)
214
287
  return content
215
288
 
216
289
 
@@ -268,6 +341,12 @@ if __name__ == "__main__":
268
341
  default=DEFAULT_SPDP_INTERVAL,
269
342
  help=f"CycloneDDS SPDP interval duration (#spdp_interval, default: {DEFAULT_SPDP_INTERVAL}).",
270
343
  )
344
+ parser.add_argument(
345
+ "--fragment-size",
346
+ dest="fragment_size",
347
+ default=DEFAULT_FRAGMENT_SIZE,
348
+ help=f"CycloneDDS RTPS fragment size (#fragment_size, default: {DEFAULT_FRAGMENT_SIZE}).",
349
+ )
271
350
  args = parser.parse_args()
272
351
  output = args.output
273
352
  rendered = main(**{k: v for k, v in vars(args).items() if v is not None and k != "output"})
@@ -7,6 +7,7 @@ parameters:
7
7
  local_config_file: ${peer_dir}/local_dds.xml # destination path for the resolved local DDS XML
8
8
  local_easy_mode_ip: # resolved address for #easy_mode_ip (only honored when the template uses it)
9
9
  local_spdp_interval: # CycloneDDS SPDP interval override, e.g. 150s. Empty => template default.
10
+ local_fragment_size: # CycloneDDS RTPS fragment size, e.g. 1200B. Empty => template default.
10
11
  use_domain_bridge: false
11
12
  local_domain_id: # pinned per-peer ROS_DOMAIN_ID (from peer_settings.<peer>.domain_id)
12
13
  ota_domain_id:
@@ -39,6 +40,7 @@ parameters:
39
40
  ota_config_file: ${peer_dir}/ota_dds.xml # destination path for the resolved DDS XML
40
41
  ota_easy_mode_ip: # resolved address for #easy_mode_ip (only honored when the template uses it)
41
42
  ota_spdp_interval: # CycloneDDS SPDP interval override, e.g. 150s. Empty => template default.
43
+ ota_fragment_size: # CycloneDDS RTPS fragment size, e.g. 1200B. Empty => template default.
42
44
  # Z2D (zenoh_ros2dds) parameters — used only when use_zenoh_ros2dds=true
43
45
  zen_mode: # e.g. router, peer or client
44
46
  zen_endpoint_role: # e.g. listen or connect
@@ -299,7 +301,7 @@ common:
299
301
  before_commands:
300
302
  - if [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ]; then export ROS_DOMAIN_ID='${local_domain_id}'; fi
301
303
  - if [ '${rmw_local}' != "None" ]; then case ${rmw_local} in cyclone) export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp;; fastdds) export RMW_IMPLEMENTATION=rmw_fastrtps_cpp; export FASTDDS_BUILTIN_TRANSPORTS=${FASTDDS_BUILTIN_TRANSPORTS:-UDPv4};; zenoh) export RMW_IMPLEMENTATION=rmw_zenoh_cpp;; *) export RMW_IMPLEMENTATION='${rmw_local}';; esac; fi
302
- - if [ '${local_config_template}' != "None" ] && [ -n '${local_config_template}' ]; then local_args=(--config "${local_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && local_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && local_args+=(--ota-domain "${ota_domain_id}"); [ '${local_easy_mode_ip}' != "None" ] && [ -n '${local_easy_mode_ip}' ] && local_args+=(--easy-mode-ip "${local_easy_mode_ip}"); [ '${local_spdp_interval}' != "None" ] && [ -n '${local_spdp_interval}' ] && local_args+=(--spdp-interval "${local_spdp_interval}"); python3 /ws/ota_configs/get_ota_xml.py "${local_args[@]}" --output "${local_config_file}" || { echo "FATAL - could not render the local DDS profile ${local_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_local} in cyclone) export CYCLONEDDS_URI="file://${local_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${local_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
304
+ - if [ '${local_config_template}' != "None" ] && [ -n '${local_config_template}' ]; then local_args=(--config "${local_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && local_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && local_args+=(--ota-domain "${ota_domain_id}"); [ '${local_easy_mode_ip}' != "None" ] && [ -n '${local_easy_mode_ip}' ] && local_args+=(--easy-mode-ip "${local_easy_mode_ip}"); [ '${local_spdp_interval}' != "None" ] && [ -n '${local_spdp_interval}' ] && local_args+=(--spdp-interval "${local_spdp_interval}"); [ '${local_fragment_size}' != "None" ] && [ -n '${local_fragment_size}' ] && local_args+=(--fragment-size "${local_fragment_size}"); python3 /ws/ota_configs/get_ota_xml.py "${local_args[@]}" --output "${local_config_file}" || { echo "FATAL - could not render the local DDS profile ${local_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_local} in cyclone) export CYCLONEDDS_URI="file://${local_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${local_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
303
305
  - if [ '${before_command}' != "None" ]; then ${before_command}; fi
304
306
 
305
307
  windows:
@@ -345,7 +347,7 @@ windows:
345
347
  if: use_domain_bridge
346
348
  splits:
347
349
  - commands:
348
- - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
350
+ - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); [ '${ota_fragment_size}' != "None" ] && [ -n '${ota_fragment_size}' ] && ota_args+=(--fragment-size "${ota_fragment_size}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
349
351
  - ros2 run domain_bridge domain_bridge --wait-for-publisher false ${domain_bridge_config_file}
350
352
  - name: IN
351
353
  if: in
@@ -353,7 +355,7 @@ windows:
353
355
  - commands:
354
356
  - if [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ]; then export ROS_DOMAIN_ID='${ota_domain_id}'; fi
355
357
  - case ${rmw_ota} in cyclone) export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp;; fastdds) export RMW_IMPLEMENTATION=rmw_fastrtps_cpp; export FASTDDS_BUILTIN_TRANSPORTS=${FASTDDS_BUILTIN_TRANSPORTS:-UDPv4};; zenoh) export RMW_IMPLEMENTATION=rmw_zenoh_cpp;; esac
356
- - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
358
+ - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); [ '${ota_fragment_size}' != "None" ] && [ -n '${ota_fragment_size}' ] && ota_args+=(--fragment-size "${ota_fragment_size}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
357
359
  # For zenoh_ros2dds the OTA domain is loopback-only (zenoh is the inter-host
358
360
  # transport), so confine discovery to localhost instead of statically peering
359
361
  # the remote host — otherwise the OTA-domain DDS double-delivers alongside zenoh.
@@ -380,7 +382,7 @@ windows:
380
382
  - commands:
381
383
  - if [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ]; then export ROS_DOMAIN_ID='${ota_domain_id}'; fi
382
384
  - case ${rmw_ota} in cyclone) export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp;; fastdds) export RMW_IMPLEMENTATION=rmw_fastrtps_cpp; export FASTDDS_BUILTIN_TRANSPORTS=${FASTDDS_BUILTIN_TRANSPORTS:-UDPv4};; zenoh) export RMW_IMPLEMENTATION=rmw_zenoh_cpp;; esac
383
- - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
385
+ - if [ '${ota_config_template}' != "None" ] && [ -n '${ota_config_template}' ]; then ota_args=(--config "${ota_config_template}" --host-ip "${ip_local}" --peer "${ip_remote}"); [ '${local_domain_id}' != "None" ] && [ -n '${local_domain_id}' ] && ota_args+=(--local-domain "${local_domain_id}"); [ '${ota_domain_id}' != "None" ] && [ -n '${ota_domain_id}' ] && ota_args+=(--ota-domain "${ota_domain_id}"); [ '${ota_easy_mode_ip}' != "None" ] && [ -n '${ota_easy_mode_ip}' ] && ota_args+=(--easy-mode-ip "${ota_easy_mode_ip}"); [ '${ota_spdp_interval}' != "None" ] && [ -n '${ota_spdp_interval}' ] && ota_args+=(--spdp-interval "${ota_spdp_interval}"); [ '${ota_fragment_size}' != "None" ] && [ -n '${ota_fragment_size}' ] && ota_args+=(--fragment-size "${ota_fragment_size}"); python3 /ws/ota_configs/get_ota_xml.py "${ota_args[@]}" --output "${ota_config_file}" || { echo "FATAL - could not render the OTA DDS profile ${ota_config_template}; refusing to start on defaults." >&2; exit 1; }; case ${rmw_ota} in cyclone) export CYCLONEDDS_URI="file://${ota_config_file}";; fastdds) export FASTDDS_DEFAULT_PROFILES_FILE="${ota_config_file}"; export RMW_FASTRTPS_USE_QOS_FROM_XML=1;; esac; fi
384
386
  # For zenoh_ros2dds the OTA domain is loopback-only (zenoh is the inter-host
385
387
  # transport), so confine discovery to localhost instead of statically peering
386
388
  # the remote host — otherwise the OTA-domain DDS double-delivers alongside zenoh.
@@ -194,7 +194,8 @@ class YamlBlockScalar:
194
194
  # - a string: cyclone | fastdds | zenoh_connect_endpoints | zenoh_ros2dds | <raw rmw string>
195
195
  # (zenoh_ros2dds is allowed for ota only; raw rmw strings are for local only)
196
196
  # - a tagged-union mapping with exactly one key (the RMW name):
197
- # {cyclone: {config?: <fname.xml>, easy_mode_ip?: <address>, spdp_interval?: <duration>}}
197
+ # {cyclone: {config?: <fname.xml>, easy_mode_ip?: <address>, spdp_interval?: <duration>,
198
+ # fragment_size?: <size, e.g. 1200B>}}
198
199
  # {fastdds: {config?: <fname.xml>, easy_mode_ip?: <address>}}
199
200
  # {zenoh_connect_endpoints: {transport?: tcp|udp, main_peer?: <peer_key>, main_port?: 7447}}
200
201
  # {zenoh_ros2dds: {transport?: udp|tcp, main_peer?: <peer_key>, main_port?: 7447}}
@@ -207,7 +208,11 @@ _OTA_SHORTS = {"cyclone", "fastdds", *_NATIVE_ZENOH_OTA_SHORTS, "zenoh_ros2dds"}
207
208
  _LOCAL_SHORTS = {"cyclone", "fastdds", "zenoh"}
208
209
  _SHORTCUT_ALLOWED = {"cyclone", "fastdds", "zenoh"}
209
210
 
210
- _DDS_CFG_KEYS = {"config", "easy_mode_ip", "spdp_interval"}
211
+ _DDS_CFG_KEYS = {"config", "easy_mode_ip", "spdp_interval", "fragment_size"}
212
+ #: A CycloneDDS size: digits and an optional unit. Validated here so an
213
+ #: unusable value is a session error rather than a profile the DDS stack
214
+ #: silently ignores on its way to defaults.
215
+ _DDS_SIZE_RE = re.compile(r"(\d+)\s*(B|kB|KB|KiB|MB|MiB)?\Z")
211
216
  _ZEN_OTA_CFG_KEYS = {"transport", "main_peer", "main_port"}
212
217
  #: Inter-host transports the native zenoh router may be pointed at. Both are
213
218
  #: plain zenoh locator schemes; tls/quic would additionally need certificates
@@ -280,6 +285,7 @@ class RmwSideSpec:
280
285
  dds_config: Optional[str] = None
281
286
  dds_easy_mode_ip: Optional[str] = None
282
287
  dds_spdp_interval: Optional[str] = None
288
+ dds_fragment_size: Optional[str] = None
283
289
  # zenoh (native) and zenoh_ros2dds
284
290
  zen_main_peer: Optional[str] = None
285
291
  zen_transport: Optional[str] = None
@@ -345,6 +351,19 @@ def _parse_rmw_side(value: Any, ctx: str, *, is_local: bool) -> RmwSideSpec:
345
351
  raise RuntimeError(f"{ctx}.{impl}.spdp_interval must be a non-empty duration if provided.")
346
352
  _validate_positive_seconds(cfg["spdp_interval"], f"{ctx}.{impl}.spdp_interval")
347
353
  spec.dds_spdp_interval = cfg["spdp_interval"].strip()
354
+ if cfg.get("fragment_size") is not None:
355
+ if impl != "cyclone":
356
+ raise RuntimeError(f"{ctx}.{impl}.fragment_size is only supported for CycloneDDS.")
357
+ if not isinstance(cfg["fragment_size"], str) or not cfg["fragment_size"].strip():
358
+ raise RuntimeError(f"{ctx}.{impl}.fragment_size must be a non-empty size if provided.")
359
+ size = cfg["fragment_size"].strip()
360
+ match = _DDS_SIZE_RE.fullmatch(size)
361
+ if not match or int(match.group(1)) <= 0:
362
+ raise RuntimeError(
363
+ f"{ctx}.{impl}.fragment_size must be a positive byte size, e.g. '1024B' or '1200B'; "
364
+ f"got {cfg['fragment_size']!r}."
365
+ )
366
+ spec.dds_fragment_size = size
348
367
  elif _is_native_zenoh_ota(impl):
349
368
  extra = set(cfg.keys()) - _ZEN_OTA_CFG_KEYS
350
369
  if extra:
@@ -2279,6 +2298,8 @@ def func(
2279
2298
  )
2280
2299
  if side.impl == "cyclone" and side.dds_spdp_interval:
2281
2300
  items.append(("local_spdp_interval", side.dds_spdp_interval))
2301
+ if side.impl == "cyclone" and side.dds_fragment_size:
2302
+ items.append(("local_fragment_size", side.dds_fragment_size))
2282
2303
  return items
2283
2304
 
2284
2305
  def _build_ota_rmw_items() -> List[Tuple[str, Any]]:
@@ -2306,6 +2327,8 @@ def func(
2306
2327
  )
2307
2328
  if ota.impl == "cyclone" and ota.dds_spdp_interval:
2308
2329
  items.append(("ota_spdp_interval", ota.dds_spdp_interval))
2330
+ if ota.impl == "cyclone" and ota.dds_fragment_size:
2331
+ items.append(("ota_fragment_size", ota.dds_fragment_size))
2309
2332
  return items
2310
2333
 
2311
2334
  def _build_zenoh_block(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rosotacom-dev
3
- Version: 2.5.dev71
3
+ Version: 2.5.dev73
4
4
  Summary: Host CLI for ROS OTA communication sessions.
5
5
  Author: develNor
6
6
  License-Expression: BSD-3-Clause
@@ -6,7 +6,7 @@ rosotacom/benched_set.py,sha256=lBA1Rj04dbr2e-lIvYTWoL55_LdUpCAC-y7eIvJZ8lc,2721
6
6
  rosotacom/benchmark.py,sha256=3QoXJtWUGQPwvDWyQT_fOjx6K9G2pmvtnVurA21G2QY,76612
7
7
  rosotacom/benchmark_delta.py,sha256=qXzriBkbXOeJdlLKM4ziov1F-JfwlseYHE48S9hjFsQ,10005
8
8
  rosotacom/bundle_check.py,sha256=l_3BSuYk6juXQmsNU6jkxRbH8ayH2GkiW9ONKMQ1oJY,18270
9
- rosotacom/cli.py,sha256=RAe1VAlQorfvV9nQCeK_YUBr4CFrEacRzgNi3MmaL4s,436666
9
+ rosotacom/cli.py,sha256=WOl0PLl-tEu28ahHh9HIpu-hmNlD4WcH2b45HzoqMJg,438036
10
10
  rosotacom/cli_benchmark.py,sha256=yL5izp7_Y_ngGsx5R8yN2lSUe_Y5qxBYiMArDx4ms5I,355085
11
11
  rosotacom/deployment.py,sha256=XVhB8JjxhAsglSEEPtiVSeV6fCG0rgGmDRulh14oIYQ,7318
12
12
  rosotacom/ffmpeg_packet.py,sha256=zB1BHgY1kexr5sETVMkm4bkVnRytj9k2t0uOYiHUZ6M,4267
@@ -113,13 +113,13 @@ rosotacom/resources/ws/.vscode/settings.json,sha256=xNEQ9qGmUhxkLXYDJj4QVt4l3Btg
113
113
  rosotacom/resources/ws/ota_configs/create_zenoh_json5.py,sha256=um2xU1SfNVo_FvlS8iYeAauu67I1N1Z8x-Ckw7KUAAk,2356
114
114
  rosotacom/resources/ws/ota_configs/cyclonedds_local_participants.xml.template,sha256=_PAy5sj9_pk2If7xQ_iHF2Oi1tC6HaZe3dDyl8fRSoo,1708
115
115
  rosotacom/resources/ws/ota_configs/cyclonedds_minimal.xml.template,sha256=YspSB4xbk2C_CODoowBQUkqsehdGYEd9I0YCjdGN1dc,197
116
- rosotacom/resources/ws/ota_configs/cyclonedds_scoped.xml.template,sha256=tjHTn2SSaCgPT_3JRTuievvu7rV8nJoYGChPo-kUtOM,3532
117
- rosotacom/resources/ws/ota_configs/cyclonedds_tuned.xml.template,sha256=e6XmnP3WpqxCc_las62SIB9yUuCYZQ4Zxc3KMk6g0a8,2027
116
+ rosotacom/resources/ws/ota_configs/cyclonedds_scoped.xml.template,sha256=D7QsPakTN8lybexP4vMig0njWVrKsCL5iO53se9NGNs,3652
117
+ rosotacom/resources/ws/ota_configs/cyclonedds_tuned.xml.template,sha256=RSxXFCENHWUv1sSX7Ezmqsuff0UVC9nBdTWfRNXPIDQ,2541
118
118
  rosotacom/resources/ws/ota_configs/fastdds_easy_mode.xml.template,sha256=NsQfwrf2JoqKaD0j_cEp2LCLNsRcdjKoReuQ_ow9Txk,2037
119
119
  rosotacom/resources/ws/ota_configs/fastdds_local.xml.template,sha256=KhLMd_vYe8o_sb5WqBNDNvdsFDJ1BmHwmpLpJ9WginY,3326
120
120
  rosotacom/resources/ws/ota_configs/fastdds_tuned.xml.template,sha256=pl8dskuk4cBRU4t9fhyA4ZyeQ-KpcWRhHTsm2Gn4TSc,6504
121
121
  rosotacom/resources/ws/ota_configs/fastdds_unicast.xml.template,sha256=NZGt5mP9IWBk0drx0FOLCuySTamvQ9s8B5gPjHJbtG4,3838
122
- rosotacom/resources/ws/ota_configs/get_ota_xml.py,sha256=jzVchlCFah2wkia5nTtYDYOM4slt9XzpaPW3-IaSWyA,10625
122
+ rosotacom/resources/ws/ota_configs/get_ota_xml.py,sha256=2ypQd55DBVIGrZhqVXucJD6wg-rvibjzpQvP6_LzIdc,14318
123
123
  rosotacom/resources/ws/ota_configs/utils.py,sha256=HS-n4AUGFEVd1YmIjFUjD0TMI22M6PUMKaTac30qfd4,3109
124
124
  rosotacom/resources/ws/ota_configs/zenoh.json5.template,sha256=XDsugd411skY6lepBq5DoNIWcw8cpY922ZgfR3DOLvA,798
125
125
  rosotacom/resources/ws/ota_configs/archive/fastdds_easy_mode.xml.template,sha256=UNpcu-JTIvNBR5AfE4ILwXCdWVdwtF22zsttjUdg4eY,1350
@@ -195,19 +195,19 @@ rosotacom/resources/ws/ros2src/com_py/resource/com_py,sha256=47DEQpj8HBSa-_TImW-
195
195
  rosotacom/resources/ws/ros2src/com_py/test/test_copyright.py,sha256=6nG7vGJHtcFNF27QnznuJ01WPMmy7DVYKOpFHO_zF1c,962
196
196
  rosotacom/resources/ws/ros2src/com_py/test/test_flake8.py,sha256=N6gToFB_DOUaLQtXMS0swHigMHo8qFWA6oAbDS-XVdI,884
197
197
  rosotacom/resources/ws/ros2src/com_py/test/test_pep257.py,sha256=6LiNSe4paYextABp-BAZtfoJsaob_umh-q5Fu1z1Pto,803
198
- rosotacom/resources/ws/session/content/base/session_plugin_base.yaml,sha256=uCO6m1cPW9LLxzrnTFmOsLIGijqT24OCQiHx6qjqpUU,51101
198
+ rosotacom/resources/ws/session/content/base/session_plugin_base.yaml,sha256=zDScMC4j_pSDErHzKqUOKm2FEqcZeyBZHKYRNc7KD30,51797
199
199
  rosotacom/resources/ws/session/content/network/up_connectivity.py,sha256=-a6E97Uw159DfRXxYA0MBWRUPA6mQhuAA7pSjASM9qU,13593
200
200
  rosotacom/resources/ws/session/content/network/wifi_network_analysis_2.py,sha256=UVRtGdbHYayXM0OFkXs2BV2lW0CsY0m_NTlbPO1J9oE,8682
201
201
  rosotacom/resources/ws/session/creation/anonymize_bag.py,sha256=jxOTKFjmde-pyoVWE9-9icpSjf4nh97-q2Eqx-BDUl8,6154
202
202
  rosotacom/resources/ws/session/creation/catmux_log_setup.sh,sha256=VyBAFqmhQcIziSnDCRDNUsT5QpbLzKWU-DqRzaj_WQs,5243
203
203
  rosotacom/resources/ws/session/creation/create_session_yaml.py,sha256=8cfzkUxK7IebIBC36Vu7lcWtogM8fG0zveBCUGeiVdU,5727
204
- rosotacom/resources/ws/session/creation/generate_session_files.py,sha256=eosnUYSwVzkaP_Bra5CStJ6qt9sduqhRNmUudXwlFLo,161258
204
+ rosotacom/resources/ws/session/creation/generate_session_files.py,sha256=3Sx4xTSuVKLhJpOCpU5gfvFEjjpU0hrWzcFAoO0xIMs,162694
205
205
  rosotacom/resources/ws/session/creation/run_session.py,sha256=G2hJhrmLp11gm3JZ6_C-zZcqu_reXlE_wmobB7BiCfU,16849
206
206
  rosotacom/resources/ws/session/creation/run_session_in_external_terminal.py,sha256=Ub_5f-ttUUc-rAPrZmg_Op34s8Z4C91hTyEn8fgyt-E,2633
207
207
  rosotacom/resources/ws/session/creation/strip_ansi.py,sha256=vNjpemcq4xHr0VG4x0bZqvgwEBEfOgN-b4PzbrM5nfM,851
208
- rosotacom_dev-2.5.dev71.dist-info/licenses/LICENSE.txt,sha256=FDB3-fao3lqZ94wsJHKAH7U88kAnfvZhZC8Hm5rN__g,1459
209
- rosotacom_dev-2.5.dev71.dist-info/METADATA,sha256=B8G12zJU_JgUUz3rhkwFvDZUy4GMVR0pd5nSX6bB9fw,58884
210
- rosotacom_dev-2.5.dev71.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
211
- rosotacom_dev-2.5.dev71.dist-info/entry_points.txt,sha256=im11ZWqBbgjQUBz2Ik2RNfMu54wlMwgiVpsBKeI7dCI,49
212
- rosotacom_dev-2.5.dev71.dist-info/top_level.txt,sha256=BZrtQcIVDWn_pQZR3Mlssqy5SaRXHjOa6B-1D9Fy4Ao,10
213
- rosotacom_dev-2.5.dev71.dist-info/RECORD,,
208
+ rosotacom_dev-2.5.dev73.dist-info/licenses/LICENSE.txt,sha256=FDB3-fao3lqZ94wsJHKAH7U88kAnfvZhZC8Hm5rN__g,1459
209
+ rosotacom_dev-2.5.dev73.dist-info/METADATA,sha256=Waeqm5ydlo3j0N--3kXVQXNF1QHPikSLYu3Y_dnQ9k0,58884
210
+ rosotacom_dev-2.5.dev73.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
211
+ rosotacom_dev-2.5.dev73.dist-info/entry_points.txt,sha256=im11ZWqBbgjQUBz2Ik2RNfMu54wlMwgiVpsBKeI7dCI,49
212
+ rosotacom_dev-2.5.dev73.dist-info/top_level.txt,sha256=BZrtQcIVDWn_pQZR3Mlssqy5SaRXHjOa6B-1D9Fy4Ao,10
213
+ rosotacom_dev-2.5.dev73.dist-info/RECORD,,