Wiki

mux

mux is a ROS node that subscribes to a set of incoming topics and republishes incoming data from one of them to another topic, i.e., it's a multiplexer that switches an output among 1 of N inputs. Services are offered to switch among input topics, and to add and delete input topics. At startup, the first input topic on the command line is selected.

mux is part of the topic_tools package.

mux Usage

mux <outopic> <intopic1> [intopic2...] [standard ROS arguments]

IMPORTANT: To avoid conflicting with other instances of mux, you should always remap the mux's node name to something descriptive, using the mux:=foo syntax on the command line.

Associated mux tools (mux_select, mux_add, mux_delete)

For convenience, topic_tools provides some command-line tools for interacting with a mux. Assuming that the mux is called MUX_NAME (via remapping mux:=MUX_NAME on startup), you can use:

mux_select MUX_NAME <topic>

mux_add MUX_NAME <topic>

mux_delete MUX_NAME <topic>

switch_mux <outtopic> <intopic> DEPRECATED since ROS 0.11

Examples

Setting up the sel_cmdvel topic to switch between auto_cmdvel and joystick_cmdvel:

rosrun topic_tools mux sel_cmdvel auto_cmdvel joystick_cmdvel mux:=mux_cmdvel &

Then using mux_select to select joystick_cmdvel:

rosrun topic_tools mux_select mux_cmdvel joystick_cmdvel

You can instead use rosservice:

rosservice call mux_cmdvel/select joystick_cmdvel

ROS API

mux

mux is a node that can subscribe to a set of incoming topics and republish incoming data from one of them to another topic, i.e., it's a multiplexer that switches an output among 1 of N inputs. Services are offered to switch among input topics, and to add and delete input topics. At startup, the first input topic on the command line is selected.

Subscribed Topics

<intopicN> (any/any)

Published Topics

<outtopic> (any/any) mux/selected (new in ROS 0.11) (std_msgs/String)

Services

mux/select (new in ROS 0.11) (topic_tools/MuxSelect) mux/add (new in 0.11) (topic_tools/MuxAdd) mux/delete (new in ROS 0.11) (topic_tools/MuxDelete) <outtopic>_select (DEPRECATED since ROS 0.11) (topic_tools/MuxSelect)

Parameters

~lazy (bool, default: False) ~initial_topic (str)

Wiki: topic_tools/mux (last edited 2018-07-04 00:11:32 by IsaacSaito)