From a08710ed7c6bee6e20e2d3dd9a7ff52e85e50354 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 6 May 2019 14:17:23 -0400 Subject: [PATCH] pyodm version fixed, skip merge point cloud on failure Former-commit-id: b0480ae1569ecbbe6520186e212bfcaea45739fc --- Dockerfile | 3 ++- configure.sh | 3 ++- opendm/remote.py | 30 +++++++++++++++++++++++------- portable.Dockerfile | 3 ++- scripts/splitmerge.py | 6 +++++- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 44c6c1fc..88d30880 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,8 @@ RUN pip install -U \ shapely \ xmltodict \ rasterio \ - attrs==19.1.0 + attrs==19.1.0 \ + pyodm==1.5.0 ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages" ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/src/opensfm" diff --git a/configure.sh b/configure.sh index 870ee8cc..e320eaf2 100755 --- a/configure.sh +++ b/configure.sh @@ -79,7 +79,8 @@ install() { loky \ repoze.lru \ rasterio \ - attrs==19.1.0 + attrs==19.1.0 \ + pyodm==1.5.0 echo "Installing OpenDroneMap Dependencies" apt-get install -y -qq python-scipy \ diff --git a/opendm/remote.py b/opendm/remote.py index afd50616..ad42964b 100644 --- a/opendm/remote.py +++ b/opendm/remote.py @@ -1,17 +1,33 @@ from opendm import log +from pyodm import Node, exceptions class HybridDistributedExecutor: def __init__(self, nodeUrl): - self.nodeUrl = nodeUrl - log.ODM_INFO("Initializing hybrid distributed executor with cluster node: %s" % nodeUrl) + self.node = Node.from_url(nodeUrl) + + log.ODM_INFO("Initializing hybrid distributed executor using cluster node %s" % nodeUrl) + try: + odm_version = self.node.info().odm_version + log.ODM_INFO("Node is online and running ODM version: %s" % odm_version) + except exceptions.NodeConnectionError: + log.ODM_WARNING("The node seems to be offline! We'll still process the dataset, but it's going to run entirely locally.") + except Exception as e: + log.ODM_ERROR("An unexpected problem happened while opening the node connection: %s" % str(e)) + exit(1) def set_projects(self, paths): self.project_paths = paths - def run_reconstruct(self): - print(self.project_paths) - exit(1) + def run_reconstruction(self): + if not self.project_paths: + return + + + + def run_toolchain(self): - pass - + if not self.project_paths: + return + + diff --git a/portable.Dockerfile b/portable.Dockerfile index 4142b152..2a86f3aa 100644 --- a/portable.Dockerfile +++ b/portable.Dockerfile @@ -75,7 +75,8 @@ RUN pip install -U \ shapely \ xmltodict \ rasterio \ - attrs==19.1.0 + attrs==19.1.0 \ + pyodm==1.5.0 ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages" ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/src/opensfm" diff --git a/scripts/splitmerge.py b/scripts/splitmerge.py index 9aa91e7f..1eda582a 100644 --- a/scripts/splitmerge.py +++ b/scripts/splitmerge.py @@ -165,7 +165,11 @@ class ODMMergeStage(types.ODM_Stage): if args.merge in ['all', 'pointcloud']: if not io.file_exists(tree.odm_georeferencing_model_laz) or self.rerun(): all_point_clouds = get_submodel_paths(tree.submodels_path, "odm_georeferencing", "odm_georeferenced_model.laz") - pdal.merge_point_clouds(all_point_clouds, tree.odm_georeferencing_model_laz, args.verbose) + + try: + pdal.merge_point_clouds(all_point_clouds, tree.odm_georeferencing_model_laz, args.verbose) + except Exception as e: + log.ODM_WARNING("Could not merge point cloud: %s (skipping)" % str(e)) else: log.ODM_WARNING("Found merged point cloud in %s" % tree.odm_georeferencing_model_laz)