Skip to content

Commit 5e993fa

Browse files
committed
fix: update README.md and improve XML file naming in system config generator
- Updated the README.md to reflect the correct script path for generating launch XML files. - Enhanced the XML file naming convention in `serialization.py` to use a slugified format based on entity attributes, improving file organization and clarity. These changes enhance documentation accuracy and improve the output structure of generated XML files. Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent fda3812 commit 5e993fa

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

tools/system-config-generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ python3 generate_system_config.py \
9393

9494
### Option B — From a pre-generated launch XML
9595

96-
If you already have a `generated.launch.xml` from a previous run or from the standalone `run_launch_unifier.py`:
96+
If you already have a `generated.launch.xml` from a previous run or from the standalone `scripts/unify_launch.py`:
9797

9898
```bash
9999
python3 generate_system_config.py \
@@ -108,7 +108,7 @@ python3 generate_system_config.py \
108108
To produce only the flattened XML without generating configs:
109109

110110
```bash
111-
python3 run_launch_unifier.py \
111+
python3 scripts/unify_launch.py \
112112
--launch-package autoware_launch \
113113
--launch-file autoware.launch.xml \
114114
vehicle_model:=$VEHICLE_MODEL \

tools/system-config-generator/launch_unifier/serialization.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ def _make_entity_serializable(
106106
xml_content = value
107107
dest_dir = output_dir if output_dir is not None else pathlib.Path("output")
108108
dest_dir.mkdir(parents=True, exist_ok=True)
109-
xml_file_path = dest_dir / "xml_file.xml"
109+
slug = re.sub(
110+
r"[^a-zA-Z0-9_-]+",
111+
"_",
112+
f"{entity.final_attributes.node_namespace}_{entity.final_attributes.node_name}_{key}",
113+
).strip("_")
114+
xml_file_path = dest_dir / f"{slug}.xml"
110115

111116
xml_file_path.write_text(xml_content)
112117

tools/topology-analyzer/lib/matching.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
signature_id,
1414
)
1515

16-
_RENAME_SIM_THRESHOLD = 0.70
17-
_RENAME_SIM_MARGIN = 0.12
18-
19-
2016
def normalized_signature(node: Dict, *, ignored_topics: Set[str] = frozenset()) -> Signature:
2117
"""Name-insensitive signature: compare by endpoint basename + type list."""
2218

tools/topology-analyzer/lib/render.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# write_report handles file I/O; pass '-' as out_path to write to stdout.
55

66
import os
7+
import re
78
import sys
89
from collections import defaultdict
910
from typing import Dict, List, Optional, Set, Tuple
@@ -223,6 +224,9 @@ def render_single(
223224
lines.append("")
224225

225226
lines.append("## Topic Index (publishers/subscribers counts)\n")
227+
if topic_focus is not None:
228+
lines.append(f"- Filter: topic regex '{topic_focus}'")
229+
t_idx = {tp: ps for tp, ps in t_idx.items() if re.search(topic_focus, tp)}
226230
for tp, ps in sorted(t_idx.items()):
227231
pubs = ps.get("publishers", [])
228232
subs = ps.get("subscribers", [])

0 commit comments

Comments
 (0)