Multiple rosbridge clients that have their "own copy" of nodes

asked 2021-05-25 01:25:40 -0500

abhishek47 gravatar image

updated 2021-07-28 23:13:12 -0500

I've some nodes that can communicated with though rosbridge_websocket. I've got everything set up for one user, and now I'd like to scale this up to multiple users. I'd like each user (or client) to have their own copy of the nodes, such that the state of the nodes for one client doesn't interfere with another's.

Let's say I've got a node some_node. And the users are User1, User2, ... UserN. Shown below is a "pseudo" rqt_graph to explain what I want: image description

There could be any number of users. That's why I cannot simply create a launch file that'd launch a pre-defined number of anonymous copies. I've already looked at #q361809, which doesn't yet have any answer and the comment is something specific to that question which doesn't apply to my case.

For every new user that connects to rosbridge_websocket, a copy of some_node should get created dynamically. Can anyone advise how to proceed with this? This is for work where my colleagues need to do their work with the nodes I created, without their work interfering with one another. I've got ROS Melodic.

edit retag flag offensive close merge delete

Comments

Do you have a requirement to only have a single instance of rosbridge running?

gvdhoorn gravatar image gvdhoorn  ( 2021-05-25 01:56:33 -0500 )edit

No, there is no such requirement.

abhishek47 gravatar image abhishek47  ( 2021-05-25 02:48:30 -0500 )edit

No, there is no such requirement.

the "pseudo rqt_graph" seems to suggest otherwise though.

Would it work to start a new instance of everything, including rosbridge and make each client connect to their own private "session"?

Have you also looked at commercial/existing solutions? Scaling these kinds of things is non-trivial, and I seem to remember there are some companies specialising in these kinds of things.

gvdhoorn gravatar image gvdhoorn  ( 2021-05-25 02:56:19 -0500 )edit

the "pseudo rqt_graph" seems to suggest otherwise though

I meant to show that rosbridge_websocket is a gateway, but now I totally get how that diagram is ambiguous and could lead one to think there's a one-instance-of-rosbridge-only requirement.

Would it work to start a new instance of everything, including rosbridge and make each client connect to their own private "session"?

Hm I think this approach should be fine. I'm running this on a Raspberry Pi so I'll have to find out what limits might that pose but in theory at least multiple sessions sounds like an idea worth exploring. Are you aware of a resource that shows how to create such sessions? I'm curious what constitutes a session and what piece of information distinguishes one session from another.

Have you also looked at commercial/existing solutions?

Haven't found much out there, turned to ROS Answers first ...(more)

abhishek47 gravatar image abhishek47  ( 2021-05-25 06:58:58 -0500 )edit