fix(ros2_parser): strip namespace suffix instead of a fixed 5 chars#117
Open
Alvvalencia wants to merge 1 commit intoPlotJuggler:mainfrom
Open
fix(ros2_parser): strip namespace suffix instead of a fixed 5 chars#117Alvvalencia wants to merge 1 commit intoPlotJuggler:mainfrom
Alvvalencia wants to merge 1 commit intoPlotJuggler:mainfrom
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1060.
CreateSchema()stripped a hard-coded 5 chars to remove"::msg"from amessage's C++ namespace. That works for
::msgand (by coincidence)::srv,but mangles action-generated messages whose namespace ends in
::action(8 chars): e.g.
docking::actionbecamedocking::a, and downstream lookupsfailed with "package not found".
Replace the fixed strip with a suffix check over the three generator
namespaces (
::msg,::srv,::action), each stripped by its actual length.Action feedback topics now subscribe cleanly; services unchanged.