diff --git a/digiforest_analysis/src/digiforest_analysis/pipeline.py b/digiforest_analysis/src/digiforest_analysis/pipeline.py index 1bdd6c8..d9ff65f 100644 --- a/digiforest_analysis/src/digiforest_analysis/pipeline.py +++ b/digiforest_analysis/src/digiforest_analysis/pipeline.py @@ -80,10 +80,17 @@ def load_cloud(self, filename): assert len(self._cloud.point.positions) > 0 # Compute normals if not available - if not hasattr(self._cloud.point, "normals"): + try: + if not hasattr(self._cloud.point, "normals"): + print("No normals found in cloud, computing...", end="") + self._cloud.estimate_normals() + print("done") + except KeyError: print("No normals found in cloud, computing...", end="") self._cloud.estimate_normals() print("done") + except Exception as e: + print("The following error occurred: " + str(e)) def setup_output(self, output_dir): self._output_dir = Path(output_dir) diff --git a/requirements.txt b/requirements.txt index 275f758..6a2d2b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,5 @@ shapely pyyaml ipympl open3d>=0.17.0 -pytest \ No newline at end of file +pytest +hdbscan \ No newline at end of file