Skip to content

Commit 423206c

Browse files
committed
Allow almostEqualRelativeAndAbs handle empty vectors
1 parent 9cbb014 commit 423206c

File tree

1 file changed

+5
-0
lines changed
  • tesseract_common/include/tesseract_common

1 file changed

+5
-0
lines changed

tesseract_common/include/tesseract_common/utils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,11 @@ inline bool almostEqualRelativeAndAbs(const Eigen::Ref<const Eigen::VectorXd>& v
384384
double max_diff,
385385
double max_rel_diff = std::numeric_limits<double>::epsilon())
386386
{
387+
if (v1.size() == 0 && v2.size() == 0)
388+
return true;
389+
if (v1.size() != v2.size())
390+
return false;
391+
387392
Eigen::ArrayWrapper<const Eigen::Ref<const Eigen::VectorXd>> a1 = v1.array();
388393
Eigen::ArrayWrapper<const Eigen::Ref<const Eigen::VectorXd>> a2 = v2.array();
389394

0 commit comments

Comments
 (0)