ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Conditional <remap>

asked 2015-05-06 13:13:30 -0500

I'd like to control topic remaps using roslaunch command-line arguments (i.e. by setting ROS parameters).

Is there a way to cause a roslaunch XML topic remap to be conditional? I'm looking for behavior like the <group if="$(arg remap)"> tag.

I tried putting a <remap> into a <group>, but this only seems to remap topics for the nodes in that group.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-05-06 13:22:27 -0500

gvdhoorn gravatar image

if and unless can be used on any tag, not just group, so you should be able to achieve what you want with something like:

<remap if="$(your_condition)" .. />

See also wiki/roslaunch/XML - If and unless attributes:

All tags support if and unless attributes, which include or exclude a tag based on the evaluation of a value [..]

(emphasis mine).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-05-06 13:13:30 -0500

Seen: 1,762 times

Last updated: May 06 '15