[ros-users] ROS cpu load

Cedric Pradalier cedric.pradalier at mavt.ethz.ch
Fri Jul 30 23:45:13 UTC 2010


Hi list,

I've noticed that the ros programs are taking a bit more resources than 
I expected when running on my embedded system, so I've written the 
simple program below:

int main(int argc, char** argv)
{
     ros::init(argc, argv, "RemoteControl");
     ros::NodeHandle nh("~");     // <-- this line
     while (ros::ok()) {
         sleep(1);
     }
     return 0;
}

If I comment out "this line", then the cpu usage is 0%. When I include 
it in, my cpu usage goes to 5 or even 10% (I'm testing on a Virtualbox 
virtual machine).  When I run it directly on my laptop, the load is not 
noticeable, but the process run-time still goes up faster than I would 
expect.

I will dig in roscpp tomorrow to identify exactly where the time is 
spent, but I'd be glad to get some pointers if any.

Thanks

-- 
Dr. Cedric Pradalier
http://www.asl.ethz.ch/people/cedricp




More information about the ros-users mailing list