Skip to content

Commit

Permalink
Merge branch 'master' into vpCircleHoughTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
rlagneau committed Aug 17, 2023
2 parents 245b170 + 83555f3 commit 7f34041
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ VP_CHECK_PACKAGE(IsInf)
VP_CHECK_PACKAGE(Round)
VP_CHECK_PACKAGE(Erfc)
VP_CHECK_PACKAGE(Strtof)
VP_CHECK_PACKAGE(IsFinite)
VP_CHECK_PACKAGE(Log1p)

#----------------------------------------------------------------------
Expand Down
40 changes: 40 additions & 0 deletions cmake/FindIsFinite.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#############################################################################
#
# ViSP, open source Visual Servoing Platform software.
# Copyright (C) 2005 - 2023 by Inria. All rights reserved.
#
# This software is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# See the file LICENSE.txt at the root directory of this source
# distribution for additional information about the GNU GPL.
#
# For using ViSP with software that can not be combined with the GNU
# GPL, please contact Inria about acquiring a ViSP Professional
# Edition License.
#
# See http://visp.inria.fr for more information.
#
# This software was developed at:
# Inria Rennes - Bretagne Atlantique
# Campus Universitaire de Beaulieu
# 35042 Rennes Cedex
# France
#
# If you have questions regarding the use of this file, please contact
# Inria at visp@inria.fr
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Description:
# Try to find the isfinite macro, the std::isfinite function or the _finite function.
#
#############################################################################

include(VISPFindUtils)

check_math_expr("isfinite(1.0)" "<math.h>" HAVE_FUNC_ISFINITE)
check_math_expr("std::isfinite(1.0)" "<cmath>" HAVE_FUNC_STD_ISFINITE)
check_math_expr("_finite(1.0)" "<float.h>" HAVE_FUNC__FINITE)
2 changes: 1 addition & 1 deletion cmake/FindIsInf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
include(VISPFindUtils)

check_math_expr("isinf(1.0)" "<math.h>" HAVE_FUNC_ISINF)
check_math_expr("std::isinf(1.0))" "<cmath>" HAVE_FUNC_STD_ISINF)
check_math_expr("std::isinf(1.0)" "<cmath>" HAVE_FUNC_STD_ISINF)
4 changes: 2 additions & 2 deletions cmake/FindIsNaN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
include(VISPFindUtils)

check_math_expr("isnan(1.0)" "<math.h>" HAVE_FUNC_ISNAN)
check_math_expr("std::isnan(1.0))" "<cmath>" HAVE_FUNC_STD_ISNAN)
check_math_expr("_isnan(1.0))" "<float.h>" HAVE_FUNC__ISNAN)
check_math_expr("std::isnan(1.0)" "<cmath>" HAVE_FUNC_STD_ISNAN)
check_math_expr("_isnan(1.0)" "<float.h>" HAVE_FUNC__ISNAN)
18 changes: 10 additions & 8 deletions modules/core/test/math/testHomogeneousMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,16 @@ TEST_CASE("ENU to NED conversion", "[enu2ned]")
TEST_CASE("vpHomogenousMatrix * vpRotationMatrix", "[operator*]")
{
// Test rotation_matrix * homogeneous_matrix
vpHomogeneousMatrix _1_M_2_;
_1_M_2_[0][0] = 0.9835; _1_M_2_[0][1] = -0.0581; _1_M_2_[0][2] = 0.1716; _1_M_2_[0][3] = 0.0072;
_1_M_2_[1][0] = -0.0489; _1_M_2_[1][1] = -0.9972; _1_M_2_[1][2] = -0.0571; _1_M_2_[1][3] = 0.0352;
_1_M_2_[2][0] = 0.1744; _1_M_2_[2][1] = 0.0478; _1_M_2_[2][2] = -0.9835; _1_M_2_[2][3] = 0.9470;
vpHomogeneousMatrix _2_M_3_truth;
_2_M_3_truth[0][0] = 0.9835; _2_M_3_truth[0][1] = -0.0581; _2_M_3_truth[0][2] = 0.1716; _2_M_3_truth[0][3] = 0;
_2_M_3_truth[1][0] = -0.0489; _2_M_3_truth[1][1] = -0.9972; _2_M_3_truth[1][2] = -0.0571; _2_M_3_truth[1][3] = 0;
_2_M_3_truth[2][0] = 0.1744; _2_M_3_truth[2][1] = 0.0478; _2_M_3_truth[2][2] = -0.9835; _2_M_3_truth[2][3] = 0;
vpHomogeneousMatrix _1_M_2_ {
0.9835, -0.0581, 0.1716, 0.0072,
-0.0489, -0.9972, -0.0571, 0.0352,
0.1744, 0.0478, -0.9835, 0.9470
};
vpHomogeneousMatrix _2_M_3_truth {
0.9835, -0.0581, 0.1716, 0,
-0.0489, -0.9972, -0.0571, 0,
0.1744, 0.0478, -0.9835, 0
};

vpRotationMatrix _2_R_3_ = _2_M_3_truth.getRotationMatrix();
vpHomogeneousMatrix _1_M_3_(_1_M_2_* _2_R_3_);
Expand Down

0 comments on commit 7f34041

Please sign in to comment.