Crocoddyl
 
Loading...
Searching...
No Matches
force-base.hpp
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.
8
9#ifndef CROCODDYL_MULTIBODY_FORCE_BASE_HPP_
10#define CROCODDYL_MULTIBODY_FORCE_BASE_HPP_
11
12#include "crocoddyl/multibody/fwd.hpp"
13
14namespace crocoddyl {
15
16template <typename _Scalar>
18 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
19
20 typedef _Scalar Scalar;
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;
46 pinocchio::FrameIndex frame;
47 pinocchio::ReferenceFrame type;
48 SE3 jMf;
49 MatrixXs Jc;
50 Force f;
51 Force fext;
52 MatrixXs df_dx;
54 MatrixXs df_du;
56};
57
58} // namespace crocoddyl
59
60CROCODDYL_DECLARE_EXTERN_TEMPLATE_STRUCT(crocoddyl::ForceDataAbstractTpl)
61
62#endif // CROCODDYL_MULTIBODY_FORCE_BASE_HPP_
Force fext
External spatial force at the parent joint level.
PinocchioData * pinocchio
Pinocchio data.
pinocchio::FrameIndex frame
Frame index of the contact frame.
SE3 jMf
Local frame placement of the contact frame.
pinocchio::ReferenceFrame type
Type of contact.
MatrixXs Jc
Contact Jacobian.
Force f
Contact force expressed in the coordinate defined by type.