diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e0c130795ba22952a70a04c15b33f9f1da9bdb9..950e7bf024d53f35b046f4d9028ea61fc9b0aba0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,11 @@ stages: - build_and_test ############ YAML ANCHORS ############ +.print_variables_template: &print_variables_definition + # Print variables + - echo $CI_COMMIT_BRANCH + - echo $WOLF_VISION_BRANCH + .preliminaries_template: &preliminaries_definition ## Install ssh-agent if not already installed, it is required by Docker. ## (change apt-get to yum if you use an RPM-based image) @@ -115,6 +120,7 @@ license_headers: paths: - ci_deps/wolf/ before_script: + - *print_variables_definition - *preliminaries_definition - *install_wolf_definition script: @@ -132,6 +138,7 @@ build_and_test:bionic: paths: - ci_deps/vision_utils/ before_script: + - *print_variables_definition - *preliminaries_definition - *install_wolf_definition - *install_visionutils_definition @@ -151,6 +158,7 @@ build_and_test:focal: paths: - ci_deps/vision_utils/ before_script: + - *print_variables_definition - *preliminaries_definition - *install_wolf_definition - *install_visionutils_definition diff --git a/src/yaml/processor_bundle_adjustment_yaml.cpp b/src/yaml/processor_bundle_adjustment_yaml.cpp deleted file mode 100644 index c836f0fd73b23ea86c43bcb1709277737d82a11e..0000000000000000000000000000000000000000 --- a/src/yaml/processor_bundle_adjustment_yaml.cpp +++ /dev/null @@ -1,92 +0,0 @@ -//--------LICENSE_START-------- -// -// Copyright (C) 2020,2021,2022 Institut de Robòtica i Informà tica Industrial, CSIC-UPC. -// Authors: Joan Solà Ortega (jsola@iri.upc.edu) -// All rights reserved. -// -// This file is part of WOLF -// WOLF is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// -//--------LICENSE_END-------- -// wolf yaml -#include "core/yaml/yaml_conversion.h" - -// wolf -#include "core/common/factory.h" - -// yaml-cpp library -#include <yaml-cpp/yaml.h> -#include "vision/processor/processor_bundle_adjustment.h" - -namespace wolf -{ - -namespace -{ -static ParamsProcessorBasePtr createParamsProcessorBundleAdjustment(const std::string & _filename_dot_yaml) -{ - YAML::Node config = YAML::LoadFile(_filename_dot_yaml); - - if (config.IsNull()) - { - WOLF_ERROR("Invalid YAML file!"); - return nullptr; - } - else if (config["type"].as<std::string>() == "ProcessorBundleAdjustment") - { - ParamsProcessorBundleAdjustmentPtr params = std::make_shared<ParamsProcessorBundleAdjustment>(); - - YAML::Node vision_utils = config ["vision_utils"]; - params->yaml_file_params_vision_utils = vision_utils["YAML file params"].as<std::string>(); - - // relative to global path for Vision Utils YAML - assert(params->yaml_file_params_vision_utils.at(0) != ('/') && "The parameter YAML FILE PARAMS (in processor params YAML file) must be specified with a path relative to the processor YAML file."); - unsigned first = _filename_dot_yaml.find("/"); - unsigned last = _filename_dot_yaml.find_last_of("/"); - std::string strNew = _filename_dot_yaml.substr (first,last-first); - params->yaml_file_params_vision_utils = _filename_dot_yaml.substr (first,last-first) + "/" + params->yaml_file_params_vision_utils; - - YAML::Node algorithm = config ["algorithm"]; - params->time_tolerance = algorithm["time tolerance"] .as<double>(); - params->voting_active = algorithm["voting active"] .as<bool>(); - params->delete_ambiguities = algorithm["delete ambiguities"] .as<bool>(); - params->min_features_for_keyframe = algorithm["minimum features for keyframe"] .as<unsigned int>(); - params->max_new_features = algorithm["maximum new features"] .as<unsigned int>(); - - params->n_cells_h = algorithm["grid horiz cells"] .as<int>(); - params->n_cells_v = algorithm["grid vert cells"] .as<int>(); - params->min_response_new_feature = algorithm["min response new features"] .as<int>(); - - params->min_track_length_for_factor = algorithm["min track length for factor"].as<int>(); - - - YAML::Node noise = config["noise"]; - params->pixel_noise_std = noise ["pixel noise std"].as<double>(); - - return params; - } - else - { - WOLF_ERROR("Wrong processor type! Should be \"TRACKER BUNDLE ADJUSTMENT\""); - return nullptr; - } - return nullptr; -} - -// Register in the FactorySensor -const bool WOLF_UNUSED registered_prc_bundle_adjustment = FactoryParamsProcessor::registerCreator("ProcessorBundleAdjustment", createParamsProcessorBundleAdjustment); - -} // namespace [unnamed] - -} // namespace wolf diff --git a/src/yaml/sensor_camera_yaml.cpp b/src/yaml/sensor_camera_yaml.cpp index 50ef6c8409189d884984e760226bf496087e4bf2..dc945145b77343048be79f3dba6b9b28f4b6dc2f 100644 --- a/src/yaml/sensor_camera_yaml.cpp +++ b/src/yaml/sensor_camera_yaml.cpp @@ -26,12 +26,12 @@ * \author: jsola */ -// wolf yaml -#include "core/yaml/yaml_conversion.h" +// this plugin +#include "vision/sensor/sensor_camera.h" // wolf -#include "vision/sensor/sensor_camera.h" -#include "core/common/factory.h" +#include "core/sensor/factory_sensor.h" +#include "core/yaml/yaml_conversion.h" // yaml-cpp library #include <yaml-cpp/yaml.h>