diff --git a/components/common/cpp/src/configuration.cpp b/components/common/cpp/src/configuration.cpp index 5230e154978b2cec6a8f081f2729afd4fced5369..07fad52d1021b8146d63722f36b157262b199148 100644 --- a/components/common/cpp/src/configuration.cpp +++ b/components/common/cpp/src/configuration.cpp @@ -386,10 +386,11 @@ Configurable *ftl::config::configure(int argc, char **argv, const std::string &r LOG(FATAL) << "Could not find any configuration!"; } - string root_str = (options.find("root") != options.end()) ? options["root"] : root; + string root_str = (options.find("root") != options.end()) ? nlohmann::json::parse(options["root"]).get<string>() : root; Configurable *rootcfg = create<Configurable>(config); if (root_str.size() > 0) { + LOG(INFO) << "Setting root to " << root_str; rootcfg = create<Configurable>(rootcfg, root_str); } diff --git a/config/config.jsonc b/config/config.jsonc index ba0d544c730968a72e7d449fe3e2e14cd81df103..f83dde531bf82ef348b3ea964c919e7c77a157cb 100644 --- a/config/config.jsonc +++ b/config/config.jsonc @@ -36,20 +36,7 @@ } }, "sources": { - "stereocam": {}, - "stereovid": {}, - "localhost": {} - - }, - // Listen to localhost - "net": { - "default": { - "listen": "tcp://*:9001", - "peers": [] - } - }, - "vision_default": { - "source": { + "stereocam": { "type": "stereovideo", "feed": { "flip": false, @@ -65,12 +52,23 @@ "calibration": { "$ref": "#calibrations/default" }, "disparity": { "$ref": "#disparity/libsgm" } }, - "middlebury": { - "dataset": "", - "threshold": 10.0, - "scale": 0.25 + "stereovid": {}, + "localhost": {} + + }, + // Listen to localhost + "net": { + "default_vision": { + "listen": "tcp://*:9001", + "peers": [] }, - "display": { + "default_reconstruct": { + "listen": "tcp://*:9002", + "peers": [] + } + }, + "displays": { + "none": { "flip_vert": false, "disparity": false, "points": false, @@ -78,26 +76,24 @@ "left": false, "right": false }, - "net": { "$ref": "#net/default" }, - "stream": { - } - }, - "reconstruction_default": { - "net": { - "peers": ["tcp://localhost:9001"] - }, - "sources": [ - {"type": "net", "uri":"ftl://utu.fi/node4"} - ], - "display": { + "left": { "flip_vert": false, "disparity": false, "points": false, "depth": false, "left": true, "right": false - }, - "virtual": { + } + }, + "middlebury": { + "none": { + "dataset": "", + "threshold": 10.0, + "scale": 0.25 + } + }, + "virtual_cams": { + "default": { "hash_renderer": true, "SDFRayIncrementFactor": 0.8, "SDFTruncation": 0.1, @@ -110,8 +106,10 @@ "min_depth": 0.1, "SDFUseGradients": false, "uri": "ftl://utu.fi/virt1/rgb-d" - }, - "voxelhash": { + } + }, + "hash_conf": { + "default": { "adapterWidth": 640, "adapterHeight": 480, "sensorDepthMax": 20.0, @@ -130,7 +128,49 @@ "SDFIntegrationWeightSample": 10, "SDFIntegrationWeightMax": 255, "hash_renderer": true + } + }, + + "vision_default": { + "source": { "$ref": "#sources/stereocam" }, + "middlebury": { "$ref": "#middlebury/none" }, + "display": { "$ref": "#displays/none" }, + "net": { "$ref": "#net/default_vision" }, + "stream": {} + }, + + "reconstruction_default": { + "net": { + "peers": ["tcp://localhost:9001"] }, + "sources": [ + {"type": "net", "uri":"ftl://utu.fi/vision_default/source"} + ], + "display": { "$ref": "#displays/left" }, + "virtual": { "$ref": "#virtual_cams/default" }, + "voxelhash": { "$ref": "#hash_conf/default" }, + "registration": { + "reference-source" : "ftl://utu.fi/vision_default/source", + "calibration" : { + "max_error": 25, + "run": false, + "iterations" : 10, + "delay" : 500, + "patternsize" : [9, 6] + } + } + }, + + "reconstruction_lab": { + "net": { + "peers": ["tcp://ftl-node-4:9001"] + }, + "sources": [ + {"type": "net", "uri":"ftl://utu.fi/node4"} + ], + "display": { "$ref": "#displays/left" }, + "virtual": { "$ref": "#virtual_cams/default" }, + "voxelhash": { "$ref": "#hash_conf/default" }, "registration": { "reference-source" : "ftl://utu.fi/node4", "calibration" : { @@ -142,6 +182,8 @@ } } }, + + "ftl://gui/default": { "net": { "peers": ["tcp://ftl-node-4:9001"]