Macros | Functions
check_isometry.h File Reference
#include <algorithm>
#include <assert.h>
#include <iostream>
#include <math.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
Include dependency graph for check_isometry.h:
This graph shows which files directly or indirectly include this file:

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...
 

Macro Definition Documentation

◆ ASSERT_ISOMETRY

#define ASSERT_ISOMETRY (   transform)
Value:
{ \
assert(!"Invalid isometry transform"); \
}

Assert that the given transform is an isometry.

Definition at line 109 of file check_isometry.h.

◆ CHECK_ISOMETRY_PRECISION

#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.

Function Documentation

◆ checkIsometry()

bool checkIsometry ( const Eigen::Isometry3d &  transform,
const double  precision = CHECK_ISOMETRY_PRECISION,
const bool  printError = true 
)
inline

Check whether the given transform is really (mathematically) an isometry.

Parameters
transformThe possibly non-isometric transform.
precisionPrecision to which the transform has to correspond to an isometry (element-wise).
printErrorWhether an error should be printed to std::cerr with details about the false isometry.
Returns
Whether the given transform is close to an isometry or not.

Definition at line 70 of file check_isometry.h.

CHECK_ISOMETRY_PRECISION
#define CHECK_ISOMETRY_PRECISION
This file provides functions and macros that can be used to verify that an Eigen::Isometry3d is reall...
Definition: check_isometry.h:60
checkIsometry
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.
Definition: check_isometry.h:70


geometric_shapes
Author(s): Ioan Sucan , Gil Jones
autogenerated on Tue Aug 13 2024 02:40:57