Ask Your Question

Revision history [back]

[ROS2, Navigation2] Is Costmap2DROS thread-safe when reconfigure?

I'm looking at Navigation2 codes. But, I'm confused about whether Costmap2DROS is thread-safe or not. It seems there exist two threads in Costmap2DROS as follows.

Thread 1) ROS2 Node -> callbacks executed

Thread 2) Map update loop -> map update executed in each layers

It seems there are conflicting evaluations. For example, StaticLayer::has_updated_data_ is written by Thread 1(StaticLayer::incomingMap), also is written by Thread 2(StaticLayer::updateBounds). Am I wrong? Since I'm newbie on multi-threading, I really appreciate for anyone's help