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.
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_);
inspinThread
and it also reduced CPU usage. I'm not surespin_some
is meant to be called in a full-speed loop.