本文整理汇总了C++中TransformationParameters::topRightCorner方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformationParameters::topRightCorner方法的具体用法?C++ TransformationParameters::topRightCorner怎么用?C++ TransformationParameters::topRightCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformationParameters
的用法示例。
在下文中一共展示了TransformationParameters::topRightCorner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void TransformationCheckersImpl<T>::BoundTransformationChecker::check(const TransformationParameters& parameters, bool& iterate)
{
typedef typename PointMatcher<T>::ConvergenceError ConvergenceError;
if (parameters.rows() == 4)
{
const Quaternion currentRotation = Quaternion(Eigen::Matrix<T,3,3>(parameters.topLeftCorner(3,3)));
this->conditionVariables(0) = currentRotation.angularDistance(initialRotation3D);
}
else if (parameters.rows() == 3)
{
const T currentRotation(acos(parameters(0,0)));
this->conditionVariables(0) = normalizeAngle(currentRotation - initialRotation2D);
}
else
assert(false);
const unsigned int nbRows = parameters.rows()-1;
const Vector currentTranslation = parameters.topRightCorner(nbRows,1);
this->conditionVariables(1) = (currentTranslation - initialTranslation).norm();
if (this->conditionVariables(0) > this->limits(0) || this->conditionVariables(1) > this->limits(1))
{
ostringstream oss;
oss << "limit out of bounds: ";
oss << "rot: " << this->conditionVariables(0) << "/" << this->limits(0) << " ";
oss << "tr: " << this->conditionVariables(1) << "/" << this->limits(1);
throw ConvergenceError(oss.str());
}
}
示例2: ConvergenceError
void TransformationCheckersImpl<T>::DifferentialTransformationChecker::check(const TransformationParameters& parameters, bool& iterate)
{
typedef typename PointMatcher<T>::ConvergenceError ConvergenceError;
rotations.push_back(Quaternion(Eigen::Matrix<T,3,3>(parameters.topLeftCorner(3,3))));
const unsigned int nbRows = parameters.rows()-1;
translations.push_back(parameters.topRightCorner(nbRows,1));
this->conditionVariables.setZero(2);
if(rotations.size() > smoothLength)
{
for(size_t i = rotations.size()-1; i >= rotations.size()-smoothLength; i--)
{
//Compute the mean derivative
this->conditionVariables(0) += anyabs(rotations[i].angularDistance(rotations[i-1]));
this->conditionVariables(1) += anyabs((translations[i] - translations[i-1]).norm());
}
this->conditionVariables /= smoothLength;
if(this->conditionVariables(0) < this->limits(0) && this->conditionVariables(1) < this->limits(1))
iterate = false;
}
//std::cout << "Abs Rotation: " << this->conditionVariables(0) << " / " << this->limits(0) << std::endl;
//std::cout << "Abs Translation: " << this->conditionVariables(1) << " / " << this->limits(1) << std::endl;
if (boost::math::isnan(this->conditionVariables(0)))
throw ConvergenceError("abs rotation norm not a number");
if (boost::math::isnan(this->conditionVariables(1)))
throw ConvergenceError("abs translation norm not a number");
}
示例3: m
void TransformationCheckersImpl<T>::DifferentialTransformationChecker::init(const TransformationParameters& parameters, bool& iterate)
{
this->conditionVariables.setZero(2);
rotations.clear();
translations.clear();
if (parameters.rows() == 4)
{
rotations.push_back(Quaternion(Eigen::Matrix<T,3,3>(parameters.topLeftCorner(3,3))));
}
else
{
// Handle the 2D case
Eigen::Matrix<T,3,3> m(Matrix::Identity(3,3));
m.topLeftCorner(2,2) = parameters.topLeftCorner(2,2);
rotations.push_back(Quaternion(m));
}
const unsigned int nbRows = parameters.rows()-1;
translations.push_back(parameters.topRightCorner(nbRows,1));
}