#include <algorithm>
#include <assert.h>
#include <iostream>
#include <math.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
Go to the source code of this file.
Macros | |
#define | ASSERT_ISOMETRY(transform) |
Assert that the given transform is an isometry. More... | |
#define | CHECK_ISOMETRY_PRECISION Eigen::NumTraits<double>::dummy_precision() |
This file provides functions and macros that can be used to verify that an Eigen::Isometry3d is really an isometry. Eigen itself doesn't do the checks because they're expensive. If the isometry object is constructed in a wrong way (e.g. from an AngleAxisd with non-unit axis), it can represent a non-isometry. But some methods in the Isometry3d class perform isometry-specific operations which return wrong results when called on a non-isometry. E.g. for isometries, .linear() and .rotation() should be the same, but for non-isometries, the result of .linear() contains also the scaling factor, whether .rotation() is only the rotation part. More... | |
Functions | |
bool | checkIsometry (const Eigen::Isometry3d &transform, const double precision=CHECK_ISOMETRY_PRECISION, const bool printError=true) |
Check whether the given transform is really (mathematically) an isometry. More... | |
#define ASSERT_ISOMETRY | ( | transform | ) |
Assert that the given transform is an isometry.
Definition at line 109 of file check_isometry.h.
#define CHECK_ISOMETRY_PRECISION Eigen::NumTraits<double>::dummy_precision() |
This file provides functions and macros that can be used to verify that an Eigen::Isometry3d is really an isometry. Eigen itself doesn't do the checks because they're expensive. If the isometry object is constructed in a wrong way (e.g. from an AngleAxisd with non-unit axis), it can represent a non-isometry. But some methods in the Isometry3d class perform isometry-specific operations which return wrong results when called on a non-isometry. E.g. for isometries, .linear() and .rotation() should be the same, but for non-isometries, the result of .linear() contains also the scaling factor, whether .rotation() is only the rotation part.
These checks are primarily meant to be performed only in debug mode (via the ASSERT_ISOMETRY macro), but you can call checkIsometry() even in release mode. This check should be mainly performed on transforms input by the user.
The default precision to which the transform has to correspond to an isometry.
Definition at line 60 of file check_isometry.h.
|
inline |
Check whether the given transform is really (mathematically) an isometry.
transform | The possibly non-isometric transform. |
precision | Precision to which the transform has to correspond to an isometry (element-wise). |
printError | Whether an error should be printed to std::cerr with details about the false isometry. |
Definition at line 70 of file check_isometry.h.