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

Revision history [back]

click to hide/show revision 1
initial version

The question being how do I distinguish/separate the two joysticks from each other in the joy topic

You can't. The Joy message has no field for that (theoretically header.frame_id could be used, but no consumer checks that).

I thought one solution would be to make each joy_node publish to a different topic namespace

Yes, that would be one way to make sure they don't publish to the same topic.

but couldn't find any solutions or tutorials for this

So "topic namespace[s]" don't exist. Perhaps that is why you couldn't find something.

You have two options:

  1. use remapping (with roslaunch or with rosrun) to make each joy_node instance publish to a different topic
  2. put both joy_nodes in a different namespace (either directly on the node or via a group)

Which one would be more convenient depends on whether you already are using .launch files or not.

The question being how do I distinguish/separate the two joysticks from each other in the joy topic

You can't. The Joy message has no field for that (theoretically header.frame_id could be used, but no consumer checks that).

I thought one solution would be to make each joy_node publish to a different topic namespace

Yes, that would be one way to make sure they don't publish to the same topic.

but couldn't find any solutions or tutorials for this

So Well, "topic namespace[s]" don't exist. Perhaps that is why you couldn't find something.

You have two options:

  1. use remapping (with roslaunch or with rosrun) to make each joy_node instance publish to a different topic
  2. put both joy_nodes in a different namespace (either directly on the node or via a group)

Which one would be more convenient depends on whether you already are using .launch files or not.