| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /////////////////////////////////////////////////////////////////////////////// | ||
| 2 | // BSD 3-Clause License | ||
| 3 | // | ||
| 4 | // Copyright (C) 2021-2025, University of Edinburgh, Heriot-Watt University | ||
| 5 | // Copyright note valid unless otherwise stated in individual files. | ||
| 6 | // All rights reserved. | ||
| 7 | /////////////////////////////////////////////////////////////////////////////// | ||
| 8 | |||
| 9 | #ifndef CROCODDYL_MULTIBODY_FORCE_BASE_HPP_ | ||
| 10 | #define CROCODDYL_MULTIBODY_FORCE_BASE_HPP_ | ||
| 11 | |||
| 12 | #include "crocoddyl/multibody/fwd.hpp" | ||
| 13 | |||
| 14 | namespace crocoddyl { | ||
| 15 | |||
| 16 | template <typename _Scalar> | ||
| 17 | struct ForceDataAbstractTpl { | ||
| 18 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW | ||
| 19 | |||
| 20 | typedef _Scalar Scalar; | ||
| 21 | typedef MathBaseTpl<Scalar> MathBase; | ||
| 22 | typedef typename MathBase::VectorXs VectorXs; | ||
| 23 | typedef typename MathBase::MatrixXs MatrixXs; | ||
| 24 | typedef typename pinocchio::DataTpl<Scalar> PinocchioData; | ||
| 25 | typedef typename pinocchio::SE3Tpl<Scalar> SE3; | ||
| 26 | typedef typename pinocchio::ForceTpl<Scalar> Force; | ||
| 27 | |||
| 28 | template <template <typename Scalar> class Model> | ||
| 29 | ✗ | ForceDataAbstractTpl(Model<Scalar>* const model, PinocchioData* const data) | |
| 30 | ✗ | : pinocchio(data), | |
| 31 | ✗ | frame(0), | |
| 32 | ✗ | type(model->get_type()), | |
| 33 | ✗ | jMf(SE3::Identity()), | |
| 34 | ✗ | Jc(model->get_nc(), model->get_state()->get_nv()), | |
| 35 | ✗ | f(Force::Zero()), | |
| 36 | ✗ | fext(Force::Zero()), | |
| 37 | ✗ | df_dx(model->get_nc(), model->get_state()->get_ndx()), | |
| 38 | ✗ | df_du(model->get_nc(), model->get_nu()) { | |
| 39 | ✗ | Jc.setZero(); | |
| 40 | ✗ | df_dx.setZero(); | |
| 41 | ✗ | df_du.setZero(); | |
| 42 | ✗ | } | |
| 43 | ✗ | virtual ~ForceDataAbstractTpl() = default; | |
| 44 | |||
| 45 | PinocchioData* pinocchio; //!< Pinocchio data | ||
| 46 | pinocchio::FrameIndex frame; //!< Frame index of the contact frame | ||
| 47 | pinocchio::ReferenceFrame type; //!< Type of contact | ||
| 48 | SE3 jMf; //!< Local frame placement of the contact frame | ||
| 49 | MatrixXs Jc; //!< Contact Jacobian | ||
| 50 | Force f; //!< Contact force expressed in the coordinate defined by type | ||
| 51 | Force fext; //!< External spatial force at the parent joint level | ||
| 52 | MatrixXs df_dx; //!< Jacobian of the contact forces expressed in the | ||
| 53 | //!< coordinate defined by type | ||
| 54 | MatrixXs df_du; //!< Jacobian of the contact forces expressed in the | ||
| 55 | //!< coordinate defined by type | ||
| 56 | }; | ||
| 57 | |||
| 58 | } // namespace crocoddyl | ||
| 59 | |||
| 60 | CROCODDYL_DECLARE_EXTERN_TEMPLATE_STRUCT(crocoddyl::ForceDataAbstractTpl) | ||
| 61 | |||
| 62 | #endif // CROCODDYL_MULTIBODY_FORCE_BASE_HPP_ | ||
| 63 |