use locals instead of launch configurations to store ros_remaps and ros_namespace #470
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
ros_remaps and ros_namespace are currently stored as launch configurations, but they don't behave like typical launch configurations — they're not declared using DeclareLaunchArgument, and their purpose is more aligned with contextual scoping.
They are better suited to be stored in the local stack (locals()) of the LaunchContext, rather than in the global launch configurations. This distinction aligns better with their use as scoped contextual variables rather than user-defined launch arguments.
This change is related to the discussion in ros2/launch#801 (comment), where a workaround was proposed to distinguish between launch configurations that should be scoped versus those that should propagate globally.
This PR is marked as a draft because I haven't found definitive guidance in launch_ros or ros2/design regarding the intended semantics of the locals and globals stacks within LaunchContext. Based on my understanding, this usage seems appropriate, but I welcome feedback if this assumption is incorrect.
Did you use Generative AI?
No