Commit a2a2ffd
fix(ros2_parser): strip namespace suffix instead of a fixed 5 chars
`CreateSchema()` used a hard-coded `substr(0, size - 5)` to strip
"::msg" from a message's C++ namespace to recover the package name.
That works for normal messages (`sensor_msgs::msg`) and happens to
work for services (`::srv` is also 5 chars), but it silently mangles
action-generated messages whose namespace ends in `::action` (8 chars).
For a topic like `<pkg>/action/<Action>_FeedbackMessage` the namespace
is `<pkg>::action`. Stripping exactly 5 chars from e.g.
`docking::action` (15 chars) leaves `docking::a` — exactly the
truncated package name reported in #1060. Downstream lookups then
fail with "package not found".
Replace the hard-coded strip with a suffix check over the three known
generator namespaces (`::msg`, `::srv`, `::action`). Each is stripped
by its actual length, so action feedback topics subscribe cleanly and
services stay unchanged.
Closes #1060.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9cb0b59 commit a2a2ffd
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
| |||
0 commit comments