[ros-users] ROS cpu load

Josh Faust jfaust at willowgarage.com
Fri Jul 30 23:56:30 UTC 2010


There are a couple different polling timeouts used that may affect this:
 xmlrpc_manager.cpp:256:   server_.work(0.01);
 poll_manager.cpp:95:  poll_set_.update(10);

If you're using timers:
 timer_manager.h:508:  timers_cond_.timed_wait(lock,
boost::posix_time::milliseconds(1));

Adjusting these to your needs will likely help quite a bit -- we don't run
on any embedded systems here, so we're haven't optimized for them or
provided knobs to tweak for these.

Josh

On Fri, Jul 30, 2010 at 4:45 PM, Cedric Pradalier <
cedric.pradalier at mavt.ethz.ch> wrote:

> 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
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100730/8222adb8/attachment-0003.html>


More information about the ros-users mailing list