SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.67k stars 525 forks source link

Protect graph from parallel access during visualization. #534

Closed malban closed 2 years ago

malban commented 2 years ago

Basic Info

Info Please fill out this column
Ticket(s) this addresses #497
Primary OS tested on Ubuntu 20.04
Robotic platform tested on (Steve's Robot, gazebo simulation of Tally, hardware turtlebot)

Description of contribution in a few bullet points

@SteveMacenski I'm not sure if this fixes the issue or not, but it seems likely that a mutex is required here.

I can test this later today or tomorrow.

SteveMacenski commented 2 years ago

OK! Let me know and I can backport across the distributions

malban commented 2 years ago

@SteveMacenski Ok, I've tested the change, and I wasn't able to see any regressions such as deadlocking when either serializing or deserializing the map.

I also wasn't able to reproduce the original issue, on humble, either from loading a map at startup or calling the deserialize service, so I can't tell for sure if this will fix it. If the issue is unprotected access of the graph, then it could be sensitive to timing.

Maybe @Anton1B can check if this change resolves the issue for him on noetic?