rst-tu-dortmund / costmap_converter

A ros package that includes plugins and nodes to convert occupied costmap2d cells to primitive types
140 stars 107 forks source link

Fix high CPU usage #36

Open tonynajjar opened 2 years ago

tonynajjar commented 2 years ago

We noticed that the costmap converter was using a lot of CPU. We boiled it down to the spinThread function. Adding a rate sleep improved CPU usage by around 5x!

I also tried to simply call rclcpp::spin(nh_); in spinThread and it also reduced CPU usage. I'm not sure spin_some is meant to be called in a full-speed loop.

tonynajjar commented 1 year ago

@stevemacenski do you have the rights to merge this?