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

ROS topic tools mux not registering my output when I roslaunch the mux node

asked 2021-09-05 22:27:26 -0500

Randombs gravatar image

Very strange error and I have a workaround by simply adding another topic, and then manually selecting it from the using the MuxSelect service. It is just a minor annoyance.

According to the package documentation (http://wiki.ros.org/topic_tools/mux), the arguments are as follows:

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

launch file:

<?xml version="1.0"?>

<launch>
    <node pkg="topic_tools" type="mux" name="mux_cmd_vel" args="cmd_vel move_base/cmd_vel joy/cmd_vel mux:=mux_cmd_vel"/>
</launch>

rosnode info /mux_cmd_vel outputs:

--------------------------------------------------------------------------------
Node [/mux_cmd_vel]
Publications: 
 * /mux_cmd_vel/selected [std_msgs/String]
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /clock [unknown type]
 * /joy/cmd_vel [unknown type]
 * /move_base/cmd_vel [unknown type]

Services: 
 * /cmd_vel_select
 * /mux_cmd_vel/add
 * /mux_cmd_vel/delete
 * /mux_cmd_vel/get_loggers
 * /mux_cmd_vel/list
 * /mux_cmd_vel/select
 * /mux_cmd_vel/set_logger_level


contacting node http://amr:42221/ ...
Pid: 20173
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound (52187 - 10.27.159.119:47390) [11]
    * transport: TCPROS

Problem here is cmd_vel is supposed to show up as an output topic but it does appear in Publications when I use "rosnode info", nor does it appear in "rostopic list".

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-05 23:09:33 -0500

janindu gravatar image

updated 2021-09-05 23:11:42 -0500

If you dive into the code of the mux node here, you will see that the publisher is only advertised when the first message from any of the subscribed topics is received.

Therefore, if you are not publishing to move_base/cmd_vel, and joy/cmd_vel after launching / starting the mux node, you will not see cmd_vel in the rostopic list output, or in the rosnode info output. You should be able to see cmd_vel topic in the rostopic list output, or in the rosnode info output after you start publishing to move_base/cmd_vel, and joy/cmd_vel topics.

I can see that when you executed the rosnode info, the incoming topics had no publishers (as all subscriptions are of [unknown type].

So run the mux node as usual, play the rosbag (I assume you are playing with rosbags because your use_sim_time param is set to true which is why the mux node is subscribing to /clock topic, in which case do not forget rosbag play --clock <bag_name>), wait for messages to be published (mux node should log something like following)

[ INFO] [1630900837.305035517]: advertising

Now you should be able to see cmd_vel in the rostopic list output and in the rosnode info output.

edit flag offensive delete link more

Comments

Yes you're right, thank so so much for the detailed explanation. This was very helpful!

Randombs gravatar image Randombs  ( 2021-09-06 02:38:02 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-09-05 22:27:26 -0500

Seen: 184 times

Last updated: Sep 05 '21