From ddef663b079ae20368910457fff5c4648de30937 Mon Sep 17 00:00:00 2001 From: Poh Zhi-Ee Date: Thu, 13 Aug 2020 10:01:48 +0800 Subject: [PATCH] Add checks for marker parent Signed-off-by: Poh Zhi-Ee --- src/rendering/MarkerManager.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rendering/MarkerManager.cc b/src/rendering/MarkerManager.cc index 87373a69fc0..be46f91f423 100644 --- a/src/rendering/MarkerManager.cc +++ b/src/rendering/MarkerManager.cc @@ -498,7 +498,10 @@ bool MarkerManagerPrivate::ProcessMarkerMsg(const ignition::msgs::Marker &_msg) visualPtr->AddGeometry(markerPtr); // Add visual to root visual - this->scene->RootVisual()->AddChild(visualPtr); + if (!visualPtr->HasParent()) + { + this->scene->RootVisual()->AddChild(visualPtr); + } // Store the visual this->visuals[ns][id] = visualPtr;