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

Independent ROS sessions on Linux machine with multiple users

asked 2021-10-02 17:31:15 -0600

Ktysai gravatar image

HI there!

On an Ubuntu 20.04 with multiple users can each user use ROS Noetic without interfering with each other? At the moment if a topic is started, the others ca see its presence

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-10-03 04:33:35 -0600

gvdhoorn gravatar image

updated 2021-10-03 09:04:41 -0600

Using Docker containers would be one way (as it is able to isolate processes and network traffic).

If you don't want to / can't use that, you could use roslaunch's -p argument to tell it to start a separate roscore on a specific port. It will then use that specific roscore for all the nodes it starts. You'd assign each user a different port which would result in the node graphs tied to that roscore to be isolated from each other.

The -p argument also automatically updates the port in the ROS_MASTER_URI for that roslaunch session. I'd probably still recommend setting ROS_MASTER_URI manually though, as the ROS_MASTER_URI in the environment of the current shell is not changed, only the value passed to processes started by roslaunch, so rosrun, rostopic et al. and directly run node binaries/scripts would still use the default value if you don't change it.

Note: regardless of how you approach this (docker, separate roscore) there is no protection or authentication, nor access control. All it takes for one user to be able to access (and interfere with) the node graph of another is for them to set their ROS_MASTER_URI to point to another roscore instance and "they're in".

If that's a concern (or the UX of Docker, or the UX of having to maintain separate roscores), perhaps virtual machines could offer a solution. Give each user their own VM. That would isolate them completely.


Edit:

For docker solution (very new in this): If I have 5 users, it means to pull 5 docker stations, and run them by users right?

I'm not sure I understand what you mean by this. You'd create (at least) 5 containers, which might also be started from 5 different images, but that would depend on what your users want/need to run.

Note that Docker will require some training, and is probably not suited for users with little experience with terminals or Linux process management.

I've looked at docker stuff regarding ROS, and I've had a little trouble connecting two terminals (one for starting ROSCORE, the other one for ROSRUN).

I would probably suggest to start a container and then run ROS-related commands inside that session. You could either use screen or tmux to multiplex a single bash session, or use docker exec to start additional bash sessions. That would keep all network traffic inside the container.

B This solution will allow building packages without making a mess is a user makes a mistake?

Again, not sure what you mean by this.

I assumed all users would be actual Linux users with their own $HOME and thus also their own Catkin workspace. I'm not sure how they would interfere with each other in that case.

Which solution will use less resources from the server?

There might be a slight overhead caused by Docker's networking infrastructure, but I'd be surprised if that influences performance very much. Unless ... (more)

edit flag offensive delete link more

Comments

Thanks gvdhoorn for laying these solutions!

A.For docker solution (very new in this): If I have 5 users, it means to pull 5 docker stations, and run them by users right? I've looked at docker stuff regarding ROS, and I've had a little trouble connecting two terminals (one for starting ROSCORE, the other one for ROSRUN).

B This solution will allow building packages without making a mess is a user makes a mistake?

Which solution will use less resources from the server?

Ktysai gravatar image Ktysai  ( 2021-10-03 08:42:17 -0600 )edit

Later edit: ( I cannot add to my response)

SolutionA For Docker I have to learn more about it :) Server with Ubuntu 20.04, Docker installed with a Noetic image Basically 5 containers from the same image (less space HDD space used). Then I have to make the container to be accessed through Windows workstations, using Mobaxterm (quite useful for X11 forwarding).

SolutionB: Server with Ubuntu 20.04, ROS Noetic. All users have their home and catkin _WS. They acces the server through Windows workstations, using Mobaxterm (quite useful for X11 forwarding).

From what I've tested with ROSCORE -p customport and a turtlesim package is the ports are not identical the topics and so on do not interfere.

For the moment seems to work at least with two users simultaneously.

Bottom line: Solution B is easier to implement for me at least, but users are not that isolated ...(more)

Ktysai gravatar image Ktysai  ( 2021-10-03 10:25:10 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-10-02 17:31:15 -0600

Seen: 286 times

Last updated: Oct 03 '21