Public Member Functions | Private Member Functions | Private Attributes | List of all members
prbt_manipulator::IKFastKinematicsPlugin Class Reference
Inheritance diagram for prbt_manipulator::IKFastKinematicsPlugin:
Inheritance graph
[legend]

Public Member Functions

bool getPositionFK (const std::vector< std::string > &link_names, const std::vector< double > &joint_angles, std::vector< geometry_msgs::Pose > &poses) const override
 Given a set of joint angles and a set of links, compute their pose. More...
 
bool getPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const override
 Given a desired pose of the end-effector, compute the joint angles to reach it. More...
 
bool getPositionIK (const std::vector< geometry_msgs::Pose > &ik_poses, const std::vector< double > &ik_seed_state, std::vector< std::vector< double >> &solutions, kinematics::KinematicsResult &result, const kinematics::KinematicsQueryOptions &options) const override
 Given a desired pose of the end-effector, compute the set joint angles solutions that are able to reach it. More...
 
 IKFastKinematicsPlugin ()
 
bool searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const override
 Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). More...
 
bool searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits, std::vector< double > &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const override
 Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). More...
 
bool searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const override
 Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). More...
 
bool searchPositionIK (const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions()) const override
 Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). The consistency_limit specifies that only certain redundancy positions around those specified in the seed state are admissible and need to be searched. More...
 
bool setRedundantJoints (const std::vector< unsigned int > &redundant_joint_indices) override
 Overrides the default method to prevent changing the redundant joints. More...
 
void setSearchDiscretization (const std::map< unsigned int, double > &discretization)
 Sets the discretization value for the redundant joint. More...
 
- Public Member Functions inherited from kinematics::KinematicsBase
virtual const std::string & getBaseFrame () const
 
double getDefaultTimeout () const
 
virtual const std::string & getGroupName () const
 
virtual bool getPositionIK (const std::vector< geometry_msgs::Pose > &ik_poses, const std::vector< double > &ik_seed_state, std::vector< std::vector< double > > &solutions, KinematicsResult &result, const kinematics::KinematicsQueryOptions &options) const
 
virtual void getRedundantJoints (std::vector< unsigned int > &redundant_joint_indices) const
 
double getSearchDiscretization (int joint_index=0) const
 
std::vector< DiscretizationMethodgetSupportedDiscretizationMethods () const
 
virtual const std::string & getTipFrame () const
 
virtual const std::vector< std::string > & getTipFrames () const
 
virtual bool initialize (const std::string &robot_description, const std::string &group_name, const std::string &base_frame, const std::string &tip_frame, double search_discretization)=0
 
virtual bool initialize (const std::string &robot_description, const std::string &group_name, const std::string &base_frame, const std::vector< std::string > &tip_frames, double search_discretization)
 
 KinematicsBase ()
 
virtual bool searchPositionIK (const std::vector< geometry_msgs::Pose > &ik_poses, const std::vector< double > &ik_seed_state, double timeout, const std::vector< double > &consistency_limits, std::vector< double > &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options=kinematics::KinematicsQueryOptions(), const moveit::core::RobotState *context_state=NULL) const
 
void setDefaultTimeout (double timeout)
 
bool setRedundantJoints (const std::vector< std::string > &redundant_joint_names)
 
void setSearchDiscretization (const std::map< int, double > &discretization)
 
void setSearchDiscretization (double sd)
 
virtual void setValues (const std::string &robot_description, const std::string &group_name, const std::string &base_frame, const std::string &tip_frame, double search_discretization)
 
virtual void setValues (const std::string &robot_description, const std::string &group_name, const std::string &base_frame, const std::vector< std::string > &tip_frames, double search_discretization)
 
virtual bool supportsGroup (const moveit::core::JointModelGroup *jmg, std::string *error_text_out=NULL) const
 
virtual ~KinematicsBase ()
 

Private Member Functions

bool computeRelativeTransform (const std::string &from, const std::string &to, Eigen::Isometry3d &transform, bool &differs_from_identity)
 Validate that we can compute a fixed transform between from and to links. More...
 
double enforceLimits (double val, double min, double max) const
 If the value is outside of min/max then it tries to +/- 2 * pi to put the value into the range. More...
 
void fillFreeParams (int count, int *array)
 
bool getCount (int &count, const int &max_count, const int &min_count) const
 
const std::vector< std::string > & getJointNames () const override
 
const std::vector< std::string > & getLinkNames () const override
 
void getSolution (const IkSolutionList< IkReal > &solutions, int i, std::vector< double > &solution) const
 Gets a specific solution from the set. More...
 
void getSolution (const IkSolutionList< IkReal > &solutions, const std::vector< double > &ik_seed_state, int i, std::vector< double > &solution) const
 Gets a specific solution from the set with joints rotated 360° to be near seed state where possible. More...
 
bool initialize (const moveit::core::RobotModel &robot_model, const std::string &group_name, const std::string &base_frame, const std::vector< std::string > &tip_frames, double search_discretization) override
 
bool sampleRedundantJoint (kinematics::DiscretizationMethod method, std::vector< double > &sampled_joint_vals) const
 samples the designated redundant joint using the chosen discretization method More...
 
size_t solve (KDL::Frame &pose_frame, const std::vector< double > &vfree, IkSolutionList< IkReal > &solutions) const
 Calls the IK solver from IKFast. More...
 
void transformToChainFrame (const geometry_msgs::Pose &ik_pose, KDL::Frame &ik_pose_chain) const
 Transforms the input pose to the correct frame for the solver. This assumes that the group includes the entire solver chain and that any joints outside of the solver chain within the group are are fixed. More...
 

Private Attributes

bool base_transform_required_
 
Eigen::Isometry3d chain_base_to_group_base_
 
std::vector< int > free_params_
 
Eigen::Isometry3d group_tip_to_chain_tip_
 
const std::string IKFAST_BASE_FRAME_ = "base_link"
 
const std::string IKFAST_TIP_FRAME_ = "flange"
 
bool initialized_
 
std::vector< bool > joint_has_limits_vector_
 
std::vector< double > joint_max_vector_
 
std::vector< double > joint_min_vector_
 
std::vector< std::string > joint_names_
 
std::vector< std::string > link_names_
 
std::string link_prefix_
 
const std::string name_ { "ikfast" }
 
const size_t num_joints_
 
bool tip_transform_required_
 

Additional Inherited Members

- Public Types inherited from kinematics::KinematicsBase
typedef boost::function< void(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_solution, moveit_msgs::MoveItErrorCodes &error_code)> IKCallbackFn
 
- Static Public Attributes inherited from kinematics::KinematicsBase
static const double DEFAULT_SEARCH_DISCRETIZATION
 
static const double DEFAULT_TIMEOUT
 
- Protected Member Functions inherited from kinematics::KinematicsBase
bool lookupParam (const std::string &param, T &val, const T &default_val) const
 
- Protected Attributes inherited from kinematics::KinematicsBase
std::string base_frame_
 
double default_timeout_
 
std::string group_name_
 
std::map< int, double > redundant_joint_discretization_
 
std::vector< unsigned int > redundant_joint_indices_
 
std::string robot_description_
 
double search_discretization_
 
std::vector< DiscretizationMethodsupported_methods_
 
std::string tip_frame_
 
std::vector< std::string > tip_frames_
 

Detailed Description

Definition at line 154 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

Constructor & Destructor Documentation

prbt_manipulator::IKFastKinematicsPlugin::IKFastKinematicsPlugin ( )
inline

Definition at line 200 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

Member Function Documentation

bool prbt_manipulator::IKFastKinematicsPlugin::computeRelativeTransform ( const std::string &  from,
const std::string &  to,
Eigen::Isometry3d &  transform,
bool &  differs_from_identity 
)
private

Validate that we can compute a fixed transform between from and to links.

Definition at line 376 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

double prbt_manipulator::IKFastKinematicsPlugin::enforceLimits ( double  val,
double  min,
double  max 
) const
private

If the value is outside of min/max then it tries to +/- 2 * pi to put the value into the range.

Definition at line 705 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

void prbt_manipulator::IKFastKinematicsPlugin::fillFreeParams ( int  count,
int *  array 
)
private

Definition at line 721 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::getCount ( int &  count,
const int &  max_count,
const int &  min_count 
) const
private

Definition at line 728 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

const std::vector<std::string>& prbt_manipulator::IKFastKinematicsPlugin::getJointNames ( ) const
inlineoverrideprivatevirtual
const std::vector<std::string>& prbt_manipulator::IKFastKinematicsPlugin::getLinkNames ( ) const
inlineoverrideprivatevirtual
bool prbt_manipulator::IKFastKinematicsPlugin::getPositionFK ( const std::vector< std::string > &  link_names,
const std::vector< double > &  joint_angles,
std::vector< geometry_msgs::Pose > &  poses 
) const
overridevirtual

Given a set of joint angles and a set of links, compute their pose.

Parameters
link_namesA set of links for which FK needs to be computed
joint_anglesThe state for which FK is being computed
posesThe resultant set of poses (in the frame returned by getBaseFrame())
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 764 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::getPositionIK ( const geometry_msgs::Pose &  ik_pose,
const std::vector< double > &  ik_seed_state,
std::vector< double > &  solution,
moveit_msgs::MoveItErrorCodes &  error_code,
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
) const
overridevirtual

Given a desired pose of the end-effector, compute the joint angles to reach it.

Parameters
ik_posethe desired pose of the link
ik_seed_statean initial guess solution for the inverse kinematics
solutionthe solution vector
error_codean error code that encodes the reason for failure or success
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 1082 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::getPositionIK ( const std::vector< geometry_msgs::Pose > &  ik_poses,
const std::vector< double > &  ik_seed_state,
std::vector< std::vector< double >> &  solutions,
kinematics::KinematicsResult result,
const kinematics::KinematicsQueryOptions options 
) const
override

Given a desired pose of the end-effector, compute the set joint angles solutions that are able to reach it.

This is a default implementation that returns only one solution and so its result is equivalent to calling 'getPositionIK(...)' with a zero initialized seed.

Parameters
ik_posesThe desired pose of each tip link
ik_seed_statean initial guess solution for the inverse kinematics
solutionsA vector of vectors where each entry is a valid joint solution
resultA struct that reports the results of the query
optionsAn option struct which contains the type of redundancy discretization used. This default implementation only supports the KinmaticSearches::NO_DISCRETIZATION method; requesting any other will result in failure.
Returns
True if a valid set of solutions was found, false otherwise.

Definition at line 1191 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

void prbt_manipulator::IKFastKinematicsPlugin::getSolution ( const IkSolutionList< IkReal > &  solutions,
int  i,
std::vector< double > &  solution 
) const
private

Gets a specific solution from the set.

Definition at line 652 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

void prbt_manipulator::IKFastKinematicsPlugin::getSolution ( const IkSolutionList< IkReal > &  solutions,
const std::vector< double > &  ik_seed_state,
int  i,
std::vector< double > &  solution 
) const
private

Gets a specific solution from the set with joints rotated 360° to be near seed state where possible.

Definition at line 672 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::initialize ( const moveit::core::RobotModel robot_model,
const std::string &  group_name,
const std::string &  base_frame,
const std::vector< std::string > &  tip_frames,
double  search_discretization 
)
overrideprivate

Definition at line 400 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::sampleRedundantJoint ( kinematics::DiscretizationMethod  method,
std::vector< double > &  sampled_joint_vals 
) const
private

samples the designated redundant joint using the chosen discretization method

Parameters
methodAn enumeration flag indicating the discretization method to be used
sampled_joint_valsSampled joint values for the redundant joint
Returns
True if sampling succeeded.

Definition at line 1334 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::searchPositionIK ( const geometry_msgs::Pose &  ik_pose,
const std::vector< double > &  ik_seed_state,
double  timeout,
std::vector< double > &  solution,
moveit_msgs::MoveItErrorCodes &  error_code,
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
) const
overridevirtual

Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines).

Parameters
ik_posethe desired pose of the link
ik_seed_statean initial guess solution for the inverse kinematics
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 820 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::searchPositionIK ( const geometry_msgs::Pose &  ik_pose,
const std::vector< double > &  ik_seed_state,
double  timeout,
const std::vector< double > &  consistency_limits,
std::vector< double > &  solution,
moveit_msgs::MoveItErrorCodes &  error_code,
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
) const
overridevirtual

Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines).

Parameters
ik_posethe desired pose of the link
ik_seed_statean initial guess solution for the inverse kinematics
thedistance that the redundancy can be from the current position
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 830 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::searchPositionIK ( const geometry_msgs::Pose &  ik_pose,
const std::vector< double > &  ik_seed_state,
double  timeout,
std::vector< double > &  solution,
const IKCallbackFn solution_callback,
moveit_msgs::MoveItErrorCodes &  error_code,
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
) const
overridevirtual

Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines).

Parameters
ik_posethe desired pose of the link
ik_seed_statean initial guess solution for the inverse kinematics
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 840 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::searchPositionIK ( const geometry_msgs::Pose &  ik_pose,
const std::vector< double > &  ik_seed_state,
double  timeout,
const std::vector< double > &  consistency_limits,
std::vector< double > &  solution,
const IKCallbackFn solution_callback,
moveit_msgs::MoveItErrorCodes &  error_code,
const kinematics::KinematicsQueryOptions options = kinematics::KinematicsQueryOptions() 
) const
overridevirtual

Given a desired pose of the end-effector, search for the joint angles required to reach it. This particular method is intended for "searching" for a solutions by stepping through the redundancy (or other numerical routines). The consistency_limit specifies that only certain redundancy positions around those specified in the seed state are admissible and need to be searched.

Parameters
ik_posethe desired pose of the link
ik_seed_statean initial guess solution for the inverse kinematics
consistency_limitthe distance that the redundancy can be from the current position
Returns
True if a valid solution was found, false otherwise

Implements kinematics::KinematicsBase.

Definition at line 851 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::setRedundantJoints ( const std::vector< unsigned int > &  redundant_joint_indices)
overridevirtual

Overrides the default method to prevent changing the redundant joints.

Reimplemented from kinematics::KinematicsBase.

Definition at line 545 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

void prbt_manipulator::IKFastKinematicsPlugin::setSearchDiscretization ( const std::map< unsigned int, double > &  discretization)

Sets the discretization value for the redundant joint.

Since this ikfast implementation allows for one redundant joint then only the first entry will be in the discretization map will be used. Calling this method replaces previous discretization settings.

Parameters
discretizationa map of joint indices and discretization value pairs.

Definition at line 512 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

size_t prbt_manipulator::IKFastKinematicsPlugin::solve ( KDL::Frame pose_frame,
const std::vector< double > &  vfree,
IkSolutionList< IkReal > &  solutions 
) const
private

Calls the IK solver from IKFast.

Returns
The number of solutions found

Definition at line 551 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

void prbt_manipulator::IKFastKinematicsPlugin::transformToChainFrame ( const geometry_msgs::Pose &  ik_pose,
KDL::Frame ik_pose_chain 
) const
private

Transforms the input pose to the correct frame for the solver. This assumes that the group includes the entire solver chain and that any joints outside of the solver chain within the group are are fixed.

Parameters
ik_poseThe pose to be transformed which should be in the correct frame for the group.
ik_pose_chainThe ik_pose to be populated with the apropriate pose for the solver

Definition at line 1377 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

Member Data Documentation

bool prbt_manipulator::IKFastKinematicsPlugin::base_transform_required_
private

Definition at line 177 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

Eigen::Isometry3d prbt_manipulator::IKFastKinematicsPlugin::chain_base_to_group_base_
private

Definition at line 181 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<int> prbt_manipulator::IKFastKinematicsPlugin::free_params_
private

Definition at line 162 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

Eigen::Isometry3d prbt_manipulator::IKFastKinematicsPlugin::group_tip_to_chain_tip_
private

Definition at line 182 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

const std::string prbt_manipulator::IKFastKinematicsPlugin::IKFAST_BASE_FRAME_ = "base_link"
private

Definition at line 167 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

const std::string prbt_manipulator::IKFastKinematicsPlugin::IKFAST_TIP_FRAME_ = "flange"
private

Definition at line 166 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::initialized_
private

Definition at line 184 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<bool> prbt_manipulator::IKFastKinematicsPlugin::joint_has_limits_vector_
private

Definition at line 159 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<double> prbt_manipulator::IKFastKinematicsPlugin::joint_max_vector_
private

Definition at line 158 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<double> prbt_manipulator::IKFastKinematicsPlugin::joint_min_vector_
private

Definition at line 157 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<std::string> prbt_manipulator::IKFastKinematicsPlugin::joint_names_
private

Definition at line 156 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::vector<std::string> prbt_manipulator::IKFastKinematicsPlugin::link_names_
private

Definition at line 160 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

std::string prbt_manipulator::IKFastKinematicsPlugin::link_prefix_
private

Definition at line 170 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

const std::string prbt_manipulator::IKFastKinematicsPlugin::name_ { "ikfast" }
private

Definition at line 185 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

const size_t prbt_manipulator::IKFastKinematicsPlugin::num_joints_
private

Definition at line 161 of file prbt_manipulator_ikfast_moveit_plugin.cpp.

bool prbt_manipulator::IKFastKinematicsPlugin::tip_transform_required_
private

Definition at line 176 of file prbt_manipulator_ikfast_moveit_plugin.cpp.


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


prbt_ikfast_manipulator_plugin
Author(s):
autogenerated on Mon May 3 2021 02:19:27