Classes | Functions | Variables
stomp_moveit::utils::kinematics Namespace Reference

Utility functions related to finding Inverse Kinematics solutions. More...

Classes

struct  KinematicConfig

Functions

static void calculateDampedPseudoInverse (const Eigen::MatrixXd &jacb, Eigen::MatrixXd &jacb_pseudo_inv, double eps=0.011, double lambda=0.01)
 Calculates the damped pseudo inverse of a matrix using singular value decomposition.
static bool computeJacobianNullSpace (moveit::core::RobotStatePtr state, std::string group, std::string tool_link, const Eigen::ArrayXi &constrained_dofs, const Eigen::VectorXd &joint_pose, Eigen::MatrixXd &jacb_nullspace)
 Convenience function to calculate the Jacobian's null space matrix for an under constrained tool cartesian pose.
static void computeTwist (const Eigen::Affine3d &p0, const Eigen::Affine3d &pf, const Eigen::ArrayXi &nullity, Eigen::VectorXd &twist)
 Computes the twist vector [vx vy vz wx wy wz]' relative to the current tool coordinate system. The rotational part is composed of the product between the angle times the axis about which it rotates.
static bool createKinematicConfig (const moveit::core::JointModelGroup *group, const moveit_msgs::PositionConstraint &pc, const moveit_msgs::OrientationConstraint &oc, const Eigen::VectorXd &init_joint_pose, KinematicConfig &kc)
 Populates a Kinematic Config struct from the position and orientation constraints requested;.
static bool createKinematicConfig (const moveit::core::JointModelGroup *group, const moveit_msgs::PositionConstraint &pc, const moveit_msgs::OrientationConstraint &oc, const moveit_msgs::RobotState &start_state, KinematicConfig &kc)
 Populates a Kinematic Config struct from the position and orientation constraints requested;.
static void reduceJacobian (const Eigen::MatrixXd &jacb, const std::vector< int > &indices, Eigen::MatrixXd &jacb_reduced)
 Convenience function to remove entire rows of the Jacobian matrix.
static bool solveIK (moveit::core::RobotStatePtr robot_state, const std::string &group_name, const Eigen::Array< int, 6, 1 > &constrained_dofs, const Eigen::ArrayXd &joint_update_rates, const Eigen::Array< double, 6, 1 > &cartesian_convergence_thresholds, const Eigen::ArrayXd &null_proj_weights, const Eigen::VectorXd &null_space_vector, int max_iterations, const Eigen::Affine3d &tool_goal_pose, const Eigen::VectorXd &init_joint_pose, Eigen::VectorXd &joint_pose)
 Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose and can also apply a vector onto the null space of the jacobian in order to meet a secondary objective. It also checks for joint limits.
static bool solveIK (moveit::core::RobotStatePtr robot_state, const std::string &group_name, const KinematicConfig &config, Eigen::VectorXd &joint_pose)
 Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose and can also apply a vector onto the null space of the jacobian in order to meet a secondary objective. It also checks for joint limits.
static bool solveIK (moveit::core::RobotStatePtr robot_state, const std::string &group_name, const Eigen::ArrayXi &constrained_dofs, const Eigen::ArrayXd &joint_update_rates, const Eigen::ArrayXd &cartesian_convergence_thresholds, int max_iterations, const Eigen::Affine3d &tool_goal_pose, const Eigen::VectorXd &init_joint_pose, Eigen::VectorXd &joint_pose)
 Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose.

Variables

static const double EPSILON = 0.011
 Used in dampening the matrix pseudo inverse calculation.
static const double LAMBDA = 0.01
 Used in dampening the matrix pseudo inverse calculation.

Detailed Description

Utility functions related to finding Inverse Kinematics solutions.


Function Documentation

static void stomp_moveit::utils::kinematics::calculateDampedPseudoInverse ( const Eigen::MatrixXd &  jacb,
Eigen::MatrixXd &  jacb_pseudo_inv,
double  eps = 0.011,
double  lambda = 0.01 
) [static]

Calculates the damped pseudo inverse of a matrix using singular value decomposition.

Parameters:
jacbThe jacobian matrix
jacb_pseudo_invThe pseudo inverse of the matrix
epsUsed to threshold the singular values
lambdaUsed in preventing division by small singular values from generating large numbers.

Definition at line 250 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::computeJacobianNullSpace ( moveit::core::RobotStatePtr  state,
std::string  group,
std::string  tool_link,
const Eigen::ArrayXi &  constrained_dofs,
const Eigen::VectorXd &  joint_pose,
Eigen::MatrixXd &  jacb_nullspace 
) [static]

Convenience function to calculate the Jacobian's null space matrix for an under constrained tool cartesian pose.

Parameters:
stateA pointer to the robot state.
groupThe name of the kinematic group.
tool_linkThe tool link name
constrained_dofsA vector of the form [x y z rx ry rz] filled with 0's and 1's to indicate an unconstrained or fully constrained DOF.
joint_poseThe joint pose at which to compute the jacobian matrix.
jacb_nullspaceThe jacobian null space matrix [num_dimensions x num_dimensions]
Returns:
True if a solution was found, false otherwise.

Definition at line 492 of file kinematics.h.

static void stomp_moveit::utils::kinematics::computeTwist ( const Eigen::Affine3d &  p0,
const Eigen::Affine3d &  pf,
const Eigen::ArrayXi &  nullity,
Eigen::VectorXd &  twist 
) [static]

Computes the twist vector [vx vy vz wx wy wz]' relative to the current tool coordinate system. The rotational part is composed of the product between the angle times the axis about which it rotates.

Parameters:
p0start tool pose in world coordinates
pffinal tool pose in world coordinates
nullityarray of 0's and 1's indicating which cartesian DOF's are unconstrained (0)
twistthe twist vector in tool coordinates (change from p0 to pf) [6 x 1].

Definition at line 191 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::createKinematicConfig ( const moveit::core::JointModelGroup group,
const moveit_msgs::PositionConstraint &  pc,
const moveit_msgs::OrientationConstraint &  oc,
const Eigen::VectorXd &  init_joint_pose,
KinematicConfig &  kc 
) [static]

Populates a Kinematic Config struct from the position and orientation constraints requested;.

Parameters:
groupA pointer to the JointModelGroup
pcThe position constraint message
ocThe orientation constraint message. Absolute tolerances greater than 2PI will be considered unconstrained.
init_joint_poseThe initial joint values
kcThe output KinematicConfig object
Returns:
True if succeeded, false otherwise

Definition at line 93 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::createKinematicConfig ( const moveit::core::JointModelGroup group,
const moveit_msgs::PositionConstraint &  pc,
const moveit_msgs::OrientationConstraint &  oc,
const moveit_msgs::RobotState &  start_state,
KinematicConfig &  kc 
) [static]

Populates a Kinematic Config struct from the position and orientation constraints requested;.

Parameters:
groupA pointer to the JointModelGroup
pcThe position constraint message
ocThe orientation constraint message. Absolute tolerances greater than 2PI will be considered unconstrained.
start_stateThe start robot state message
kcThe output KinematicConfig object
Returns:
True if succeeded, false otherwise

Definition at line 159 of file kinematics.h.

static void stomp_moveit::utils::kinematics::reduceJacobian ( const Eigen::MatrixXd &  jacb,
const std::vector< int > &  indices,
Eigen::MatrixXd &  jacb_reduced 
) [static]

Convenience function to remove entire rows of the Jacobian matrix.

Parameters:
jacbThe jacobian matrix of size [num_dimensions x 6]
indicesAn indices vector where each entry indicates an row index of the jacobian that will be kept.
jacb_reducedThe reduced jacobian containing the only the rows indicated by the 'indices' array.

Definition at line 233 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::solveIK ( moveit::core::RobotStatePtr  robot_state,
const std::string &  group_name,
const Eigen::Array< int, 6, 1 > &  constrained_dofs,
const Eigen::ArrayXd &  joint_update_rates,
const Eigen::Array< double, 6, 1 > &  cartesian_convergence_thresholds,
const Eigen::ArrayXd &  null_proj_weights,
const Eigen::VectorXd &  null_space_vector,
int  max_iterations,
const Eigen::Affine3d &  tool_goal_pose,
const Eigen::VectorXd &  init_joint_pose,
Eigen::VectorXd &  joint_pose 
) [static]

Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose and can also apply a vector onto the null space of the jacobian in order to meet a secondary objective. It also checks for joint limits.

Parameters:
robot_stateA pointer to the robot state.
group_nameThe name of the kinematic group. The tool link name is assumed to be the last link in this group.
constrained_dofsA vector of the form [x y z rx ry rz] filled with 0's and 1's to indicate an unconstrained or fully constrained DOF.
joint_update_ratesThe weights to be applied to each update during every iteration [num_dimensions x 1].
cartesian_convergence_thresholdsThe error margin for each dimension of the twist vector [6 x 1].
null_proj_weightsThe weights to be multiplied to the null space vector [num_dimension x 1].
null_space_vectorThe null space vector which is applied into the jacobian's null space [num_dimension x 1].
max_iterationsThe maximum number of iterations that the algorithm will run until convergence is reached.
tool_goal_poseThe desired tool pose.
init_joint_poseSeed joint pose [num_dimension x 1].
joint_poseIK joint solution [num_dimension x 1].
Returns:
True if a solution was found, false otherwise.

Definition at line 299 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::solveIK ( moveit::core::RobotStatePtr  robot_state,
const std::string &  group_name,
const KinematicConfig &  config,
Eigen::VectorXd &  joint_pose 
) [static]

Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose and can also apply a vector onto the null space of the jacobian in order to meet a secondary objective. It also checks for joint limits.

Parameters:
robot_stateA pointer to the robot state.
group_nameThe name of the kinematic group. The tool link name is assumed to be the last link in this group.
configA structure containing the variables to be used in finding a solution.
joint_poseIK joint solution [num_dimension x 1].
Returns:
True if a solution was found, false otherwise.

Definition at line 466 of file kinematics.h.

static bool stomp_moveit::utils::kinematics::solveIK ( moveit::core::RobotStatePtr  robot_state,
const std::string &  group_name,
const Eigen::ArrayXi &  constrained_dofs,
const Eigen::ArrayXd &  joint_update_rates,
const Eigen::ArrayXd &  cartesian_convergence_thresholds,
int  max_iterations,
const Eigen::Affine3d &  tool_goal_pose,
const Eigen::VectorXd &  init_joint_pose,
Eigen::VectorXd &  joint_pose 
) [static]

Solves the inverse kinematics for a given tool pose using a gradient descent method. It can handle under constrained DOFs for the cartesian tool pose.

Parameters:
robot_stateA pointer to the robot state.
group_nameThe name of the kinematic group. The tool link name is assumed to be the last link in this group.
constrained_dofsA vector of the form [x y z rx ry rz] filled with 0's and 1's to indicate an unconstrained or fully constrained DOF.
joint_update_ratesThe weights to be applied to each update during every iteration [num_dimensions x 1].
cartesian_convergence_thresholdsThe error margin for each dimension of the twist vector [6 x 1].
max_iterationsThe maximum number of iterations that the algorithm will run to reach convergence.
tool_goal_poseThe cartesian pose of the tool relative to the world.
init_joint_poseSeed joint pose [num_dimension x 1].
joint_poseIK joint solution [num_dimension x 1].
Returns:
True if a solution was found, false otherwise.

Definition at line 555 of file kinematics.h.


Variable Documentation

const double stomp_moveit::utils::kinematics::EPSILON = 0.011 [static]

Used in dampening the matrix pseudo inverse calculation.

Definition at line 52 of file kinematics.h.

const double stomp_moveit::utils::kinematics::LAMBDA = 0.01 [static]

Used in dampening the matrix pseudo inverse calculation.

Definition at line 53 of file kinematics.h.



stomp_moveit
Author(s): Jorge Nicho
autogenerated on Sat Jun 8 2019 19:24:01