Ask Your Question

How to see nodes CPU usage in ROS ?

asked 2013-01-11 21:24:51 -0600

dmeltz gravatar image

updated 2014-01-28 17:14:48 -0600

ngrennan gravatar image

Hello all.

I built an autonomous car simulation in Gazebo. But for some reason my simulation runs with a very low time rate (around 0.1 off the real time) .

My program includes a number of different nodes and I suspect that some of those nodes use considerably more CPU than others.

The question is : Is there a way to see the CPU usage of each running node ?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-01-12 00:24:21 -0600

Ben_S gravatar image

Since normal nodes are started as distinct processes a simple top or htop should do the trick.

Sadly i dont know of a way to see the load if you are working with nodelets that reside within the same process. Maybe someone else can shed some light, if this is even possible? (Other than starting the nodelets in different managers and making them distinct processes?)

edit flag offensive delete link more



The only way to see the CPU load of a nodelet is to start it in a separate process. ROS does not provide any direct means for getting CPU usage.

Lorenz gravatar imageLorenz ( 2013-01-12 01:19:40 -0600 )edit

Gazebo, itself, can use a lot of CPU cycles, depending on how detailed your simulation model is. A good place to start is checking the CPU load for those processes. We created simpler models for when we need more robots or better performance, saving the detailed models for other purposes.

joq gravatar imagejoq ( 2013-01-12 05:08:46 -0600 )edit

answered 2013-01-17 10:15:52 -0600

updated 2018-05-22 13:39:09 -0600

130s gravatar image

I recently wrote a rqt plugin to show process info for running nodes. It's still very much a work in progress, but the basic functionality is there:

UPDATE by @130s: It is released as

edit flag offensive delete link more

answered 2013-01-12 04:28:42 -0600

Thomas D gravatar image

As @Ben_S says in his answer, the best place to start is top or htop. If you want more information then I recommend using sysprof so that you can see which function calls are taking the most time and figure out where optimizations can be made. That would even help with nodelets.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-01-11 21:24:51 -0600

Seen: 3,552 times

Last updated: May 22 '18