本文整理汇总了C++中robot_state::RobotState::getJacobian方法的典型用法代码示例。如果您正苦于以下问题:C++ RobotState::getJacobian方法的具体用法?C++ RobotState::getJacobian怎么用?C++ RobotState::getJacobian使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类robot_state::RobotState
的用法示例。
在下文中一共展示了RobotState::getJacobian方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getManipulability
bool KinematicsMetrics::getManipulability(const robot_state::RobotState &state,
const robot_model::JointModelGroup *joint_model_group,
double &manipulability,
bool translation) const
{
// state.getJacobian() only works for chain groups.
if(!joint_model_group->isChain())
{
return false;
}
// Get joint limits penalty
double penalty = getJointLimitsPenalty(state, joint_model_group);
if (translation)
{
Eigen::MatrixXd jacobian = state.getJacobian(joint_model_group);
Eigen::JacobiSVD<Eigen::MatrixXd> svdsolver(jacobian.topLeftCorner(3,jacobian.cols()));
Eigen::MatrixXd singular_values = svdsolver.singularValues();
for (int i = 0; i < singular_values.rows(); ++i)
logDebug("moveit.kin_metrics: Singular value: %d %f",i,singular_values(i,0));
manipulability = penalty * singular_values.minCoeff()/singular_values.maxCoeff();
}
else
{
Eigen::MatrixXd jacobian = state.getJacobian(joint_model_group);
Eigen::JacobiSVD<Eigen::MatrixXd> svdsolver(jacobian);
Eigen::MatrixXd singular_values = svdsolver.singularValues();
for(int i=0; i < singular_values.rows(); ++i)
logDebug("moveit.kin_metrics: Singular value: %d %f",i,singular_values(i,0));
manipulability = penalty * singular_values.minCoeff()/singular_values.maxCoeff();
}
return true;
}
示例2: getManipulabilityIndex
bool KinematicsMetrics::getManipulabilityIndex(const robot_state::RobotState &state,
const robot_model::JointModelGroup *joint_model_group,
double &manipulability_index,
bool translation) const
{
// state.getJacobian() only works for chain groups.
if(!joint_model_group->isChain())
{
return false;
}
Eigen::MatrixXd jacobian = state.getJacobian(joint_model_group);
// Get joint limits penalty
double penalty = getJointLimitsPenalty(state, joint_model_group);
if (translation)
{
Eigen::MatrixXd jacobian_2 = jacobian.topLeftCorner(3,jacobian.cols());
Eigen::MatrixXd matrix = jacobian_2*jacobian_2.transpose();
// Get manipulability index
manipulability_index = penalty * sqrt(matrix.determinant());
}
else
{
Eigen::MatrixXd matrix = jacobian*jacobian.transpose();
// Get manipulability index
manipulability_index = penalty * sqrt(matrix.determinant());
}
return true;
}
示例3: getManipulabilityEllipsoid
bool KinematicsMetrics::getManipulabilityEllipsoid(const robot_state::RobotState &state,
const robot_model::JointModelGroup *joint_model_group,
Eigen::MatrixXcd &eigen_values,
Eigen::MatrixXcd &eigen_vectors) const
{
// state.getJacobian() only works for chain groups.
if(!joint_model_group->isChain())
{
return false;
}
Eigen::MatrixXd jacobian = state.getJacobian(joint_model_group);
Eigen::MatrixXd matrix = jacobian*jacobian.transpose();
Eigen::EigenSolver<Eigen::MatrixXd> eigensolver(matrix.block(0, 0, 3, 3));
eigen_values = eigensolver.eigenvalues();
eigen_vectors = eigensolver.eigenvectors();
return true;
}