kdl_inv_kin_chain_lma.h
Go to the documentation of this file.
1 
26 #ifndef TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_LMA_H
27 #define TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_LMA_H
30 #include <kdl/chainiksolverpos_lma.hpp>
31 #include <array>
32 #include <mutex>
34 
37 
38 namespace tesseract_kinematics
39 {
40 static const std::string KDL_INV_KIN_CHAIN_LMA_SOLVER_NAME = "KDLInvKinChainLMA";
41 
46 {
47 public:
48  // LCOV_EXCL_START
49  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50  // LCOV_EXCL_STOP
51 
52  using Ptr = std::shared_ptr<KDLInvKinChainLMA>;
53  using ConstPtr = std::shared_ptr<const KDLInvKinChainLMA>;
54  using UPtr = std::unique_ptr<KDLInvKinChainLMA>;
55  using ConstUPtr = std::unique_ptr<const KDLInvKinChainLMA>;
56 
65  struct Config
66  {
67  std::array<double, 6> task_weights{ 1.0, 1.0, 1.0, 0.1, 0.1, 0.1 };
68  double eps{ 1E-5 };
69  int max_iterations{ 500 };
70  double eps_joints{ 1E-15 };
71  };
72 
73  ~KDLInvKinChainLMA() override = default;
78 
88  const std::string& base_link,
89  const std::string& tip_link,
90  Config kdl_config,
91  std::string solver_name = KDL_INV_KIN_CHAIN_LMA_SOLVER_NAME);
92 
101  const std::vector<std::pair<std::string, std::string> >& chains,
102  Config kdl_config,
103  std::string solver_name = KDL_INV_KIN_CHAIN_LMA_SOLVER_NAME);
104 
106  const Eigen::Ref<const Eigen::VectorXd>& seed) const override final;
107 
108  std::vector<std::string> getJointNames() const override final;
109  Eigen::Index numJoints() const override final;
110  std::string getBaseLinkName() const override final;
111  std::string getWorkingFrame() const override final;
112  std::vector<std::string> getTipLinkNames() const override final;
113  std::string getSolverName() const override final;
114  InverseKinematics::UPtr clone() const override final;
115 
116 private:
119  std::unique_ptr<KDL::ChainIkSolverPos_LMA> ik_solver_;
121  mutable std::mutex mutex_;
124  IKSolutions calcInvKinHelper(const Eigen::Isometry3d& pose,
125  const Eigen::Ref<const Eigen::VectorXd>& seed,
126  int segment_num = -1) const;
127 };
128 
129 } // namespace tesseract_kinematics
130 #endif // TESSERACT_KINEMATICS_KDL_INV_KIN_CHAIN_LMA_H
tesseract_kinematics::KDLChainData
The KDLChainData struct.
Definition: kdl_utils.h:91
tesseract_kinematics::KDLInvKinChainLMA::KDLInvKinChainLMA
KDLInvKinChainLMA(const KDLInvKinChainLMA &other)
Definition: kdl_inv_kin_chain_lma.cpp:73
tesseract_kinematics::KDLInvKinChainLMA::kdl_config_
Config kdl_config_
KDL configuration data parsed from YAML.
Definition: kdl_inv_kin_chain_lma.h:118
tesseract_kinematics::KDLInvKinChainLMA::getTipLinkNames
std::vector< std::string > getTipLinkNames() const override final
Get the names of the tip links of the kinematics group.
Definition: kdl_inv_kin_chain_lma.cpp:152
tesseract_common::TransformMap
AlignedMap< std::string, Eigen::Isometry3d > TransformMap
tesseract_kinematics::InverseKinematics::ConstUPtr
std::unique_ptr< const InverseKinematics > ConstUPtr
Definition: inverse_kinematics.h:53
tesseract_kinematics::InverseKinematics::ConstPtr
std::shared_ptr< const InverseKinematics > ConstPtr
Definition: inverse_kinematics.h:51
inverse_kinematics.h
Inverse kinematics functions.
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_kinematics::KDLInvKinChainLMA::~KDLInvKinChainLMA
~KDLInvKinChainLMA() override=default
tesseract_scene_graph::SceneGraph
tesseract_kinematics::KDLInvKinChainLMA::getSolverName
std::string getSolverName() const override final
Get the name of the solver. Recommend using the name of the class.
Definition: kdl_inv_kin_chain_lma.cpp:154
tesseract_kinematics::KDLInvKinChainLMA::UPtr
std::unique_ptr< KDLInvKinChainLMA > UPtr
Definition: kdl_inv_kin_chain_lma.h:54
tesseract_kinematics::KDLInvKinChainLMA::getWorkingFrame
std::string getWorkingFrame() const override final
Get the inverse kinematics working frame.
Definition: kdl_inv_kin_chain_lma.cpp:150
tesseract_kinematics::InverseKinematics::UPtr
std::unique_ptr< InverseKinematics > UPtr
Definition: inverse_kinematics.h:52
tesseract_kinematics::KDLInvKinChainLMA::Config::eps_joints
double eps_joints
Definition: kdl_inv_kin_chain_lma.h:70
tesseract_kinematics::KDLInvKinChainLMA::numJoints
Eigen::Index numJoints() const override final
Number of joints in robot.
Definition: kdl_inv_kin_chain_lma.cpp:146
tesseract_kinematics::KDLInvKinChainLMA::calcInvKinHelper
IKSolutions calcInvKinHelper(const Eigen::Isometry3d &pose, const Eigen::Ref< const Eigen::VectorXd > &seed, int segment_num=-1) const
calcFwdKin helper function
Definition: kdl_inv_kin_chain_lma.cpp:90
tesseract_kinematics::KDLInvKinChainLMA
KDL Inverse kinematic chain implementation.
Definition: kdl_inv_kin_chain_lma.h:45
tesseract_kinematics::KDLInvKinChainLMA::kdl_data_
KDLChainData kdl_data_
KDL data parsed from Scene Graph.
Definition: kdl_inv_kin_chain_lma.h:117
tesseract_kinematics::KDL_INV_KIN_CHAIN_LMA_SOLVER_NAME
static const std::string KDL_INV_KIN_CHAIN_LMA_SOLVER_NAME
Definition: kdl_inv_kin_chain_lma.h:40
tesseract_kinematics::KDLInvKinChainLMA::Config::task_weights
std::array< double, 6 > task_weights
Definition: kdl_inv_kin_chain_lma.h:67
tesseract_kinematics::KDLInvKinChainLMA::Config
The Config struct.
Definition: kdl_inv_kin_chain_lma.h:65
tesseract_kinematics::KDLInvKinChainLMA::Config::max_iterations
int max_iterations
Definition: kdl_inv_kin_chain_lma.h:69
tesseract_kinematics::InverseKinematics
Inverse kinematics functions.
Definition: inverse_kinematics.h:43
TESSERACT_COMMON_IGNORE_WARNINGS_POP
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_kinematics::KDLInvKinChainLMA::mutex_
std::mutex mutex_
KDL is not thread safe due to mutable variables in Joint Class.
Definition: kdl_inv_kin_chain_lma.h:121
tesseract_kinematics::KDLInvKinChainLMA::calcInvKin
IKSolutions calcInvKin(const tesseract_common::TransformMap &tip_link_poses, const Eigen::Ref< const Eigen::VectorXd > &seed) const override final
Calculates joint solutions given a pose for each tip link.
Definition: kdl_inv_kin_chain_lma.cpp:137
tesseract_kinematics::KDLInvKinChainLMA::clone
InverseKinematics::UPtr clone() const override final
Clone the forward kinematics object.
Definition: kdl_inv_kin_chain_lma.cpp:71
tesseract_kinematics::InverseKinematics::Ptr
std::shared_ptr< InverseKinematics > Ptr
Definition: inverse_kinematics.h:50
tesseract_kinematics
Definition: forward_kinematics.h:40
tesseract_kinematics::KDLInvKinChainLMA::ik_solver_
std::unique_ptr< KDL::ChainIkSolverPos_LMA > ik_solver_
KDL Inverse kinematic solver.
Definition: kdl_inv_kin_chain_lma.h:119
kdl_utils.h
Tesseract KDL utility functions.
tesseract_kinematics::KDLInvKinChainLMA::solver_name_
std::string solver_name_
Name of this solver.
Definition: kdl_inv_kin_chain_lma.h:120
tesseract_kinematics::KDLInvKinChainLMA::getJointNames
std::vector< std::string > getJointNames() const override final
Get list of joint names for kinematic object.
Definition: kdl_inv_kin_chain_lma.cpp:144
tesseract_kinematics::KDLInvKinChainLMA::operator=
KDLInvKinChainLMA & operator=(const KDLInvKinChainLMA &other)
Definition: kdl_inv_kin_chain_lma.cpp:75
tesseract_kinematics::IKSolutions
std::vector< Eigen::VectorXd > IKSolutions
The inverse kinematics solutions container.
Definition: types.h:38
macros.h
tesseract_kinematics::KDLInvKinChainLMA::getBaseLinkName
std::string getBaseLinkName() const override final
Get the robot base link name.
Definition: kdl_inv_kin_chain_lma.cpp:148
tesseract_kinematics::KDLInvKinChainLMA::Config::eps
double eps
Definition: kdl_inv_kin_chain_lma.h:68


tesseract_kinematics
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:14