46 const std::string& base_frame,
const std::string& tip_frame,
47 double search_discretization)
59 const std::string& base_frame,
const std::vector<std::string>& tip_frames,
60 double search_discretization)
70 for (std::size_t i = 0; i < tip_frames.size(); ++i)
74 if (tip_frames.size() == 1)
80 for (std::size_t i = 0; i < redundant_joint_indices.size(); ++i)
96 std::vector<unsigned int> redundant_joint_indices;
97 for (std::size_t i = 0; i < redundant_joint_names.size(); ++i)
98 for (std::size_t j = 0; j < jnames.size(); ++j)
99 if (jnames[j] == redundant_joint_names[i])
101 redundant_joint_indices.push_back(j);
104 return redundant_joint_indices.size() == redundant_joint_names.size() ?
setRedundantJoints(redundant_joint_indices) :
110 return (!str.empty() && str[0] ==
'/') ?
removeSlash(str.substr(1)) : str;
120 *error_text_out =
"This plugin only supports joint groups which are chains";
129 const std::vector<double>& ik_seed_state,
133 std::vector<double> solution;
143 if (ik_poses.size() != 1)
145 ROS_ERROR_NAMED(
"kinematics_base",
"This kinematic solver does not support getPositionIK for multiple poses");
150 if (ik_poses.empty())
157 moveit_msgs::MoveItErrorCodes error_code;
158 if (
getPositionIK(ik_poses[0], ik_seed_state, solution, error_code, options))
161 solutions[0] = solution;
std::vector< unsigned int > redundant_joint_indices_
KinematicError kinematic_error
A set of options for the kinematics solver.
virtual const std::vector< std::string > & getJointNames() const =0
Return all the joint names in the order they are used internally.
bool isChain() const
Check if this group is a linear chain.
virtual bool supportsGroup(const moveit::core::JointModelGroup *jmg, std::string *error_text_out=NULL) const
Check if this solver supports a given JointModelGroup.
void setSearchDiscretization(double sd)
Set the search discretization value for all the redundant joints.
std::vector< std::string > tip_frames_
double solution_percentage
static const double DEFAULT_TIMEOUT
virtual 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 =0
Given a desired pose of the end-effector, compute the joint angles to reach it.
virtual bool setRedundantJoints(const std::vector< unsigned int > &redundant_joint_indices)
Set a set of redundant joints for the kinematics solver to use. This can fail, depending on the IK so...
DiscretizationMethod discretization_method
std::vector< DiscretizationMethod > supported_methods_
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)
Set the parameters for the solver, for use with kinematic chain IK solvers.
static const double DEFAULT_SEARCH_DISCRETIZATION
API for forward and inverse kinematics.
double search_discretization_
#define ROS_ERROR_NAMED(name,...)
std::string removeSlash(const std::string &str) const
std::string robot_description_