koide3 / glim

GLIM: versatile and extensible range-based 3D localization and mapping framework
MIT License
458 stars 57 forks source link

glim_ros1 draws 100% CPU on idle to to busy spinning without wait #83

Open skohlbr opened 2 hours ago

skohlbr commented 2 hours ago

Describe the bug When starting the glim_rosnode.launch file and not feeding it any data (so it just sits there idling around), it the process consumes a full CPU core. This is due to ros::spinOnce() getting called without a wait/sleep inbetween.

To Reproduce

  1. Run roslaunch glim_ros glim_rosnode.launch
  2. Observe CPU consumption using top or another tool. It will show the GLIM process at 100%

Expected behavior When the process is idling it should consume low ( < ~5%) CPU.

Environment (please complete the following information):

skohlbr commented 2 hours ago

(Would be) fixed by https://github.com/koide3/glim_ros1/pull/16