Open
Conversation
This takes two arguments: a resource type and a resource name. These will be resolved and then used to look up a resource in the ament index. Due to how launch files parse substitution arguments by splitting on spaces, the resource type and name cannot contain spaces when using the XML and YAML front-ends. We could try using a different separator for the two, such as a `/` character (since this is guaranteed not to appear in a directory name, and therefore not in an ament resource type either); however, this would complicate things significantly and mean we have to delay the splitting until `perform()` is called and we can resolve any nested substitutions. Signed-off-by: Nathan Wiebe Neufeldt <wn.nathan@gmail.com>
Signed-off-by: Nathan Wiebe Neufeldt <wn.nathan@gmail.com>
Signed-off-by: Nathan Wiebe Neufeldt <wn.nathan@gmail.com>
These check that the substitution works in XML and YAML launch files. Signed-off-by: Nathan Wiebe Neufeldt <wn.nathan@gmail.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.
Description
This introduces a new launch substitution,
AmentIndexResource, to get the prefix path of the specified resource. This is essentially a generalization of the existingFindPackagePrefixsubstitution that works for any resource type in the ament index. The substitution takes the resource type and name as its two arguments and returns the prefix path result of looking those up withament_index_python.get_resource().This is also exposed in the XML/YAML front-ends as
ament-index-resource. Note that in this case, since these front-ends split arguments based on whitespace, it is not possible to look up resources that contain whitespace characters in their type or name.Is this user-facing behavior change?
Exposes a new launch-file substitution to users.
Did you use Generative AI?
No
Additional Information