65 #define IKFAST_NO_MAIN // Don't include main() from IKFast 156 std::vector<std::string> joint_names_;
196 bool getPositionIK(
const geometry_msgs::Pose& ik_pose,
const std::vector<double>& ik_seed_state,
197 std::vector<double>& solution, moveit_msgs::MoveItErrorCodes& error_code,
215 bool getPositionIK(
const std::vector<geometry_msgs::Pose>& ik_poses,
const std::vector<double>& ik_seed_state,
227 bool searchPositionIK(
const geometry_msgs::Pose& ik_pose,
const std::vector<double>& ik_seed_state,
double timeout,
228 std::vector<double>& solution, moveit_msgs::MoveItErrorCodes& error_code,
240 bool searchPositionIK(
const geometry_msgs::Pose& ik_pose,
const std::vector<double>& ik_seed_state,
double timeout,
241 const std::vector<double>& consistency_limits, std::vector<double>& solution,
242 moveit_msgs::MoveItErrorCodes& error_code,
253 bool searchPositionIK(
const geometry_msgs::Pose& ik_pose,
const std::vector<double>& ik_seed_state,
double timeout,
254 std::vector<double>& solution,
const IKCallbackFn& solution_callback,
255 moveit_msgs::MoveItErrorCodes& error_code,
268 bool searchPositionIK(
const geometry_msgs::Pose& ik_pose,
const std::vector<double>& ik_seed_state,
double timeout,
269 const std::vector<double>& consistency_limits, std::vector<double>& solution,
270 const IKCallbackFn& solution_callback, moveit_msgs::MoveItErrorCodes& error_code,
281 bool getPositionFK(
const std::vector<std::string>& link_names,
const std::vector<double>& joint_angles,
282 std::vector<geometry_msgs::Pose>& poses)
const;
293 void setSearchDiscretization(
const std::map<int, double>& discretization);
298 bool setRedundantJoints(
const std::vector<unsigned int>& redundant_joint_indices);
301 bool initialize(
const std::string& robot_description,
const std::string& group_name,
const std::string& base_name,
302 const std::string& tip_name,
double search_discretization);
318 void getSolution(
const IkSolutionList<IkReal>& solutions,
const std::vector<double>& ik_seed_state,
int i,
319 std::vector<double>& solution)
const;
321 double harmonize(
const std::vector<double>& ik_seed_state, std::vector<double>& solution)
const;
323 void getClosestSolution(
const IkSolutionList<IkReal>& solutions,
const std::vector<double>& ik_seed_state,
324 std::vector<double>& solution)
const;
325 void fillFreeParams(
int count,
int* array);
326 bool getCount(
int& count,
const int& max_count,
const int& min_count)
const;
339 const std::string& base_name,
const std::string& tip_name,
340 double search_discretization)
342 setValues(robot_description, group_name, base_name, tip_name, search_discretization);
347 lookupParam(
"robot", robot, std::string());
353 if (free_params_.size() > 1)
355 ROS_FATAL(
"Only one free joint parameter supported!");
358 else if (free_params_.size() == 1)
360 redundant_joint_indices_.clear();
361 redundant_joint_indices_.push_back(free_params_[0]);
362 KinematicsBase::setSearchDiscretization(DEFAULT_SEARCH_DISCRETIZATION);
368 std::string urdf_xml, full_urdf_xml;
369 lookupParam(
"urdf_xml", urdf_xml, robot_description);
373 if (!node_handle.
getParam(full_urdf_xml, xml_string))
375 ROS_FATAL_NAMED(
"ikfast",
"Could not load the xml from parameter server: %s", urdf_xml.c_str());
383 urdf::LinkConstSharedPtr link = robot_model.getLink(getTipFrame());
384 while (link->name != base_frame_ && joint_names_.size() <= num_joints_)
387 link_names_.push_back(link->name);
388 urdf::JointSharedPtr joint = link->parent_joint;
391 if (joint->type != urdf::Joint::UNKNOWN && joint->type != urdf::Joint::FIXED)
395 joint_names_.push_back(joint->name);
398 if (joint->type != urdf::Joint::CONTINUOUS)
402 lower = joint->safety->soft_lower_limit;
403 upper = joint->safety->soft_upper_limit;
407 lower = joint->limits->lower;
408 upper = joint->limits->upper;
420 joint_has_limits_vector_.push_back(
true);
421 joint_min_vector_.push_back(lower);
422 joint_max_vector_.push_back(upper);
426 joint_has_limits_vector_.push_back(
false);
427 joint_min_vector_.push_back(-
M_PI);
428 joint_max_vector_.push_back(
M_PI);
434 ROS_WARN_NAMED(
"ikfast",
"no joint corresponding to %s", link->name.c_str());
436 link = link->getParent();
439 if (joint_names_.size() != num_joints_)
441 ROS_FATAL_STREAM_NAMED(
"ikfast",
"Joint numbers mismatch: URDF has " << joint_names_.size() <<
" and IKFast has " 446 std::reverse(link_names_.begin(), link_names_.end());
447 std::reverse(joint_names_.begin(), joint_names_.end());
448 std::reverse(joint_min_vector_.begin(), joint_min_vector_.end());
449 std::reverse(joint_max_vector_.begin(), joint_max_vector_.end());
450 std::reverse(joint_has_limits_vector_.begin(), joint_has_limits_vector_.end());
452 for (
size_t i = 0; i < num_joints_; ++i)
453 ROS_DEBUG_STREAM_NAMED(
"ikfast", joint_names_[i] <<
" " << joint_min_vector_[i] <<
" " << joint_max_vector_[i]
454 <<
" " << joint_has_limits_vector_[i]);
462 if (discretization.empty())
464 ROS_ERROR(
"The 'discretization' map is empty");
468 if (redundant_joint_indices_.empty())
474 if (discretization.begin()->first != redundant_joint_indices_[0])
476 std::string redundant_joint = joint_names_[free_params_[0]];
478 << discretization.begin()->first <<
", only joint '" << redundant_joint <<
"' with index " 479 << redundant_joint_indices_[0] <<
" is redundant.");
483 if (discretization.begin()->second <= 0.0)
489 redundant_joint_discretization_.clear();
490 redundant_joint_discretization_[redundant_joint_indices_[0]] = discretization.begin()->second;
495 ROS_ERROR_STREAM(
"Changing the redundant joints isn't permitted by this group's solver ");
506 trans[0] = pose_frame.
p[0];
507 trans[1] = pose_frame.
p[1];
508 trans[2] = pose_frame.
p[2];
522 vals[0] = mult(0, 0);
523 vals[1] = mult(0, 1);
524 vals[2] = mult(0, 2);
525 vals[3] = mult(1, 0);
526 vals[4] = mult(1, 1);
527 vals[5] = mult(1, 2);
528 vals[6] = mult(2, 0);
529 vals[7] = mult(2, 1);
530 vals[8] = mult(2, 2);
533 ComputeIk(trans, vals, vfree.size() > 0 ? &vfree[0] : NULL, solutions);
543 ComputeIk(trans, direction.
data, vfree.size() > 0 ? &vfree[0] : NULL, solutions);
551 ROS_ERROR_NAMED(
"ikfast",
"IK for this IkParameterizationType not implemented yet.");
557 ROS_ERROR_NAMED(
"ikfast",
"IK for this IkParameterizationType not implemented yet.");
567 ROS_ERROR_NAMED(
"ikfast",
"IK for this IkParameterizationType not implemented yet.");
571 ROS_ERROR_NAMED(
"ikfast",
"Unknown IkParameterizationType! Was the solver generated with an incompatible version " 578 std::vector<double>& solution)
const 581 solution.resize(num_joints_);
585 std::vector<IkReal> vsolfree(sol.
GetFree().size());
586 sol.
GetSolution(&solution[0], vsolfree.size() > 0 ? &vsolfree[0] : NULL);
597 const std::vector<double>& ik_seed_state,
int i,
598 std::vector<double>& solution)
const 601 solution.resize(num_joints_);
605 std::vector<IkReal> vsolfree(sol.
GetFree().size());
606 sol.
GetSolution(&solution[0], vsolfree.size() > 0 ? &vsolfree[0] : NULL);
609 for (std::size_t i = 0; i < num_joints_; ++i)
611 if (joint_has_limits_vector_[i])
613 double signed_distance = solution[i] - ik_seed_state[i];
616 signed_distance -= 2 *
M_PI;
617 solution[i] -= 2 *
M_PI;
621 signed_distance += 2 *
M_PI;
622 solution[i] += 2 *
M_PI;
631 std::vector<double> ss = ik_seed_state;
632 for (
size_t i = 0; i < ik_seed_state.size(); ++i)
634 while (ss[i] > 2 *
M_PI)
638 while (ss[i] < 2 *
M_PI)
642 while (solution[i] > 2 *
M_PI)
644 solution[i] -= 2 *
M_PI;
646 while (solution[i] < 2 *
M_PI)
648 solution[i] += 2 *
M_PI;
650 dist_sqr += fabs(ik_seed_state[i] - solution[i]);
679 const std::vector<double>& ik_seed_state,
680 std::vector<double>& solution)
const 682 double mindist = DBL_MAX;
684 std::vector<double> sol;
689 getSolution(solutions, i, sol);
690 double dist = harmonize(ik_seed_state, sol);
693 if (minindex == -1 || dist < mindist)
701 getSolution(solutions, minindex, solution);
702 harmonize(ik_seed_state, solution);
708 free_params_.clear();
709 for (
int i = 0; i < count; ++i)
710 free_params_.push_back(array[i]);
717 if (-count >= min_count)
722 else if (count + 1 <= max_count)
734 if (1 - count <= max_count)
739 else if (count - 1 >= min_count)
750 const std::vector<double>& joint_angles,
751 std::vector<geometry_msgs::Pose>& poses)
const 759 ROS_ERROR_NAMED(
"ikfast",
"Can only compute FK for Transform6D IK type!");
764 if (link_names.size() == 0)
770 if (link_names.size() != 1 || link_names[0] != getTipFrame())
772 ROS_ERROR_NAMED(
"ikfast",
"Can compute FK for %s only", getTipFrame().c_str());
778 IkReal eerot[9], eetrans[3];
779 IkReal
angles[joint_angles.size()];
780 for (
unsigned char i = 0; i < joint_angles.size(); i++)
781 angles[i] = joint_angles[i];
786 for (
int i = 0; i < 3; ++i)
787 p_out.
p.
data[i] = eetrans[i];
789 for (
int i = 0; i < 9; ++i)
790 p_out.
M.
data[i] = eerot[i];
799 const std::vector<double>& ik_seed_state,
double timeout,
800 std::vector<double>& solution, moveit_msgs::MoveItErrorCodes& error_code,
804 std::vector<double> consistency_limits;
806 return searchPositionIK(ik_pose, ik_seed_state, timeout, consistency_limits, solution, solution_callback, error_code,
811 const std::vector<double>& ik_seed_state,
double timeout,
812 const std::vector<double>& consistency_limits,
813 std::vector<double>& solution, moveit_msgs::MoveItErrorCodes& error_code,
817 return searchPositionIK(ik_pose, ik_seed_state, timeout, consistency_limits, solution, solution_callback, error_code,
822 const std::vector<double>& ik_seed_state,
double timeout,
823 std::vector<double>& solution,
const IKCallbackFn& solution_callback,
824 moveit_msgs::MoveItErrorCodes& error_code,
827 std::vector<double> consistency_limits;
828 return searchPositionIK(ik_pose, ik_seed_state, timeout, consistency_limits, solution, solution_callback, error_code,
833 const std::vector<double>& ik_seed_state,
double timeout,
834 const std::vector<double>& consistency_limits,
835 std::vector<double>& solution,
const IKCallbackFn& solution_callback,
836 moveit_msgs::MoveItErrorCodes& error_code,
845 if (free_params_.size() == 0)
849 std::vector<geometry_msgs::Pose> ik_poses(1, ik_pose);
850 std::vector<std::vector<double>> solutions;
853 if (!getPositionIK(ik_poses, ik_seed_state, solutions, kinematic_result, options))
856 error_code.val = moveit_msgs::MoveItErrorCodes::NO_IK_SOLUTION;
861 std::vector<LimitObeyingSol> solutions_obey_limits;
862 for (std::size_t i = 0; i < solutions.size(); ++i)
865 for (std::size_t j = 0; j < ik_seed_state.size(); ++j)
867 dist_from_seed += fabs(ik_seed_state[j] - solutions[i][j]);
870 solutions_obey_limits.push_back({ solutions[i], dist_from_seed });
872 std::sort(solutions_obey_limits.begin(), solutions_obey_limits.end());
875 if (!solution_callback.empty())
877 for (std::size_t i = 0; i < solutions_obey_limits.size(); ++i)
879 solution_callback(ik_pose, solutions_obey_limits[i].
value, error_code);
880 if (error_code.val == moveit_msgs::MoveItErrorCodes::SUCCESS)
882 solution = solutions_obey_limits[i].value;
893 solution = solutions_obey_limits[0].value;
894 error_code.val = moveit_msgs::MoveItErrorCodes::SUCCESS;
904 error_code.val = error_code.NO_IK_SOLUTION;
908 if (ik_seed_state.size() != num_joints_)
911 << ik_seed_state.size());
912 error_code.val = error_code.NO_IK_SOLUTION;
916 if (!consistency_limits.empty() && consistency_limits.size() != num_joints_)
919 << num_joints_ <<
" instead of size " << consistency_limits.size());
920 error_code.val = error_code.NO_IK_SOLUTION;
930 std::vector<double> vfree(free_params_.size());
935 double initial_guess = ik_seed_state[free_params_[0]];
936 vfree[0] = initial_guess;
940 int num_positive_increments;
941 int num_negative_increments;
943 if (!consistency_limits.empty())
947 double max_limit = fmin(joint_max_vector_[free_params_[0]], initial_guess + consistency_limits[free_params_[0]]);
948 double min_limit = fmax(joint_min_vector_[free_params_[0]], initial_guess - consistency_limits[free_params_[0]]);
950 num_positive_increments = (int)((max_limit - initial_guess) / search_discretization_);
951 num_negative_increments = (int)((initial_guess - min_limit) / search_discretization_);
955 num_positive_increments = (joint_max_vector_[free_params_[0]] - initial_guess) / search_discretization_;
956 num_negative_increments = (initial_guess - joint_min_vector_[free_params_[0]]) / search_discretization_;
962 ROS_DEBUG_STREAM_NAMED(
"ikfast",
"Free param is " << free_params_[0] <<
" initial guess is " << initial_guess
963 <<
", # positive increments: " << num_positive_increments
964 <<
", # negative increments: " << num_negative_increments);
965 if ((search_mode &
OPTIMIZE_MAX_JOINT) && (num_positive_increments + num_negative_increments) > 1000)
968 double best_costs = -1.0;
969 std::vector<double> best_solution;
970 int nattempts = 0, nvalid = 0;
975 int numsol = solve(frame, vfree, solutions);
983 for (
int s = 0;
s < numsol; ++
s)
986 std::vector<double> sol;
987 getSolution(solutions, ik_seed_state,
s, sol);
989 bool obeys_limits =
true;
990 for (
unsigned int i = 0; i < sol.size(); i++)
992 if (joint_has_limits_vector_[i] && (sol[i] < joint_min_vector_[i] || sol[i] > joint_max_vector_[i]))
994 obeys_limits =
false;
1002 getSolution(solutions, ik_seed_state,
s, solution);
1005 if (!solution_callback.empty())
1007 solution_callback(ik_pose, solution, error_code);
1011 error_code.val = error_code.SUCCESS;
1014 if (error_code.val == error_code.SUCCESS)
1017 if (search_mode & OPTIMIZE_MAX_JOINT)
1021 for (
unsigned int i = 0; i < solution.size(); i++)
1023 double d = fabs(ik_seed_state[i] - solution[i]);
1027 if (costs < best_costs || best_costs == -1.0)
1030 best_solution = solution;
1041 if (!getCount(counter, num_positive_increments, -num_negative_increments))
1044 error_code.val = moveit_msgs::MoveItErrorCodes::NO_IK_SOLUTION;
1048 vfree[0] = initial_guess + search_discretization_ * counter;
1054 if ((search_mode & OPTIMIZE_MAX_JOINT) && best_costs != -1.0)
1056 solution = best_solution;
1057 error_code.val = error_code.SUCCESS;
1062 error_code.val = moveit_msgs::MoveItErrorCodes::NO_IK_SOLUTION;
1068 std::vector<double>& solution, moveit_msgs::MoveItErrorCodes& error_code,
1079 if (ik_seed_state.size() < num_joints_)
1081 ROS_ERROR_STREAM(
"ik_seed_state only has " << ik_seed_state.size() <<
" entries, this ikfast solver requires " 1087 for (std::size_t i = 0; i < ik_seed_state.size(); i++)
1090 if (joint_has_limits_vector_[i] && ((ik_seed_state[i] < (joint_min_vector_[i] -
LIMIT_TOLERANCE)) ||
1094 <<
" has limit: " << joint_has_limits_vector_[i] <<
" being " 1095 << joint_min_vector_[i] <<
" to " << joint_max_vector_[i]);
1100 std::vector<double> vfree(free_params_.size());
1101 for (std::size_t i = 0; i < free_params_.size(); ++i)
1103 int p = free_params_[i];
1104 ROS_ERROR(
"%u is %f", p, ik_seed_state[p]);
1105 vfree[i] = ik_seed_state[p];
1112 int numsol = solve(frame, vfree, solutions);
1115 std::vector<LimitObeyingSol> solutions_obey_limits;
1119 std::vector<double> solution_obey_limits;
1120 for (std::size_t
s = 0;
s < numsol; ++
s)
1122 std::vector<double> sol;
1123 getSolution(solutions, ik_seed_state,
s, sol);
1124 ROS_DEBUG_NAMED(
"ikfast",
"Sol %d: %e %e %e %e %e %e", (
int)
s, sol[0], sol[1], sol[2], sol[3], sol[4],
1127 bool obeys_limits =
true;
1128 for (std::size_t i = 0; i < sol.size(); i++)
1131 if (joint_has_limits_vector_[i] && ((sol[i] < (joint_min_vector_[i] -
LIMIT_TOLERANCE)) ||
1135 obeys_limits =
false;
1137 << joint_has_limits_vector_[i] <<
" being " 1138 << joint_min_vector_[i] <<
" to " << joint_max_vector_[i]);
1145 getSolution(solutions, ik_seed_state, s, solution_obey_limits);
1147 for (std::size_t i = 0; i < ik_seed_state.size(); ++i)
1149 dist_from_seed += fabs(ik_seed_state[i] - solution_obey_limits[i]);
1152 solutions_obey_limits.push_back({ solution_obey_limits, dist_from_seed });
1162 if (!solutions_obey_limits.empty())
1164 std::sort(solutions_obey_limits.begin(), solutions_obey_limits.end());
1165 solution = solutions_obey_limits[0].value;
1166 error_code.val = moveit_msgs::MoveItErrorCodes::SUCCESS;
1170 error_code.val = moveit_msgs::MoveItErrorCodes::NO_IK_SOLUTION;
1175 const std::vector<double>& ik_seed_state,
1176 std::vector<std::vector<double>>& solutions,
1189 if (ik_poses.empty())
1196 if (ik_poses.size() > 1)
1198 ROS_ERROR(
"ik_poses contains multiple entries, only one is allowed");
1203 if (ik_seed_state.size() < num_joints_)
1205 ROS_ERROR_STREAM(
"ik_seed_state only has " << ik_seed_state.size() <<
" entries, this ikfast solver requires " 1214 std::vector<IkSolutionList<IkReal>> solution_set;
1216 std::vector<double> vfree;
1218 std::vector<double> sampled_joint_vals;
1219 if (!redundant_joint_indices_.empty())
1222 sampled_joint_vals.push_back(ik_seed_state[redundant_joint_indices_[0]]);
1226 joint_has_limits_vector_[redundant_joint_indices_.front()])
1228 double joint_min = joint_min_vector_[redundant_joint_indices_.front()];
1229 double joint_max = joint_max_vector_[redundant_joint_indices_.front()];
1231 double jv = sampled_joint_vals[0];
1247 for (
unsigned int i = 0; i < sampled_joint_vals.size(); i++)
1250 vfree.push_back(sampled_joint_vals[i]);
1251 numsol += solve(frame, vfree, ik_solutions);
1252 solution_set.push_back(ik_solutions);
1258 numsol = solve(frame, vfree, ik_solutions);
1259 solution_set.push_back(ik_solutions);
1263 bool solutions_found =
false;
1269 for (
unsigned int r = 0;
r < solution_set.size();
r++)
1271 ik_solutions = solution_set[
r];
1273 for (
int s = 0;
s < numsol; ++
s)
1275 std::vector<double> sol;
1276 getSolution(ik_solutions, ik_seed_state,
s, sol);
1278 bool obeys_limits =
true;
1279 for (
unsigned int i = 0; i < sol.size(); i++)
1282 if (joint_has_limits_vector_[i] && ((sol[i] < (joint_min_vector_[i] -
LIMIT_TOLERANCE)) ||
1286 obeys_limits =
false;
1288 "ikfast",
"Not in limits! " << i <<
" value " << sol[i] <<
" has limit: " << joint_has_limits_vector_[i]
1289 <<
" being " << joint_min_vector_[i] <<
" to " << joint_max_vector_[i]);
1296 solutions_found =
true;
1297 solutions.push_back(sol);
1302 if (solutions_found)
1318 std::vector<double>& sampled_joint_vals)
const 1320 double joint_min = -
M_PI;
1321 double joint_max =
M_PI;
1322 int index = redundant_joint_indices_.front();
1323 double joint_dscrt = redundant_joint_discretization_.at(index);
1325 if (joint_has_limits_vector_[redundant_joint_indices_.front()])
1327 joint_min = joint_min_vector_[index];
1328 joint_max = joint_max_vector_[index];
1335 int steps = std::ceil((joint_max - joint_min) / joint_dscrt);
1336 for (
unsigned int i = 0; i < steps; i++)
1338 sampled_joint_vals.push_back(joint_min + joint_dscrt * i);
1340 sampled_joint_vals.push_back(joint_max);
1345 int steps = std::ceil((joint_max - joint_min) / joint_dscrt);
1346 steps = steps > 0 ? steps : 1;
1347 double diff = joint_max - joint_min;
1348 for (
int i = 0; i < steps; i++)
1350 sampled_joint_vals.push_back(((diff * std::rand()) / (static_cast<double>(RAND_MAX))) + joint_min);
1359 ROS_ERROR_STREAM(
"Discretization method " << method <<
" is not supported");
virtual const IkSolutionBase< T > & GetSolution(size_t index) const
returns the solution pointer
KinematicError kinematic_error
bool initialize(const std::string &robot_description, const std::string &group_name, const std::string &base_name, const std::string &tip_name, double search_discretization)
const std::vector< std::string > & getLinkNames() const
#define ROS_DEBUG_STREAM_NAMED(name, args)
#define ROS_ERROR_STREAM_NAMED(name, args)
URDF_EXPORT bool initString(const std::string &xmlstring)
#define ROS_WARN_NAMED(name,...)
bool getCount(int &count, const int &max_count, const int &min_count) const
ROSCONSOLE_DECL void initialize()
virtual size_t GetNumSolutions() const
returns the number of solutions stored
the mask for the unique ids
void getClosestSolution(const IkSolutionList< IkReal > &solutions, const std::vector< double > &ik_seed_state, std::vector< double > &solution) const
void setSearchDiscretization(const std::map< int, double > &discretization)
Sets the discretization value for the redundant joint.
UNSUPORTED_DISCRETIZATION_REQUESTED
ray on end effector coordinate system reaches desired global ray
IMETHOD Vector diff(const Vector &p_w_a, const Vector &p_w_b, double dt=1)
IkParameterizationType
The types of inverse kinematics parameterizations supported.
std::vector< int > free_params_
The discrete solutions are returned in this structure.
bool sampleRedundantJoint(kinematics::DiscretizationMethod method, std::vector< double > &sampled_joint_vals) const
samples the designated redundant joint using the chosen discretization method
local point on end effector origin reaches desired 3D global point
std::vector< std::string > link_names_
#define ROS_INFO_STREAM_NAMED(name, args)
bool operator<(const LimitObeyingSol &a) const
2D translation along XY plane
virtual void Clear()
clears all current solutions, note that any memory addresses returned from GetSolution will be invali...
virtual const std::vector< int > & GetFree() const =0
Gets the indices of the configuration space that have to be preset before a full solution can be retu...
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
Given a desired pose of the end-effector, search for the joint angles required to reach it...
IKFAST_API int GetNumFreeParameters()
void fillFreeParams(int count, int *array)
number of parameterizations (does not count IKP_None)
#define ROS_DEBUG_NAMED(name,...)
const double LIMIT_TOLERANCE
std::vector< double > value
bool setRedundantJoints(const std::vector< unsigned int > &redundant_joint_indices)
Overrides the default method to prevent changing the redundant joints.
#define ROS_WARN_STREAM_ONCE_NAMED(name, args)
end effector reaches desired 6D transformation
end effector reaches desired 3D rotation
#define ROS_FATAL_STREAM_NAMED(name, args)
IKFAST_API bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions)
bool searchParam(const std::string &key, std::string &result) const
std::vector< bool > joint_has_limits_vector_
void poseMsgToKDL(const geometry_msgs::Pose &m, KDL::Frame &k)
IKFAST_API int * GetFreeParameters()
direction on end effector coordinate system points to desired 3D position
DiscretizationMethod discretization_method
PLUGINLIB_EXPORT_CLASS(ikfast_kinematics_plugin::IKFastKinematicsPlugin, kinematics::KinematicsBase)
double harmonize(const std::vector< double > &ik_seed_state, std::vector< double > &solution) const
def xml_string(rootXml, addHeader=True)
boost::function< void(const geometry_msgs::Pose &ik_pose, const std::vector< double > &ik_solution, moveit_msgs::MoveItErrorCodes &error_code)> IKCallbackFn
direction on end effector coordinate system reaches desired direction
virtual void GetSolution(T *solution, const T *freevalues) const =0
gets a concrete solution
const std::vector< std::string > & getJointNames() const
bit is set if the data represents the time-derivate velocity of an IkParameterization ...
void poseKDLToMsg(const KDL::Frame &k, geometry_msgs::Pose &m)
Default implementation of IkSolutionListBase.
bool getParam(const std::string &key, std::string &s) const
#define ROS_FATAL_NAMED(name,...)
#define ROS_ERROR_NAMED(name,...)
IKFAST_API int GetIkType()
MULTIPLE_TIPS_NOT_SUPPORTED
IKFAST_API int GetNumJoints()
#define ROS_ERROR_STREAM(args)
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
Given a desired pose of the end-effector, compute the joint angles to reach it.
int solve(KDL::Frame &pose_frame, const std::vector< double > &vfree, IkSolutionList< IkReal > &solutions) const
Calls the IK solver from IKFast.
end effector origin reaches desired 3D translation
std::vector< double > joint_min_vector_
IKFAST_API void ComputeFk(const IkReal *j, IkReal *eetrans, IkReal *eerot)
bool getPositionFK(const std::vector< std::string > &link_names, const std::vector< double > &joint_angles, std::vector< geometry_msgs::Pose > &poses) const
Given a set of joint angles and a set of links, compute their pose.
std::vector< double > joint_max_vector_
void getSolution(const IkSolutionList< IkReal > &solutions, int i, std::vector< double > &solution) const
Gets a specific solution from the set.
#define ROS_WARN_STREAM_NAMED(name, args)
SEARCH_MODE
Search modes for searchPositionIK(), see there.