27 DT_SEC(1.0 / sample_frequency), FILTER_CONST(filter_constant),
30 nj(CHAIN.getNrOfJoints()), ns(CHAIN.getNrOfSegments()),
31 jnt_mass_matrix(nj), previous_jnt_mass_matrix(nj), jnt_mass_matrix_dot(nj),
32 initial_jnt_momentum(nj), estimated_momentum_integral(nj), filtered_estimated_ext_torque(nj),
33 gravity_torque(nj), coriolis_torque(nj), total_torque(nj), estimated_ext_torque(nj),
35 jacobian_end_eff_transpose(Eigen::MatrixXd::Zero(nj, 6)), jacobian_end_eff_transpose_inv(Eigen::MatrixXd::Zero(6, nj)),
36 U(Eigen::MatrixXd::Zero(nj, 6)), V(Eigen::MatrixXd::Zero(6, 6)),
37 S(Eigen::VectorXd::Zero(6)), S_inv(Eigen::VectorXd::Zero(6)), tmp(Eigen::VectorXd::Zero(6)),
38 ESTIMATION_GAIN(Eigen::VectorXd::Constant(nj, estimation_gain)),
39 dynparam_solver(CHAIN, gravity),
40 jacobian_solver(CHAIN),
62 U.conservativeResizeLike(Eigen::MatrixXd::Zero(
nj, 6));
63 V.conservativeResizeLike(Eigen::MatrixXd::Zero(6, 6));
64 S.conservativeResizeLike(Eigen::VectorXd::Zero(6));
65 S_inv.conservativeResizeLike(Eigen::VectorXd::Zero(6));
66 tmp.conservativeResizeLike(Eigen::VectorXd::Zero(6));
77 if (joint_position.
rows() !=
nj || joint_velocity.
rows() !=
nj)
120 if (joint_position.
rows() !=
nj || joint_velocity.
rows() !=
nj || joint_torque.
rows() !=
nj)
183 for (
int i = 0; i <
S.size(); ++i)
191 for (
int i = 0; i < 6; i++)
192 external_wrench(i) = estimated_wrench(i);
206 if (
E_FKSOLVERPOS_FAILED == error)
return "Internally-used Forward Position Kinematics (Recursive) solver failed";
207 else if (
E_JACSOLVER_FAILED == error)
return "Internally-used Jacobian solver failed";
static const int E_JACSOLVER_FAILED
Internally-used Forward Position Kinematics (Recursive) solver failed.
static const int E_FKSOLVERPOS_FAILED
Eigen::VectorXd ESTIMATION_GAIN
virtual int JntToCart(const JntArray &q_in, Frame &p_out, int segmentNr=-1)
Jacobian jacobian_end_eff
void resize(unsigned int newNrOfColumns)
Allocates memory for new size (can break realtime behavior)
virtual void updateInternalDataStructures()
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
unsigned int getNrOfSegments() const
This class represents an fixed size array containing joint values of a KDL::Chain.
JntArray initial_jnt_momentum
int JntToExtWrench(const JntArray &joint_position, const JntArray &joint_velocity, const JntArray &joint_torque, Wrench &external_wrench)
JntArray estimated_ext_torque
Input size does not match internal state.
Eigen::MatrixXd jacobian_end_eff_transpose_inv
void setSVDEps(const double eps_in)
static const int E_DYNPARAMSOLVERMASS_FAILED
Internally-used Jacobian solver failed.
unsigned int rows() const
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Matrix< double, 6, Eigen::Dynamic > data
IMETHOD void SetToZero(Vector &v)
virtual void updateInternalDataStructures()
ChainJntToJacSolver jacobian_solver
unsigned int getNrOfJoints() const
A concrete implementation of a 3 dimensional vector class.
ChainFkSolverPos_recursive fk_pos_solver
Internal svd calculation failed.
ChainDynParam dynparam_solver
virtual const char * strError(const int error) const
ChainExternalWrenchEstimator(const Chain &chain, const Vector &gravity, const double sample_frequency, const double estimation_gain, const double filter_constant, const double eps=0.00001, const int maxiter=150)
Internally-used Dynamics Parameters (Gravity) solver failed.
int svd_eigen_HH(const Eigen::MatrixXd &A, Eigen::MatrixXd &U, Eigen::VectorXd &S, Eigen::MatrixXd &V, Eigen::VectorXd &tmp, int maxiter, double epsilon)
JntArray filtered_estimated_ext_torque
friend bool changeBase(const Jacobian &src1, const Rotation &rot, Jacobian &dest)
virtual void updateInternalDataStructures()
const double FILTER_CONST
static const int E_DYNPARAMSOLVERGRAVITY_FAILED
Internally-used Dynamics Parameters (Coriolis) solver failed.
JntSpaceInertiaMatrix jnt_mass_matrix_dot
JntSpaceInertiaMatrix jnt_mass_matrix
int setInitialMomentum(const JntArray &joint_position, const JntArray &joint_velocity)
virtual int JntToCoriolis(const JntArray &q, const JntArray &q_dot, JntArray &coriolis)
void resize(unsigned int newSize)
represents a frame transformation in 3D space (rotation + translation)
virtual void updateInternalDataStructures()
void getEstimatedJntTorque(JntArray &external_joint_torque)
represents both translational and rotational acceleration.
virtual const char * strError(const int error) const
Eigen::MatrixXd jacobian_end_eff_transpose
Eigen::Matrix< double, 6, 1 > Vector6d
JntSpaceInertiaMatrix previous_jnt_mass_matrix
void setSVDMaxIter(const int maxiter_in)
virtual int JntToJac(const JntArray &q_in, Jacobian &jac, int seg_nr=-1)
static const int E_DYNPARAMSOLVERCORIOLIS_FAILED
Internally-used Dynamics Parameters (Mass) solver failed.
virtual int JntToMass(const JntArray &q, JntSpaceInertiaMatrix &H)
int error
Latest error, initialized to E_NOERROR in constructor.
virtual int JntToGravity(const JntArray &q, JntArray &gravity)
JntArray estimated_momentum_integral