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

How to see nodes CPU usage in ROS ?

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

dmeltz gravatar image

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

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
4

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

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

Comments

1

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 image Lorenz  ( 2013-01-12 01:19:40 -0500 )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 image joq  ( 2013-01-12 05:08:46 -0500 )edit
2

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

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

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:

https://github.com/OSUrobotics/rostop...

UPDATE by @130s: It is released as http://wiki.ros.org/rqt_top

edit flag offensive delete link more
1

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

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

Question Tools

Stats

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

Seen: 9,975 times

Last updated: May 22 '18