Skip to content

Commit 330e356

Browse files
committed
Fix race condition in initializing ada_planning_scene
1 parent c2ecf9f commit 330e356

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ada_planning_scene/ada_planning_scene/ada_planning_scene.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,15 @@ def parameter_callback(self, params: List[Parameter]) -> SetParametersResult:
257257
self.__namespace_to_use = namespace_to_use
258258
self.__initializer.namespace_to_use = namespace_to_use
259259
self.__workspace_walls.namespace_to_use = namespace_to_use
260-
self.__update_from_face_detection.namespace_to_use = namespace_to_use
261-
self.__update_from_table_detection.namespace_to_use = namespace_to_use
260+
# The hasattr is necessary in case this gets called before initialization is complete
261+
if hasattr(self, "__update_from_face_detection"):
262+
self.__update_from_face_detection.namespace_to_use = (
263+
namespace_to_use
264+
)
265+
if hasattr(self, "__update_from_table_detection"):
266+
self.__update_from_table_detection.namespace_to_use = (
267+
namespace_to_use
268+
)
262269

263270
# Re-initialize the planning scene
264271
self.initialize()

0 commit comments

Comments
 (0)