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

Multiple rosbridge_websocket nodes

asked 2016-11-30 18:13:26 -0500

Leonid gravatar image

I'd like to run two rosbridge_websocket nodes - the only difference would be their names. What's the easiest way to do that? I was thinking that I could create my own ROS package based on the rosbridge_server package and modify the contents of the .launch file to assign appropriate node names. I'm not sure how to do this though or whether this is the right approach. Any help greatly appricated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-01 01:56:05 -0500

gvdhoorn gravatar image

updated 2016-12-01 01:59:30 -0500

If you want to reuse launch/rosbridge_websocket.launch, then you could probably get away with pushing both instances into their own namespaces.

I haven't tried it, but something like:

<launch>
  <include ns="bridge0" file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <!-- use default port -->
    <arg name="port" value="9090" />
  </include>
  <include ns="bridge1" file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
    <!-- use other port -->
    <arg name="port" value="9091" />
  </include>
</launch>

You can override any of the args in rosbridge_websocket.launch in the same way.

Note that this will prefix all topics, services and actions that the rosbridge_websocket node creates/offers with the value in the ns attribute of the include tag.

If you want to avoid using namespaces, you could just copy rosbridge_websocket.launch to a package of your own (in your workspace), and copy the relative entries while making sure to change the name attribute of the node tag that starts rosbridge_websocket. But note that this will not work if rosbridge_websocket creates any global topics, services or actions, as they will then clash with each other.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-30 18:13:26 -0500

Seen: 893 times

Last updated: Dec 01 '16