koide3 / glim

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

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

Closed skohlbr closed 1 month ago

skohlbr commented 2 months 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 months ago

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