Skip to content
Snippets Groups Projects
Commit 550f91a6 authored by Mederic Fourmy's avatar Mederic Fourmy
Browse files

[skip-ci] Merge branch 'devel' into 22-adapt-to-core-cmakelists-txt-refactor

parents e422692a ac3d8360
No related branches found
No related tags found
2 merge requests!36After cmake and const refactor,!33Resolve "Adapt to core CMakeLists.txt refactor"
......@@ -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
......
//--------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
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment