Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
constrained_ik::basic_kin::BasicKin Class Reference

Basic low-level kinematics functions. More...

#include <basic_kin.h>

List of all members.

Public Member Functions

bool calcFwdKin (const Eigen::VectorXd &joint_angles, Eigen::Affine3d &pose) const
 Calculates tool pose of robot chain.
bool calcFwdKin (const Eigen::VectorXd &joint_angles, const std::string &base, const std::string &tip, KDL::Frame &pose) const
 Creates chain and calculates tool pose relative to root New chain is not stored permanently, but subchain_fk_solver_ is updated.
bool calcJacobian (const Eigen::VectorXd &joint_angles, Eigen::MatrixXd &jacobian) const
 Calculated jacobian of robot given joint angles.
bool checkInitialized () const
 Checks if BasicKin is initialized (init() has been run: urdf model loaded, etc.)
bool checkJoints (const Eigen::VectorXd &vec) const
 Check for consistency in # and limits of joints.
const
moveit::core::JointModelGroup
getJointModelGroup () const
 Get the name of the kinematic group.
bool getJointNames (std::vector< std::string > &names) const
 Get list of joint names for robot.
Eigen::MatrixXd getLimits () const
 Getter for joint_limits_.
bool getLinkNames (std::vector< std::string > &names) const
 Get list of link names for robot.
std::string getRobotBaseLinkName () const
 getter for the robot base link name
std::string getRobotTipLinkName () const
 getter for the robot tip link name
bool getSubChain (const std::string link_name, KDL::Chain &chain) const
 Get a subchain of the kinematic group.
bool init (const moveit::core::JointModelGroup *group)
 Initializes BasicKin Creates KDL::Chain from urdf::Model, populates joint_list_, joint_limits_, and link_list_.
bool linkTransforms (const Eigen::VectorXd &joint_angles, std::vector< KDL::Frame > &poses, const std::vector< std::string > &link_names=std::vector< std::string >()) const
 Calculates transforms of each link relative to base (not including base) If link_names is specified, only listed links will be returned. Otherwise all links in link_list_ will be returned.
unsigned int numJoints () const
 Number of joints in robot.
BasicKinoperator= (const BasicKin &rhs)
 Assigns values from another BasicKin to this.
bool solvePInv (const Eigen::MatrixXd &A, const Eigen::VectorXd &b, Eigen::VectorXd &x) const
 Solve equation Ax=b for x Use this SVD to compute A+ (pseudoinverse of A). Weighting still TBD.

Static Public Member Functions

static bool dampedPInv (const Eigen::MatrixXd &A, Eigen::MatrixXd &P, const double eps=0.011, const double lambda=0.01)
 Calculate Damped Pseudoinverse Use this SVD to compute A+ (pseudoinverse of A). Weighting still TBD.
static void EigenToKDL (const Eigen::VectorXd &vec, KDL::JntArray &joints)
 Convert Eigen::Vector to KDL::JntArray.
static void KDLToEigen (const KDL::Frame &frame, Eigen::Affine3d &transform)
 Convert KDL::Frame to Eigen::Affine3d.
static void KDLToEigen (const KDL::Jacobian &jacobian, Eigen::MatrixXd &matrix)
 Convert KDL::Jacobian to Eigen::Matrix.

Private Member Functions

int getJointNum (const std::string &joint_name) const
 Get joint number of given joint in initialized robot.
int getLinkNum (const std::string &link_name) const
 Get link number of given joint in initialized robot.

Private Attributes

std::string base_name_
boost::scoped_ptr
< KDL::ChainFkSolverPos_recursive
fk_solver_
const
moveit::core::JointModelGroup
group_
bool initialized_
boost::scoped_ptr
< KDL::ChainJntToJacSolver
jac_solver_
Eigen::Matrix< double,
Eigen::Dynamic, 2 > 
joint_limits_
std::vector< std::string > joint_list_
KDL::Tree kdl_tree_
std::vector< std::string > link_list_
KDL::Chain robot_chain_
std::string tip_name_

Detailed Description

Basic low-level kinematics functions.

Typically, just wrappers around the equivalent KDL calls.

Definition at line 53 of file basic_kin.h.


Member Function Documentation

bool constrained_ik::basic_kin::BasicKin::calcFwdKin ( const Eigen::VectorXd &  joint_angles,
Eigen::Affine3d &  pose 
) const

Calculates tool pose of robot chain.

Parameters:
joint_anglesVector of joint angles (size must match number of joints in robot chain)
poseTransform of end-of-tip relative to root
Returns:
True if calculation successful, False if anything is wrong (including uninitialized BasicKin)

Definition at line 44 of file basic_kin.cpp.

bool constrained_ik::basic_kin::BasicKin::calcFwdKin ( const Eigen::VectorXd &  joint_angles,
const std::string &  base,
const std::string &  tip,
KDL::Frame pose 
) const

Creates chain and calculates tool pose relative to root New chain is not stored permanently, but subchain_fk_solver_ is updated.

Parameters:
joint_anglesVector of joint angles (size must match number of joints in chain)
baseName of base link for new chain
tipName of tip link for new chain
poseTransform of end-of-tip relative to base
Returns:
True if calculation successful, False if anything is wrong (including uninitialized BasicKin)

Definition at line 66 of file basic_kin.cpp.

bool constrained_ik::basic_kin::BasicKin::calcJacobian ( const Eigen::VectorXd &  joint_angles,
Eigen::MatrixXd &  jacobian 
) const

Calculated jacobian of robot given joint angles.

Parameters:
joint_anglesInput vector of joint angles
jacobianOutput jacobian
Returns:
True if calculation successful, False if anything is wrong (including uninitialized BasicKin)

Definition at line 96 of file basic_kin.cpp.

Checks if BasicKin is initialized (init() has been run: urdf model loaded, etc.)

Returns:
True if init() has completed successfully

Definition at line 100 of file basic_kin.h.

bool constrained_ik::basic_kin::BasicKin::checkJoints ( const Eigen::VectorXd &  vec) const

Check for consistency in # and limits of joints.

Parameters:
vecVector of joint values
Returns:
True if size of vec matches # of robot joints and all joints are within limits

Definition at line 113 of file basic_kin.cpp.

bool constrained_ik::basic_kin::BasicKin::dampedPInv ( const Eigen::MatrixXd &  A,
Eigen::MatrixXd &  P,
const double  eps = 0.011,
const double  lambda = 0.01 
) [static]

Calculate Damped Pseudoinverse Use this SVD to compute A+ (pseudoinverse of A). Weighting still TBD.

Parameters:
AInput matrix (represents Jacobian)
POutput matrix (represents pseudoinverse of A)
epsSingular value threshold
lambdaDamping factor
Returns:
True if Pseudoinverse completes properly

Definition at line 371 of file basic_kin.cpp.

static void constrained_ik::basic_kin::BasicKin::EigenToKDL ( const Eigen::VectorXd &  vec,
KDL::JntArray joints 
) [inline, static]

Convert Eigen::Vector to KDL::JntArray.

Parameters:
vecInput Eigen vector
jointsOutput KDL joint array

Definition at line 231 of file basic_kin.h.

Get the name of the kinematic group.

Returns:
string with the group name

Definition at line 144 of file basic_kin.h.

bool constrained_ik::basic_kin::BasicKin::getJointNames ( std::vector< std::string > &  names) const

Get list of joint names for robot.

Parameters:
namesOutput vector of joint names, copied from joint_list_ created in init()
Returns:
True if BasicKin has been successfully initialized

Definition at line 135 of file basic_kin.cpp.

int constrained_ik::basic_kin::BasicKin::getJointNum ( const std::string &  joint_name) const [private]

Get joint number of given joint in initialized robot.

Parameters:
joint_nameInput name of joint
Returns:
joint index if joint_name part of joint_list_, n+1 otherwise

Definition at line 157 of file basic_kin.cpp.

Eigen::MatrixXd constrained_ik::basic_kin::BasicKin::getLimits ( ) const [inline]

Getter for joint_limits_.

Returns:
Matrix of joint limits

Definition at line 122 of file basic_kin.h.

bool constrained_ik::basic_kin::BasicKin::getLinkNames ( std::vector< std::string > &  names) const

Get list of link names for robot.

Parameters:
namesOutput vector of names, copied from link_list_ created in init()
Returns:
True if BasicKin has been successfully initialized

Definition at line 146 of file basic_kin.cpp.

int constrained_ik::basic_kin::BasicKin::getLinkNum ( const std::string &  link_name) const [private]

Get link number of given joint in initialized robot.

Parameters:
link_nameInput name of link
Returns:
link index if link_name part of link_list_, l+1 otherwise

Definition at line 167 of file basic_kin.cpp.

getter for the robot base link name

Returns:
std::string base_name_

Definition at line 176 of file basic_kin.h.

getter for the robot tip link name

Returns:
std::string tip_name_

Definition at line 182 of file basic_kin.h.

bool constrained_ik::basic_kin::BasicKin::getSubChain ( const std::string  link_name,
KDL::Chain chain 
) const

Get a subchain of the kinematic group.

Parameters:
link_nameName of final link in chain
chainOutput kinematic chain
Returns:
True if the subchain was successfully created

Definition at line 259 of file basic_kin.cpp.

Initializes BasicKin Creates KDL::Chain from urdf::Model, populates joint_list_, joint_limits_, and link_list_.

Parameters:
groupInput kinematic joint model group
Returns:
True if init() completes successfully

Definition at line 177 of file basic_kin.cpp.

void constrained_ik::basic_kin::BasicKin::KDLToEigen ( const KDL::Frame frame,
Eigen::Affine3d &  transform 
) [static]

Convert KDL::Frame to Eigen::Affine3d.

Parameters:
frameInput KDL Frame
transformOutput Eigen transform (Affine3d)

Definition at line 237 of file basic_kin.cpp.

void constrained_ik::basic_kin::BasicKin::KDLToEigen ( const KDL::Jacobian jacobian,
Eigen::MatrixXd &  matrix 
) [static]

Convert KDL::Jacobian to Eigen::Matrix.

Parameters:
jacobianInput KDL Jacobian
matrixOutput Eigen MatrixXd

Definition at line 250 of file basic_kin.cpp.

bool constrained_ik::basic_kin::BasicKin::linkTransforms ( const Eigen::VectorXd &  joint_angles,
std::vector< KDL::Frame > &  poses,
const std::vector< std::string > &  link_names = std::vector<std::string>() 
) const

Calculates transforms of each link relative to base (not including base) If link_names is specified, only listed links will be returned. Otherwise all links in link_list_ will be returned.

Parameters:
joint_anglesInput vector of joint values
posesOutput poses of listed links
link_namesOptional input list of links to calculate transforms for
Returns:
True if all requested links have poses calculated

Definition at line 273 of file basic_kin.cpp.

unsigned int constrained_ik::basic_kin::BasicKin::numJoints ( ) const [inline]

Number of joints in robot.

Returns:
Number of joints in robot

Definition at line 150 of file basic_kin.h.

BasicKin & constrained_ik::basic_kin::BasicKin::operator= ( const BasicKin rhs)

Assigns values from another BasicKin to this.

Parameters:
rhsInput BasicKin object to copy from
Returns:
reference to this BasicKin object

Definition at line 314 of file basic_kin.cpp.

bool constrained_ik::basic_kin::BasicKin::solvePInv ( const Eigen::MatrixXd &  A,
const Eigen::VectorXd &  b,
Eigen::VectorXd &  x 
) const

Solve equation Ax=b for x Use this SVD to compute A+ (pseudoinverse of A). Weighting still TBD.

Parameters:
AInput matrix (represents Jacobian)
bInput vector (represents desired pose)
xOutput vector (represents joint values)
Returns:
True if solver completes properly

Definition at line 331 of file basic_kin.cpp.


Member Data Documentation

Link name of first link in the kinematic chain

Definition at line 238 of file basic_kin.h.

KDL Forward Kinematic Solver

Definition at line 243 of file basic_kin.h.

Move group

Definition at line 235 of file basic_kin.h.

Identifies if the object has been initialized

Definition at line 234 of file basic_kin.h.

KDL Jacobian Solver

Definition at line 244 of file basic_kin.h.

Eigen::Matrix<double, Eigen::Dynamic, 2> constrained_ik::basic_kin::BasicKin::joint_limits_ [private]

Joint limits

Definition at line 242 of file basic_kin.h.

std::vector<std::string> constrained_ik::basic_kin::BasicKin::joint_list_ [private]

List of joint names

Definition at line 240 of file basic_kin.h.

KDL tree object

Definition at line 237 of file basic_kin.h.

std::vector<std::string> constrained_ik::basic_kin::BasicKin::link_list_ [private]

List of link names

Definition at line 241 of file basic_kin.h.

KDL Chain object

Definition at line 236 of file basic_kin.h.

Link name of last kink in the kinematic chain

Definition at line 239 of file basic_kin.h.


The documentation for this class was generated from the following files:


constrained_ik
Author(s): Chris Lewis , Jeremy Zoss , Dan Solomon
autogenerated on Sat Jun 8 2019 19:23:46