diff --git a/tesseract_rviz/src/conversions.cpp b/tesseract_rviz/src/conversions.cpp index 7cb89f2f..561ccbcd 100644 --- a/tesseract_rviz/src/conversions.cpp +++ b/tesseract_rviz/src/conversions.cpp @@ -746,14 +746,15 @@ Ogre::SceneNode* loadLinkGeometry(Ogre::SceneManager& scene, for (unsigned i = 0; i < octree_depth; ++i) { - OctreeDataContainer data; - data.size = static_cast(octree->getNodeSize(static_cast(i + 1))); - data.points = std::vector(pointBuf[i]); - data.point_cloud = createPointCloud(std::move(pointBuf[i]), entity_container, data.size, octomap.getSubType()); - data.shape_type = octomap.getSubType(); - - offset_node->attachObject(data.point_cloud.get()); - entity_container.addUntrackedUnmanagedObject(tesseract_gui::EntityContainer::VISUAL_NS, data.point_cloud); + auto data = std::make_shared(); + data->size = static_cast(octree->getNodeSize(static_cast(i + 1))); + data->points = std::vector(pointBuf[i]); + data->point_cloud = + createPointCloud(std::move(pointBuf[i]), entity_container, data->size, octomap.getSubType()); + data->shape_type = octomap.getSubType(); + + offset_node->attachObject(data->point_cloud.get()); + entity_container.addUntrackedUnmanagedObject(tesseract_gui::EntityContainer::VISUAL_NS, data); } offset_node->setScale(ogre_scale);