Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote special CLI rules to flags #68

Merged
merged 2 commits into from
Sep 12, 2019
Merged

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Sep 6, 2019

This pull requests adapts launch_ros to the changes introduced by ros2/rcl#495.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
param_arguments = cast(List[str], ros_specific_arguments['params'])
for param_file_path in self.__expanded_parameter_files:
param_arguments.append('__params:={}'.format(param_file_path))
ros_specific_arguments['params'] = self.__expanded_parameter_files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, -f flag only accepts one parameter file, and ros_specific_arguments['params'] (and self.__expanded_parameter_files) is a list.
And the limitation we talked in #59 (comment) isn't true.
Thought substitutions are usually performed to Text (and they should to please the type annotations), we were using LocalSubstitutions that were performed to List[str] or anything else (e.g.: ros_specific_arguments['params']).
See https://github.com/ros2/launch/blob/79975bf453af17fbc2848412d264dbcead623792/launch/launch/substitutions/local_substitution.py#L54.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, a LocalSubstitution can evaluate to anything, that's true -- despite the fact we've type-annotated it as Text. But that's why I think we've been performing substitutions by indexing ros_specific_arguments['params'], and why I simply removed __params:= and prepended -f above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I read the patch badly. I missed that we were doing ros_specific_arguments['params'][i] in the local substitution and not ros_specific_arguments['params'].

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic merged commit 2be0232 into master Sep 12, 2019
@delete-merged-branch delete-merged-branch bot deleted the hidmic/switch-to-cli-flags branch September 12, 2019 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants