From c973de8d4c3299d48b81e3d3302b57e943a2e00d Mon Sep 17 00:00:00 2001 From: Poh Zhi-Ee Date: Thu, 13 Aug 2020 10:01:48 +0800 Subject: [PATCH 1/2] 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 87373a69fc..be46f91f42 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; From a3f65c2ec9586816e3a3cb2ecf11ca18469401a8 Mon Sep 17 00:00:00 2001 From: Poh Zhi-Ee Date: Fri, 14 Aug 2020 08:57:31 +0800 Subject: [PATCH 2/2] Fix indent Signed-off-by: Poh Zhi-Ee --- src/rendering/MarkerManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/MarkerManager.cc b/src/rendering/MarkerManager.cc index be46f91f42..78e3bbec98 100644 --- a/src/rendering/MarkerManager.cc +++ b/src/rendering/MarkerManager.cc @@ -500,7 +500,7 @@ bool MarkerManagerPrivate::ProcessMarkerMsg(const ignition::msgs::Marker &_msg) // Add visual to root visual if (!visualPtr->HasParent()) { - this->scene->RootVisual()->AddChild(visualPtr); + this->scene->RootVisual()->AddChild(visualPtr); } // Store the visual