19 template <
size_t NUM_OUTPUTS,
size_t NUM_JOINTS,
typename SCALAR>
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 typedef std::shared_ptr<OperationalJacobianBase<NUM_OUTPUTS, NUM_JOINTS, SCALAR>>
ptr;
29 typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic>
MatrixXs;
41 void updateState(
const state_t& state,
const square_matrix_t& weighting = square_matrix_t::Identity())
51 if (JUpdated_ ==
true)
62 if (dJdtUpdated_ ==
true)
73 if (JdagerUpdated_ ==
true)
76 JdagerUpdated_ =
true;
77 Jdager_ = W_ *
J().transpose() *
78 (
J() * W_ *
J().transpose()).
ldlt().solve(MatrixXs::Identity(NUM_OUTPUTS, NUM_OUTPUTS));
84 if (JdagerUpdated_ ==
true)
87 JdagerUpdated_ =
true;
88 Eigen::JacobiSVD<MatrixXs> svd(
J(), Eigen::ComputeThinU | Eigen::ComputeThinV);
89 Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> sing_values(
90 svd.matrixV().cols(), 1);
91 sing_values = (svd.singularValues().array() > 1e-9).select(svd.singularValues().array().inverse(), 0);
92 Jdager_ = svd.matrixV() * sing_values.asDiagonal() * svd.matrixU().transpose();
101 dJdagerdtUpdated_ =
true;
107 const square_matrix_t&
P()
109 if (PUpdated_ ==
true)
113 P_ = square_matrix_t::Identity() -
JdagerLDLT() *
J();
120 if (dPdtUpdated_ ==
true)
154 virtual void resetUpdatedFlags()
157 dJdtUpdated_ =
false;
158 JdagerUpdated_ =
false;
159 dJdagerdtUpdated_ =
false;
161 dPdtUpdated_ =
false;
171 bool dJdagerdtUpdated_;
179 jacobian_inv_t Jdager_;
180 jacobian_inv_t dJdagerdt_;
182 square_matrix_t dPdt_;
187 template <
size_t NUM_OUTPUTS,
size_t NUM_JOINTS>
const jacobian_inv_t & JdagerSVD()
Definition: OperationalJacobianBase.h:82
OperationalJacobianBase()
Definition: OperationalJacobianBase.h:32
JacobianBase< NUM_OUTPUTS, NUM_JOINTS, SCALAR >::state_t state_t
Definition: OperationalJacobianBase.h:25
Eigen::Matrix< SCALAR, 6+NUM_JOINTS, NUM_OUTPUTS > jacobian_inv_t
Definition: JacobianBase.h:25
Definition: OperationalJacobianBase.h:20
const jacobian_inv_t & dJdagerdt()
This method calculates the time derivative of right inverse.
Definition: OperationalJacobianBase.h:97
virtual ~OperationalJacobianBase()
Definition: OperationalJacobianBase.h:33
const jacobian_inv_t & JdagerLDLT()
This method calculates the right inverse using W as the weighting matrix.
Definition: OperationalJacobianBase.h:71
const square_matrix_t & dPdt()
This method calculates the time derivative of the null space projector.
Definition: OperationalJacobianBase.h:118
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
Definition: OperationalJacobianBase.h:29
Definition: JacobianBase.h:19
const jacobian_t & dJdt()
This method gets the time derivative of the floating-base Jacobian.
Definition: OperationalJacobianBase.h:60
const square_matrix_t & P()
This method calculates the null space projector.
Definition: OperationalJacobianBase.h:107
JacobianBase< NUM_OUTPUTS, NUM_JOINTS, SCALAR >::jacobian_inv_t jacobian_inv_t
Definition: OperationalJacobianBase.h:27
JacobianBase< NUM_OUTPUTS, NUM_JOINTS, SCALAR >::jacobian_t jacobian_t
Definition: OperationalJacobianBase.h:26
void updateState(const state_t &state, const square_matrix_t &weighting=square_matrix_t::Identity())
Definition: OperationalJacobianBase.h:41
virtual void getJacobianOrigin(const state_t &state, jacobian_t &J)=0
Eigen::Matrix< SCALAR, 6+NUM_JOINTS, 6+NUM_JOINTS > square_matrix_t
Definition: OperationalJacobianBase.h:28
void ldlt(const Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > &A, Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > &L, Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > &d)
jacobian_t J_
Definition: OperationalJacobianBase.h:151
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< OperationalJacobianBase< NUM_OUTPUTS, NUM_JOINTS, SCALAR > > ptr
Definition: OperationalJacobianBase.h:24
Eigen::Matrix< SCALAR, NUM_OUTPUTS, 6+NUM_JOINTS > jacobian_t
Definition: JacobianBase.h:24
virtual void getJacobianOriginDerivative(const state_t &state, jacobian_t &dJdt)=0
const jacobian_t & J()
This method gets the floating-base Jacobian.
Definition: OperationalJacobianBase.h:49
virtual void resetUserUpdatedFlags()
Definition: OperationalJacobianBase.h:132