Costmap2DPublisher lock costmap mutex twice, is it Efficient for its update

asked 2021-05-16 21:41:43 -0500

942951641@qq.com gravatar image

one of my thinking.

In Costmap2dPublisher class, publishCostmap() function will publish raw costmap msg and update msg, it will lock twice costmap2dRos object mutex to obatin data, is it efficient ?

I think it mignt be good to lock mutex once to otain data, and use copy data to convert to costmap msg or occupancy data.

whether it is more efficient to publish msg in Costmap2dRos update thread ? whether it is more efficient to make copy data in Costmap2dRos?

edit retag flag offensive close merge delete