Skip to content

Commit

Permalink
Add overload method for calcInvKin to take single KinGroupIKInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Feb 24, 2022
1 parent 8926baa commit 057ae14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,23 @@ class KinematicGroup : public JointGroup
/**
* @brief Calculates joint solutions given a pose.
* @details If redundant solutions are needed see utility function getRedundantSolutions.
* @param solutions A vector of solutions, so check the size of the vector to determine the number of solutions
* @param tip_link_poses The input information to solve inverse kinematics for. There must be an input for each link
* provided in getTipLinkNames
* @param seed Vector of seed joint angles (size must match number of joints in robot chain)
* @return A vector of solutions, If empty it failed to find a solution (including uninitialized)
*/
IKSolutions calcInvKin(const KinGroupIKInputs& tip_link_poses, const Eigen::Ref<const Eigen::VectorXd>& seed) const;

/**
* @brief Calculates joint solutions given a pose.
* @details If redundant solutions are needed see utility function getRedundantSolutions.
* @param tip_link_pose The input information to solve inverse kinematics for. This is a convenience function for
* when only one tip link exists
* @param seed Vector of seed joint angles (size must match number of joints in robot chain)
* @return A vector of solutions, If empty it failed to find a solution (including uninitialized)
*/
IKSolutions calcInvKin(const KinGroupIKInput& tip_link_pose, const Eigen::Ref<const Eigen::VectorXd>& seed) const;

/** @brief Returns all possible working frames in which goal poses can be defined
* @details The inverse kinematics solver requires that all poses be defined relative to a single working frame.
* However if this working frame is static, a pose can be defined in another static frame in the environment and
Expand Down
6 changes: 6 additions & 0 deletions tesseract_kinematics/core/src/kinematic_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ IKSolutions KinematicGroup::calcInvKin(const KinGroupIKInputs& tip_link_poses,
return solutions_filtered;
}

IKSolutions KinematicGroup::calcInvKin(const KinGroupIKInput& tip_link_pose,
const Eigen::Ref<const Eigen::VectorXd>& seed) const
{
return calcInvKin(KinGroupIKInputs{ tip_link_pose }, seed);
}

std::vector<std::string> KinematicGroup::getAllValidWorkingFrames() const { return working_frames_; }

std::vector<std::string> KinematicGroup::getAllPossibleTipLinkNames() const
Expand Down

0 comments on commit 057ae14

Please sign in to comment.