本文整理汇总了C++中Measurement::GetArcLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Measurement::GetArcLength方法的具体用法?C++ Measurement::GetArcLength怎么用?C++ Measurement::GetArcLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Measurement
的用法示例。
在下文中一共展示了Measurement::GetArcLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeSingleShapeError
double CTRCalibration::ComputeSingleShapeError(CTR* robot, MechanicsBasedKinematics* kinematics, const Measurement& meas, double& max_error_current, bool solveKin)
{
double rotation[3] = {0};
double translation[3] = {0};
double relativeConf[5];
memcpy(relativeConf, meas.GetConfiguration().data(), sizeof(double) * 5);
relativeConf[0] *= M_PI/180.0;
relativeConf[1] *= M_PI/180.0;
relativeConf[3] *= M_PI/180.0;
::std::vector<::Eigen::Vector3d> positionsAlongRobotExp = meas.GetShapeEig();
::std::vector<::Eigen::Vector3d> positionsAlongRobotModel;
::Eigen::Vector3d error;
MechanicsBasedKinematics::RelativeToAbsolute(robot, relativeConf, rotation, translation);
::std::vector<double> robot_length_parameter = meas.GetArcLength();
if(solveKin)
if(!kinematics->ComputeKinematics(rotation, translation))
return -1.0;
kinematics->GetRobotShape(robot_length_parameter, positionsAlongRobotModel);
double sum = 0;
for(int i = 0; i < positionsAlongRobotModel.size(); ++i)
{
error = positionsAlongRobotExp[i] - positionsAlongRobotModel[i];
if (error.norm() > max_error_current)
max_error_current = error.norm();
sum += error.norm() * error.norm();
}
return sum/positionsAlongRobotModel.size();
//error = positionsAlongRobotExp[positionsAlongRobotExp.size() - 1] - positionsAlongRobotModel[positionsAlongRobotModel.size() - 1];
//max_error_current = error.norm();
//return max_error_current;
}