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

SetRemap does not work inside a launch include action #196

Closed
jacobperron opened this issue Oct 28, 2020 · 3 comments
Closed

SetRemap does not work inside a launch include action #196

jacobperron opened this issue Oct 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@jacobperron
Copy link
Member

Feature request

Feature description

The SetRemap action was added in #158 to give users an easy way to apply remaps to multiple nodes at the same scope. However, if the SetRemap action is placed inside an include action, then the remappings are not applied.

For example, I want to remap the topic for nodes included in a launch file:

<launch>
    <include file="talker.launch.xml">
        <set_remap from="chatter" to="foo" />
    </include>
</launch>

But, in order to actually get it to work we have to put the <set_remap> action as a peer to <include>:

<launch>
    <set_remap from="chatter" to="foo" />
    <include file="talker.launch.xml">
    </include>
</launch>

This is less desirable because the remapping might leak to other nodes at include scope and we're forced to wrap everything in a <group>:

<launch>
    <group>
        <set_remap from="chatter" to="foo" />
        <include file="talker.launch.xml">
        </include>
    </group>
</launch>

I don't know if there's a technical reason for the current behavior or if it is simply an oversight.

@jacobperron jacobperron added the enhancement New feature or request label Oct 28, 2020
@jacobperron
Copy link
Member Author

As an aside, I think it would be nice to just name the action <remap> (like in ROS 1). Maybe there's a good reason to not change the name though.

@ivanpauno
Copy link
Member

For example, I want to remap the topic for nodes included in a launch file:

include doesn't take any subtag.

I don't know if there's a technical reason for the current behavior or if it is simply an oversight.

The main reason is that include is defined in launch and not in launch_ros.
The only two subtags that make sense are set_param and set_remap.

I think that now that #198 and ros2/launch#468 have landed this should at least not be confusing.

@jacobperron
Copy link
Member Author

The main reason is that include is defined in launch and not in launch_ros.

That makes sense.

After looking at this again, I was mistakenly thinking that this was possible in ROS 1, but it is not. We accomplish this the same way in ROS 1's roslaunch, e.g.:

<launch>
    <remap from="chatter" to="foo" />
    <include file="talker.launch" />
</launch>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants