Ask Your Question
0

How to decrease (openni_)kinect cpu usage in turtlebot pkg

asked 2011-08-23 01:34:10 -0500

Marco gravatar image

Hi!

I've been experimenting with the turtlebot-pkg on a fitpc2 with icreate and kinect but am running into the limits of the cpu now. I noticed that the openni_camera nodelet combined with the throttler uses quite a lot of cpu power. My guess is that this is caused by the fact that the driver publishes data at 30hz, and only after the throttler i get the advantage of the lower framerate (i only need about 5hz). The combination of driver/throttler thus still uses quite some cpu power as it works with the full 30hz datastream.

Is it possible to lower the framerate in the driver itself, as the cpu-power it uses to publish pointclouds at 30hz is wasted..?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-08-23 02:11:02 -0500

Nick Armstrong-Crews gravatar image

I believe dynamic_reconfigure can adjust kinect driver parameters (or at least downsamples pre-publication, avoiding CPU overhead).

  1. Use the GUI: rosrun dynamic_reconfigure reconfigure_gui
  2. Change params in a launch script: e.g., <node pkg="dynamic_reconfigure" type="dynparam" name="resetter" args="set /openni_node image_mode 8" />

Note that you can't re-set params for openni_node if it has an subscriber...

edit flag offensive delete link more

Comments

Setting the image_mode to qvga(5) or qqvga(8) indeed decreases cpu usage, and also disabling the rgb depth registration here lowers cpu usage. However, I am looking for a way to reduce framerate (Hz) instead of resolution to lower cpu usage.. any ideas?
Marco gravatar image Marco  ( 2011-08-23 18:52:16 -0500 )edit
In the reconfigure_gui, I recall that each image mode specifies a framerate and a resolution; however, I don't recall the lowest framerate...maybe 15 Hz? Your best bet may be to modify the openni_camera node source code and downsample frames in memory, before publishing on a ROS topic.
Nick Armstrong-Crews gravatar image Nick Armstrong-Crews  ( 2011-08-24 00:50:15 -0500 )edit
Yes it indeed specifies both, however for the depth image only 30Hz modes are available. One 15Hz mode is possible for the cam, but not for depth mode. I might take a look at openni_camera.. or maybe someone already did something like this some time?
Marco gravatar image Marco  ( 2011-08-24 22:21:42 -0500 )edit
Looks like there's a similar question with a better answer: http://answers.ros.org/question/686/openni_node-internal-throttle-to-limit-cpu-usage
Nick Armstrong-Crews gravatar image Nick Armstrong-Crews  ( 2011-08-25 03:02:50 -0500 )edit
I saw that indead and am already using the nodelet implementation. My problem is the same as stated in the comments there: the nodelet still computes the 30Hz pointcloud before the throttler throttles it to 5Hz. This is still quite a waste of cpu power.
Marco gravatar image Marco  ( 2011-08-29 22:46:26 -0500 )edit
Feel free to file a feature request for the driver, especially with a patch. That feature does not exist at the moment.
tfoote gravatar image tfoote  ( 2011-12-08 05:19:20 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2011-08-23 01:34:10 -0500

Seen: 1,012 times

Last updated: Aug 23 '11