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

roscore spawning 3 processes of itself and 5 processes of this normal

asked 2013-03-28 21:01:07 -0600

BlackManta gravatar image

updated 2014-01-28 17:15:58 -0600

ngrennan gravatar image

When I run roscore from command line, I am getting three processes (from ps -AL) of roscore (3 duplicates). I am getting FIVE rosmaster processes. Any node I spawn will also be duplicated.

1) Is this normal behavior 2) what am I doing wrong if it isn't?

I am using Ros Fuerte (which upgrading isn't an option for me at the moment).

Any help would be great, thanks.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-29 01:17:19 -0600

Claudio gravatar image

You should use a tool better suited for the work you seek. ps -AL will show you tons of stuff, probably having to do with terminals, side processes (like those roslaunch spawns to control the other processes), pipes and ptys and so on.

Either use TOP or HTOP to check on running programs.

I have a launch file I know works correctly and launching it and then checking with ps -AL I too have lots of apparently duplicated processes. Suggestion: when you don't know what is really going on under the hood, don't look under the hood, else you get confused.

edit flag offensive delete link more



Fair enough I will use top or HTOP. That will at least make sure I am running only 1 application. I am still a little concerned about the processes though. If I run a python script I get a process for that python script. Even if I fork, I might get a separate process for python itself but I still only get two duplicates though.

... And...yes...I do sort of know what is going on under the hood. ;P

Now I am curious why that is happening. Is it because of the inter-process communication?

BlackManta gravatar image BlackManta  ( 2013-03-29 11:39:48 -0600 )edit

I see one PID for the rosmaster with 5 threads, and similar results for other ROS nodes like roscore. I think the ROS libraries spawn extra threads in the background to handle the network traffic.

ahendrix gravatar image ahendrix  ( 2013-03-29 12:34:13 -0600 )edit

The core may have to spawn sub-processes for example for: message handling, logging, networking. Same thing for the nodes: maybe the call to ross::init spawns another thread/process to handle the messages.

If you know what's happening under the hood then you shouldn't need to ask ;)

Claudio gravatar image Claudio  ( 2013-04-02 00:22:41 -0600 )edit

Question Tools


Asked: 2013-03-28 21:01:07 -0600

Seen: 957 times

Last updated: Mar 29 '13