20 template <
size_t NUM_OUTPUTS,
size_t NUM_JOINTS,
size_t NUM_CONTACTPOINTS>
24 typedef std::shared_ptr<OperationalModel<NUM_OUTPUTS, NUM_JOINTS, NUM_CONTACTPOINTS>>
ptr;
35 const jacobian_class_ptr_t& jacobianPtr,
36 const coordinate_class_ptr_t& coordinatePtr =
nullptr)
37 : Base(jacobianPtr, coordinatePtr), fullModelPtr_(fullModelPtr), jacobianPtr_(jacobianPtr)
40 throw std::runtime_error(
"Model pointer in is not instantiated!");
42 throw std::runtime_error(
"Task space Jacobian pointer in is not instantiated!");
52 void update(
const state_t& state)
override 56 fullModelPtr_->update(state);
63 Base::M_ = Jdager.transpose() * fullModelPtr_->M() * Jdager;
65 Base::C_ = Jdager.transpose() * fullModelPtr_->C() -
67 Base::G_ = Jdager.transpose() * fullModelPtr_->G();
68 Base::S_ = fullModelPtr_->S() * Jdager;
70 for (
size_t i = 0;
i < NUM_CONTACTPOINTS;
i++)
80 const Eigen::MatrixXd& orthogonalSystemS = Eigen::MatrixXd::Zero(NUM_JOINTS, 0))
82 Eigen::Matrix<double, NUM_JOINTS, NUM_JOINTS> fixedBaseMassMatrix =
83 (fullModelPtr_->S() * fullModelPtr_->MInverse() * fullModelPtr_->S().transpose())
85 .solve(Eigen::MatrixXd::Identity(NUM_JOINTS, NUM_JOINTS));
87 Eigen::Matrix<double, NUM_JOINTS, NUM_JOINTS> W0 = fixedBaseMassMatrix;
90 Eigen::Matrix<double, NUM_JOINTS, NUM_JOINTS> W;
91 if (orthogonalSystemS.cols() != 0)
93 W0 * orthogonalSystemS *
94 (orthogonalSystemS.transpose() * W0 * orthogonalSystemS)
96 .solve(Eigen::MatrixXd::Identity(orthogonalSystemS.cols(), orthogonalSystemS.cols())) *
97 orthogonalSystemS.transpose() * W0;
103 (
Base::S_.transpose() * W *
Base::S_).
ldlt().solve(Eigen::MatrixXd::Identity(NUM_OUTPUTS, NUM_OUTPUTS));
104 return STransposeDager_;
109 jacobian_class_ptr_t jacobianPtr_;
118 fullModelPtr_->update(state);
123 const Eigen::MatrixXd& orthogonalSystemS)
125 STransposeDager_.setZero();
126 return STransposeDager_;
OperationalModel()=delete
Base::jacobian_t jacobian_t
Definition: OperationalModel.h:29
OperationalJacobianBase< NUM_OUTPUTS, NUM_JOINTS >::ptr jacobian_class_ptr_t
Definition: OperationalModelBase.h:35
state_t state_
Definition: OperationalModelBase.h:105
OperationalModelBase< NUM_JOINTS+6, NUM_JOINTS, NUM_CONTACTPOINTS >::ptr full_body_model_ptr_t
Definition: OperationalModel.h:26
S_t S_
Definition: OperationalModelBase.h:111
Base::jacobian_inv_t jacobian_inv_t
Definition: OperationalModel.h:30
OperationalJacobianBase< NUM_OUTPUTS, NUM_JOINTS >::jacobian_inv_t jacobian_inv_t
Definition: OperationalModelBase.h:39
OperationalModel(const full_body_model_ptr_t &fullModelPtr, const jacobian_class_ptr_t &jacobianPtr, const coordinate_class_ptr_t &coordinatePtr=nullptr)
Definition: OperationalModel.h:34
M_t MInverse_
Definition: OperationalModelBase.h:108
~OperationalModel()
Definition: OperationalModel.h:46
void update(const state_t &state) override
Definition: OperationalModel.h:52
G_t G_
Definition: OperationalModelBase.h:110
M_t M_
Definition: OperationalModelBase.h:107
This is the class for the operational space model which gives access to the operational model paramet...
Definition: OperationalModel.h:21
std::shared_ptr< OperationalModel< NUM_OUTPUTS, NUM_JOINTS, NUM_CONTACTPOINTS > > ptr
Definition: OperationalModel.h:24
C_t C_
Definition: OperationalModelBase.h:109
OperationalModelBase< NUM_OUTPUTS, NUM_JOINTS, NUM_CONTACTPOINTS > Base
Definition: OperationalModel.h:27
Eigen::Matrix< double, NUM_JOINTS, NUM_OUTPUTS > S_t
Definition: OperationalModelBase.h:45
Base::coordinate_class_ptr_t coordinate_class_ptr_t
Definition: OperationalModel.h:32
Base::jacobian_class_ptr_t jacobian_class_ptr_t
Definition: OperationalModel.h:31
Definition: OperationalModelBase.h:29
OperationalJacobianBase< NUM_OUTPUTS, NUM_JOINTS >::jacobian_t jacobian_t
Definition: OperationalModelBase.h:37
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_class_ptr_t getJacobianPtr()
Definition: OperationalModel.h:78
const Base::S_t & STransposeDager(const Eigen::MatrixXd &orthogonalSystemS=Eigen::MatrixXd::Zero(NUM_JOINTS, 0))
Definition: OperationalModel.h:79
jacobian_class_ptr_t jacobianPtr_
Definition: OperationalModelBase.h:102
Base::state_t state_t
Definition: OperationalModel.h:28
std::array< Jc_t, NUM_CONTACTPOINTS > AllJc_
Definition: OperationalModelBase.h:112
CoordinateBase< NUM_OUTPUTS, NUM_JOINTS >::ptr coordinate_class_ptr_t
Definition: OperationalModelBase.h:34
coordinate_vector_t toCoordinateVelocity() const
Definition: RBDState.h:144