[ros-users] ROS cpu load

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Cedric Pradalier
Date:  
To: ros-users
Subject: [ros-users] ROS cpu load
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