12 namespace robot_model {
14 using Matrix4dVector = std::vector<Matrix4d, Eigen::aligned_allocator<Eigen::Matrix4d> >;
15 using MatrixXdVector = std::vector<MatrixXd, Eigen::aligned_allocator<Eigen::MatrixXd> >;
41 double _weight, _x, _y,
_z;
52 const double _matrix[9];
62 double _weight, _x, _y,
_z;
68 JointLimitConstraint(
const Eigen::VectorXd& min_positions,
const Eigen::VectorXd& max_positions);
69 JointLimitConstraint(
double weight,
const Eigen::VectorXd& min_positions,
const Eigen::VectorXd& max_positions);
103 static_assert(std::is_convertible<T*, Objective*>::value,
104 "Must pass arguments of base type hebi::robot_model::Objective to the variable args of solveIK!");
105 return static_cast<const Objective*
>(&objective)->addObjective(ik);
111 template<
typename T,
typename ... Args>
114 static_assert(std::is_convertible<T*, Objective*>::value,
115 "Must pass arguments of base type hebi::robot_model::Objective to the variable args of solveIK!");
116 auto res =
static_cast<const Objective*
>(&objective)->addObjective(ik);
119 return addObjectives(ik, args ...);
125 static void setTranslate(Eigen::Matrix4d& matrix,
double x,
double y,
double z);
130 static void setRotX(Eigen::Matrix4d& matrix,
double radians);
135 static void setSphereInertia(Eigen::VectorXd& inertia,
double mass,
double radius);
140 static void setRodXAxisInertia(Eigen::VectorXd& inertia,
double mass,
double length);
196 void setBaseFrame(
const Eigen::Matrix4d& base_frame);
202 Eigen::Matrix4d getBaseFrame()
const;
219 size_t getDoFCount()
const;
244 const Eigen::Matrix4d& com,
245 const Eigen::VectorXd& inertia,
247 const Eigen::Matrix4d& output,
285 bool addLink(
LinkType link_type,
double extension,
double twist);
348 void getEndEffector(
const Eigen::VectorXd& positions, Eigen::Matrix4d& transform)
const;
356 template<
typename ... Args>
359 return solveIK(initial_positions, result, args ...);
376 template<
typename ... Args>
378 Eigen::VectorXd& result,
379 Args ... objectives)
const 386 res.
result = addObjectives(ik, objectives ...);
394 auto positions_array =
new double[initial_positions.size()];
397 tmp = initial_positions;
399 auto result_array =
new double[initial_positions.size()];
405 delete[] positions_array;
410 delete[] result_array;
443 void getJacobianEndEffector(
const Eigen::VectorXd& positions, Eigen::MatrixXd& jacobian)
const;
463 void getJEndEffector(
const Eigen::VectorXd& positions, Eigen::MatrixXd& jacobian)
const;
473 void getMasses(Eigen::VectorXd& masses)
const;
Eigen::VectorXd _max_positions
std::vector< Matrix4d, Eigen::aligned_allocator< Eigen::Matrix4d > > Matrix4dVector
void hebiIKRelease(HebiIKPtr ik)
Frees resources created by this inverse kinematics object.
static const std::map< ActuatorType, double > actuator_masses_
HebiStatusCode addObjectives(HebiIKPtr ik, const T &objective) const
A matrix or vector expression mapping an existing array of data.
struct _HebiIK * HebiIKPtr
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
HebiStatusCode addObjectives(HebiIKPtr ik, const T &objective, Args...args) const
HebiRobotModelPtr const internal_
#define HEBI_DISABLE_COPY_MOVE(Class)
Represents a chain or tree of robot elements (rigid bodies and joints).
Eigen::VectorXd _min_positions
struct _HebiRobotModel * HebiRobotModelPtr
HebiIKPtr hebiIKCreate(void)
Creates an IK (inverse kinematics) object that allows for solving for joint angles/positions given ob...
IKResult solveInverseKinematics(const Eigen::VectorXd &initial_positions, Eigen::VectorXd &result, Args...args) const
Solves for an inverse kinematics solution given a set of objectives.
HebiStatusCode hebiIKSolve(HebiIKPtr ik, HebiRobotModelPtr model, const double *initial_positions, double *ik_solution, void *result_info)
Solves for an inverse kinematics solution that moves the end effector to a given point.
struct _HebiRobotModelElement * HebiRobotModelElementPtr
TFSIMD_FORCE_INLINE const tfScalar & z() const
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
IKResult solveIK(const Eigen::VectorXd &initial_positions, Eigen::VectorXd &result, Args...objectives) const
Solves for an inverse kinematics solution given a set of objectives.
std::vector< MatrixXd, Eigen::aligned_allocator< Eigen::MatrixXd > > MatrixXdVector