ros-teleop / twist_mux

Twist multiplexer
Apache License 2.0
57 stars 86 forks source link

Output selected topic name #17

Open ihs-systems opened 4 years ago

ihs-systems commented 4 years ago

(In my case) it would be handy to have information which input topic is selected for current output, similar to mux/selected topic in topic_tools/mux package.

Have you been thinking of this functionality? Perhaps I can provide PR when i start digging into it.

Michael-Equi commented 4 years ago

Have you added this feature somewhere? I am interested in it too.

Michael-Equi commented 4 years ago

Just added the feature here in a PR here https://github.com/ros-teleop/twist_mux/pull/20

peci1 commented 1 year ago

Our generalized mux package has this ability: https://github.com/ctu-vras/ros-utils/blob/master/cras_topic_tools/include/cras_topic_tools/priority_mux.h . It should be released with next Noetic sync (there was an older version of priority_mux that is released now, but it was broken).

The package is "backwards compatible" with twist_mux - it can be configured with the exact same YAML files (but it adds more features like multiple output topics or working with any message types).

You can run it with rosrun cras_topic_tools priority_mux. The selected topic will be published on ~/selected/cmd_vel (if you publish to cmd_vel). You can also read the active priority level on ~/active_priority.