From 219d8ad61327044737b51c7c0cb1e84d982e39cc Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 07:44:30 +0200 Subject: [PATCH 01/10] Fix warning around double to float conversion --- modules/imgproc/src/vpCircleHoughTransform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgproc/src/vpCircleHoughTransform.cpp b/modules/imgproc/src/vpCircleHoughTransform.cpp index a457731d1b..a7f1da7c21 100644 --- a/modules/imgproc/src/vpCircleHoughTransform.cpp +++ b/modules/imgproc/src/vpCircleHoughTransform.cpp @@ -228,7 +228,7 @@ vpCircleHoughTransform::edgeDetection(const vpImage &I) upperCannyThresh = vpImageFilter::computeCannyThreshold(I, lowerCannyThresh); } else if (m_algoParams.m_lowerCannyThresh < 0) { - lowerCannyThresh = upperCannyThresh / 3.; + lowerCannyThresh = upperCannyThresh / 3.f; } vpImageFilter::canny(I, m_edgeMap, m_algoParams.m_gaussianKernelSize, lowerCannyThresh, upperCannyThresh, m_algoParams.m_sobelKernelSize); #else From 7e7790ef91352247d9d196082ee3eea17dcd9807 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 07:46:41 +0200 Subject: [PATCH 02/10] Update Canny doc for lower threshold when < 0 --- modules/core/include/visp3/core/vpCannyEdgeDetection.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/include/visp3/core/vpCannyEdgeDetection.h b/modules/core/include/visp3/core/vpCannyEdgeDetection.h index f2788b45db..e75e95807e 100644 --- a/modules/core/include/visp3/core/vpCannyEdgeDetection.h +++ b/modules/core/include/visp3/core/vpCannyEdgeDetection.h @@ -261,6 +261,8 @@ class VISP_EXPORT vpCannyEdgeDetection * linked somehow to a strong edge point. * * \param[in] lowerThresh : The lower threshold: each point whose gradient is below this threshold is discarded. + * When lower threshold value is negative, Canny recommendation is applied to have the lower threshold 3 times lower + * than the upper threshold. * \param[in] upperThresh : The upper threshold: each point whose gradient is greater than this threshold is * said to be a strong edge point and is kept. */ From b90e5a288bb483f1d4eb6216247924984a15c435 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 07:47:29 +0200 Subject: [PATCH 03/10] Update to GPL2+ badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3000aed62f..68eddc51f5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

ViSP: Open source Visual Servoing Platform

[![Github Releases](https://img.shields.io/github/release/lagadic/visp.svg)](https://github.com/lagadic/visp/releases) -[![License](https://img.shields.io/badge/License-GPLv2-bright)](https://opensource.org/licenses/GPL-2.0) +[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://opensource.org/license/gpl-2-0/) Platform | Build Status | -------- | ------------ | From 5ef08a15b168924b3b9a2a9de5a9165fd399bda6 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 07:55:22 +0200 Subject: [PATCH 04/10] Fix typo --- modules/core/include/visp3/core/vpMatrix.h | 2 +- modules/core/src/math/matrix/vpColVector.cpp | 6 +++--- modules/core/src/math/matrix/vpRowVector.cpp | 6 +++--- .../core/src/math/transformation/vpTranslationVector.cpp | 6 +++--- modules/robot/src/real-robot/viper/vpRobotViper850.cpp | 2 +- script/megapose_server/install.py | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/core/include/visp3/core/vpMatrix.h b/modules/core/include/visp3/core/vpMatrix.h index d2426dd9a1..b334fc6f9f 100644 --- a/modules/core/include/visp3/core/vpMatrix.h +++ b/modules/core/include/visp3/core/vpMatrix.h @@ -573,7 +573,7 @@ vpMatrix M(R); /** @name Eigen values */ //@{ - // compute the eigen values using Lapack + // Compute the eigen values using Lapack. vpColVector eigenValues() const; void eigenValues(vpColVector &evalue, vpMatrix &evector) const; //@} diff --git a/modules/core/src/math/matrix/vpColVector.cpp b/modules/core/src/math/matrix/vpColVector.cpp index 56f39db6fd..ffddec970b 100644 --- a/modules/core/src/math/matrix/vpColVector.cpp +++ b/modules/core/src/math/matrix/vpColVector.cpp @@ -1492,9 +1492,9 @@ double vpColVector::sumSquare() const { return SimdVectorSumSquare(data, rowNum) /*! - Compute and return the Fronebius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. + Compute and return the Frobenius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. - \return The Fronebius norm if the vector is initialized, 0 otherwise. + \return The Frobenius norm if the vector is initialized, 0 otherwise. \sa infinityNorm() @@ -1746,7 +1746,7 @@ void vpColVector::insert(const vpColVector &v, unsigned int r, unsigned int c) /*! \deprecated This function is deprecated. You should rather use frobeniusNorm(). - Compute and return the Euclidean norm also called Fronebius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. + Compute and return the Euclidean norm also called Frobenius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. \return The Euclidean norm if the vector is initialized, 0 otherwise. diff --git a/modules/core/src/math/matrix/vpRowVector.cpp b/modules/core/src/math/matrix/vpRowVector.cpp index 9d26c9b3e0..5c7fd9a4e5 100644 --- a/modules/core/src/math/matrix/vpRowVector.cpp +++ b/modules/core/src/math/matrix/vpRowVector.cpp @@ -1087,9 +1087,9 @@ double vpRowVector::sumSquare() const } /*! - Compute and return the Fronebius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. + Compute and return the Frobenius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. - \return The Fronebius norm if the vector is initialized, 0 otherwise. + \return The Frobenius norm if the vector is initialized, 0 otherwise. */ double vpRowVector::frobeniusNorm() const { @@ -1102,7 +1102,7 @@ double vpRowVector::frobeniusNorm() const /*! \deprecated This function is deprecated. You should rather use frobeniusNorm(). - Compute and return the Euclidean norm also called Fronebius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. + Compute and return the Euclidean norm also called Frobenius norm \f$ ||v|| = \sqrt{ \sum{v_{i}^2}} \f$. \return The Euclidean norm if the vector is initialized, 0 otherwise. diff --git a/modules/core/src/math/transformation/vpTranslationVector.cpp b/modules/core/src/math/transformation/vpTranslationVector.cpp index 0545cd3570..19767242a8 100644 --- a/modules/core/src/math/transformation/vpTranslationVector.cpp +++ b/modules/core/src/math/transformation/vpTranslationVector.cpp @@ -714,7 +714,7 @@ vpRowVector vpTranslationVector::t() const /*! \deprecated This function is deprecated. You should rather use frobeniusNorm(). - Compute and return the Euclidean norm also called Fronebius nom of the translation vector + Compute and return the Euclidean norm also called Frobenius nom of the translation vector \f$ ||t|| = \sqrt{ \sum{t_{i}^2}} \f$. \return The Euclidean norm if the vector is initialized, 0 otherwise. @@ -726,9 +726,9 @@ double vpTranslationVector::euclideanNorm() const { return frobeniusNorm(); } #endif /*! - Compute and return the Fronebius norm \f$ ||t|| = \sqrt{ \sum{t_{i}^2}} \f$. + Compute and return the Frobenius norm \f$ ||t|| = \sqrt{ \sum{t_{i}^2}} \f$. - \return The Fronebius norm if the vector is initialized, 0 otherwise. + \return The Frobenius norm if the vector is initialized, 0 otherwise. */ double vpTranslationVector::frobeniusNorm() const { diff --git a/modules/robot/src/real-robot/viper/vpRobotViper850.cpp b/modules/robot/src/real-robot/viper/vpRobotViper850.cpp index 9ae251a363..fc7e3b9919 100644 --- a/modules/robot/src/real-robot/viper/vpRobotViper850.cpp +++ b/modules/robot/src/real-robot/viper/vpRobotViper850.cpp @@ -268,7 +268,7 @@ void vpRobotViper850::init(void) throw(vpException(vpException::ioError, "ATI F/T calib file \"%s\" doesn't exist", calibfile.c_str())); #else throw(vpException(vpException::ioError, "You don't have access to Viper850 " - "data to retrive ATI F/T calib " + "data to retrieve ATI F/T calib " "file")); #endif m_ati.setCalibrationFile(calibfile); diff --git a/script/megapose_server/install.py b/script/megapose_server/install.py index 48397fd8b2..6ecf305984 100644 --- a/script/megapose_server/install.py +++ b/script/megapose_server/install.py @@ -30,7 +30,7 @@ def get_megapose_env_path(megapose_env: str) -> Union[Path, None]: def get_megapose_bin_conda_env(megapose_env: str) -> Path: ''' - Retrive the bin folder of a conda environment + Retrieve the bin folder of a conda environment ''' megapose_env_path = get_megapose_env_path(megapose_env) assert megapose_env_path is not None From cba97ed94d4c169a19f1955af26fd0ce934e161d Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 09:16:16 +0200 Subject: [PATCH 05/10] Remove unused private field 'baseDirectory' --- modules/vs/include/visp3/vs/vpServoData.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/vs/include/visp3/vs/vpServoData.h b/modules/vs/include/visp3/vs/vpServoData.h index 9d3ea63b95..b67f2bb1bd 100644 --- a/modules/vs/include/visp3/vs/vpServoData.h +++ b/modules/vs/include/visp3/vs/vpServoData.h @@ -53,10 +53,7 @@ */ class VISP_EXPORT vpServoData { - private: - char baseDirectory[FILENAME_MAX]; - std::ofstream velocityFile; std::ofstream errorFile; std::ofstream errorNormFile; From a774dbe99730bfd3d268a1038f5f670f44598a16 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 09:23:10 +0200 Subject: [PATCH 06/10] vs code preserve comments indentation --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index aa4bed3ea2..1a735c4e79 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -126,6 +126,6 @@ "C_Cpp.formatting": "vcFormat", "C_Cpp.vcFormat.space.aroundBinaryOperator": "ignore", "editor.comments.insertSpace": true, - "C_Cpp.vcFormat.indent.preserveComments": false, + "C_Cpp.vcFormat.indent.preserveComments": true, "C_Cpp.doxygen.generatedStyle": "/*!" } From 6c62eb5310eb5a9ae643962c0b895d73d7bc4f3f Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 14:56:24 +0200 Subject: [PATCH 07/10] Fix typo --- cmake/FindMyOpenCV.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/FindMyOpenCV.cmake b/cmake/FindMyOpenCV.cmake index 9a77010114..2be344b3ea 100644 --- a/cmake/FindMyOpenCV.cmake +++ b/cmake/FindMyOpenCV.cmake @@ -57,7 +57,7 @@ macro(vp_get_opencv_version_from_hpp FILENAME DEFINE VAR) set(${__var} 0) endif() else() - message("Warning: Cannot retrive OpenCV version from non existing file ${FILENAME}. This may produce build issues.") + message("Warning: Cannot retrieve OpenCV version from non existing file ${FILENAME}. This may produce build issues.") set(${__var} 0) endif() endmacro() @@ -201,4 +201,3 @@ if(CMAKE_TOOLCHAIN_FILE AND I_AM_A_ROBOT) endforeach() endif() endif() - From 9de1bd89a880311266f3af355327125139f886fc Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 14:59:00 +0200 Subject: [PATCH 08/10] For a given msvc compiler introduce backward compatibility If a project is build with msvc17, it is now possible to use ViSP build with msvc16 --- .../templates/VISPConfig.root-WIN32.cmake.in | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/cmake/templates/VISPConfig.root-WIN32.cmake.in b/cmake/templates/VISPConfig.root-WIN32.cmake.in index d038ba76a2..f814e50a91 100644 --- a/cmake/templates/VISPConfig.root-WIN32.cmake.in +++ b/cmake/templates/VISPConfig.root-WIN32.cmake.in @@ -64,9 +64,27 @@ # include(${VISP_USE_FILE}) # endif() # -# ############################################################################# +function(check_one_config RES) + set(${RES} "" PARENT_SCOPE) + if(NOT VISP_RUNTIME OR NOT VISP_ARCH) + return() + endif() + set(candidates) + if(VISP_STATIC) + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/staticlib") + endif() + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/lib") + foreach(c ${candidates}) + set(p "${VISP_CONFIG_PATH}/${c}") + if(EXISTS "${p}/VISPConfig.cmake") + set(${RES} "${p}" PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + # similar code exist in VISPDetectPlatform.cmake if(DEFINED VISP_ARCH AND DEFINED VISP_RUNTIME) # custom overridden values @@ -92,10 +110,34 @@ elseif(MSVC) set(VISP_RUNTIME vc14) elseif(MSVC_VERSION MATCHES "^191[0-9]$") set(VISP_RUNTIME vc15) + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() elseif(MSVC_VERSION MATCHES "^192[0-9]$") set(VISP_RUNTIME vc16) + check_one_config(has_VS2019) + if(NOT has_VS2019) + set(VISP_RUNTIME vc15) # selecting previous compatible runtime version + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() + endif() elseif(MSVC_VERSION MATCHES "^193[0-9]$") set(VISP_RUNTIME vc17) + check_one_config(has_VS2022) + if(NOT has_VS2022) + set(VISP_RUNTIME vc16) + check_one_config(has_VS2019) + if(NOT has_VS2019) + set(VISP_RUNTIME vc15) # selecting previous compatible runtime version + check_one_config(has_VS2017) + if(NOT has_VS2017) + set(VISP_RUNTIME vc14) # selecting previous compatible runtime version + endif() + endif() + endif() else() message(WARNING "ViSP does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set VISP_RUNTIME") endif() From 18e9d6bcf9fa3b21109b0c957834b003a56dfb53 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 15 Sep 2023 18:42:20 +0200 Subject: [PATCH 09/10] Remove cmake debug message --- cmake/FindWS2_32.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/FindWS2_32.cmake b/cmake/FindWS2_32.cmake index 853caf9fc1..cf8a34a184 100644 --- a/cmake/FindWS2_32.cmake +++ b/cmake/FindWS2_32.cmake @@ -64,7 +64,6 @@ if(WIN32 AND NOT CYGWIN) set(WS2_32_LIBNAME "ws2_32.lib") check_library_exists(${WS2_32_LIBNAME} getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities if(HAVE_LIBWS2_32) - message("-----------> ${WS2_32_LIBNAME} is found") set(WS2_32_LIBRARY ${WS2_32_LIBNAME}) set(WS2_32_FOUND TRUE) else() From c05bdd9dda9c6c2eef837dea00854263654a2a69 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Sun, 17 Sep 2023 09:24:43 +0200 Subject: [PATCH 10/10] Fix msvc build detection with backward compiler compatibility --- .../templates/VISPConfig.root-WIN32.cmake.in | 52 ++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/cmake/templates/VISPConfig.root-WIN32.cmake.in b/cmake/templates/VISPConfig.root-WIN32.cmake.in index f814e50a91..b9ec2a42ea 100644 --- a/cmake/templates/VISPConfig.root-WIN32.cmake.in +++ b/cmake/templates/VISPConfig.root-WIN32.cmake.in @@ -66,6 +66,36 @@ # ############################################################################# +if(NOT DEFINED VISP_STATIC) + # look for global setting + if (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) + set(VISP_STATIC OFF) + else() + set(VISP_STATIC ON) + endif() +endif() + +function(check_one_config RES) + set($ { RES } "" PARENT_SCOPE) + if (NOT VISP_RUNTIME OR NOT VISP_ARCH) + return() + endif() + set(candidates) + if (VISP_STATIC) + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/staticlib") + endif() + list(APPEND candidates "${VISP_ARCH}/${VISP_RUNTIME}/lib") + foreach(c $ { candidates }) + set(p "${VISP_CONFIG_PATH}/${c}") + if (EXISTS "${p}/VISPConfig.cmake") + set($ { RES } "${p}" PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + +get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + function(check_one_config RES) set(${RES} "" PARENT_SCOPE) if(NOT VISP_RUNTIME OR NOT VISP_ARCH) @@ -151,33 +181,17 @@ elseif(MINGW) endif() endif() -if(CMAKE_VERSION VERSION_GREATER 2.6.2) - unset(VISP_CONFIG_PATH CACHE) -endif() +check_one_config(VISP_LIB_PATH) if(NOT VISP_FIND_QUIETLY) message(STATUS "ViSP ARCH: ${VISP_ARCH}") message(STATUS "ViSP RUNTIME: ${VISP_RUNTIME}") -endif() - -get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) -if(VISP_RUNTIME AND VISP_ARCH) - if(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") - elseif(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") - elseif(VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") - elseif(VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") - set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") - endif() + message(STATUS "ViSP STATIC: ${VISP_STATIC}") endif() if(VISP_LIB_PATH AND EXISTS "${VISP_LIB_PATH}/VISPConfig.cmake") include("${VISP_LIB_PATH}/VISPConfig.cmake") - set(VISP_FOUND TRUE CACHE BOOL "" FORCE) - if(NOT VISP_FIND_QUIETLY) message(STATUS "Found VISP ${VISP_VERSION} in ${VISP_LIB_PATH}") if(NOT VISP_LIB_PATH MATCHES "/staticlib") @@ -193,5 +207,5 @@ else() You should manually point CMake variable VISP_DIR to your build of ViSP library." ) endif() - set(VISP_FOUND FALSE CACHE BOOL "" FORCE) + set(VISP_FOUND FALSE) endif()