diff --git a/CMakeLists.txt b/CMakeLists.txt index e7f34ccf0332605785330279b5337edd29cf5789..d39a73dd07c153a8b2fa532be409da1ad1335648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,7 @@ SET(HDRS SET(HDRS ${HDRS} include/${PROJECT_NAME}/corner_falko_2d.h include/${PROJECT_NAME}/loop_closure_falko.h + include/${PROJECT_NAME}/scene_falko_base.h include/${PROJECT_NAME}/scene_falko.h include/${PROJECT_NAME}/match_loop_closure_scene.h) ENDIF(falkolib_FOUND) diff --git a/include/laser_scan_utils/scene_falko.h b/include/laser_scan_utils/scene_falko.h index 9719b465b607ba404e4f1c8b87ea9d6293841f5a..3775176ced0e4c8b0688a6113344171b49d0c8ec 100644 --- a/include/laser_scan_utils/scene_falko.h +++ b/include/laser_scan_utils/scene_falko.h @@ -38,7 +38,7 @@ /************************** * LaserScanUtils includes * **************************/ -#include "scene_base.h" +#include "scene_falko_base.h" /************************** * Falko includes * @@ -53,13 +53,8 @@ namespace laserscanutils { typedef falkolib::BSC bsc; typedef falkolib::CGH cgh; -template <typename D> struct SceneFalko : public SceneBase +template <typename D> struct SceneFalko : public SceneFalkoBase { - std::vector<falkolib::FALKO> keypoints_list_; - std::vector<falkolib::FALKO> keypoints_list_mid_point_; - std::vector<falkolib::FALKO> keypoints_list_transl_rot_; - std::vector<falkolib::FALKO> keypoints_list_rotated_; - std::vector<falkolib::FALKO> keypoints_list_rotated_reverse_; std::vector<D> descriptors_list_; std::vector<D> descriptors_list_rotated; std::vector<double> angle_rotation_; diff --git a/include/laser_scan_utils/scene_falko_base.h b/include/laser_scan_utils/scene_falko_base.h new file mode 100644 index 0000000000000000000000000000000000000000..62f79159c46fdd58b60b1bdf29e72018c802c221 --- /dev/null +++ b/include/laser_scan_utils/scene_falko_base.h @@ -0,0 +1,56 @@ +//--------LICENSE_START-------- +// +// Copyright (C) 2020,2021,2022,2023,2024 Institut de Robòtica i Informà tica Industrial, CSIC-UPC. +// Authors: Joan Vallvé Navarro (jvallve@iri.upc.edu) +// All rights reserved. +// +// This file is part of laser_scan_utils +// laser_scan_utils 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-------- + +#ifndef SCENE_FALKO_BASE_H_ +#define SCENE_FALKO_BASE_H_ + +#include <fstream> +#include <iostream> +#include <iterator> +#include <list> +#include <memory> + +/************************** + * LaserScanUtils includes * + **************************/ +#include "scene_base.h" + +/************************** + * Falko includes * + **************************/ + +#include <falkolib/Feature/FALKO.h> + +namespace laserscanutils { + +struct SceneFalkoBase : public SceneBase +{ + std::vector<falkolib::FALKO> keypoints_list_; + std::vector<falkolib::FALKO> keypoints_list_mid_point_; + std::vector<falkolib::FALKO> keypoints_list_transl_rot_; + std::vector<falkolib::FALKO> keypoints_list_rotated_; + std::vector<falkolib::FALKO> keypoints_list_rotated_reverse_; +}; + +} /* namespace laserscanutils */ + +#endif /* SCENE_FALKO_H_ */ diff --git a/src/icp.cpp b/src/icp.cpp index 8909a8804dfbf7e07a67b5f8e7ec417faea8c762..ba0242017742660b114d6e8fe0d7fe41a854e5a2 100644 --- a/src/icp.cpp +++ b/src/icp.cpp @@ -205,7 +205,7 @@ icpOutput ICP::align(const LaserScan &_current_ls, if (_icp_params.verbose and not result.valid) { - std::cout << "Invalid result, trying again!" << std::endl; + std::cout << (result.attempts < _icp_params.attempts ? "Invalid result, trying again!" : "Invalid result") << std::endl; } } while (not result.valid and result.attempts < _icp_params.attempts);