Add a default for touch plugin namespace#3513
Add a default for touch plugin namespace#3513luca-della-vedova wants to merge 4 commits intogazebosim:mainfrom
Conversation
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
|
Github won't let me comment on the line, so I'm posting here instead. On |
|
I think there's an edge case that if the model has 2 touch plugins, e.g. here, the topic names will collide? |
Indeed! I don't have a very good solution, my suggestion would be to use nested models so the automatic namespacing computation still works. For example in that case we could have a
I don't like option 2 since it's a quite obscure and brittle behavior, option 3 would be nice but breaking since it's a message type change, that leaves us with a new parameter (option 1) or just accepting that users will have to do the nested model workaround (option 0) |
|
hmm ok I think I prefer option 0 compared to adding another new param. We could just add to the doc in the header to warn that if more than one touch plugins are used, the auto-generated namespaces will conflict, and propose to them to either use the nested model workaround you described or just fill the |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
|
Added both the logging and the note in the header in f44c42f |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
|
With the recommendation of using the nested model approach in 43d2d5f I changed the topic name to be the scoped name instead of the model name. Before: After: Note how the first one would fail if we were to instantiate multiple of the |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
🎉 New feature
Adds a default value to the namespace for
TouchPlugin.Summary
Previously, namespace was a mandatory parameter. This makes it a bit harder to have multiple instances of the same model without having to edit the SDF.
Specifically, if a user had a model with a TouchPlugin in its SDF, two instances of the same model would inevitably publish to the same topic (unless they did some SDF experimental params overrides).
With this PR, if users skip the
namespaceparameter, the plugin's namespace will default tomodel_name/touchmaking it easier to have models publish to unique topics.Test it
Run the touch_plugin demo then list the topics:
Current main:
Then change the demo world to remove the
namespaceparameterChecklist
codecheckpassed (See contributing)Generated-by: Remove this if GenAI was not used.
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.