expose-constrained-dynamics-derivatives.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2021-2022 INRIA
3 //
4 
7 
10 
11 namespace bp = boost::python;
12 
13 namespace pinocchio
14 {
15  namespace python
16  {
18  RigidConstraintModelVector;
20  RigidConstraintDataVector;
21 
23  const context::Model & model,
25  const RigidConstraintModelVector & contact_models,
26  RigidConstraintDataVector & contact_datas,
28  {
31  const_cast<context::ProximalSettings &>(settings));
32 
33  return bp::make_tuple(
34  make_ref(data.ddq_dq), make_ref(data.ddq_dv), make_ref(data.ddq_dtau),
35  make_ref(data.dlambda_dq), make_ref(data.dlambda_dv), make_ref(data.dlambda_dtau));
36  }
37 
39  {
40  using namespace Eigen;
41 
42  bp::def(
43  "computeConstraintDynamicsDerivatives", computeConstraintDynamicsDerivatives_proxy,
44  (bp::arg("model"), bp::arg("data"), bp::arg("contact_models"), bp::arg("contact_datas"),
45  bp::arg("settings") = context::ProximalSettings()),
46  "Computes the derivatives of the forward dynamics with kinematic constraints (given in the "
47  "list of constraint models).\n"
48  "Assumes that constraintDynamics has been called first. See constraintDynamics for more "
49  "details.\n"
50  "This function returns the derivatives of joint acceleration (ddq) and contact forces "
51  "(lambda_c) of the system with respect to q, v and tau.\n"
52  "The output is a tuple with ddq_dq, ddq_dv, ddq_da, dlambda_dq, dlambda_dv, dlambda_da.");
53  }
54  } // namespace python
55 } // namespace pinocchio
boost::python
Eigen
pinocchio::python::context::RigidConstraintData
RigidConstraintDataTpl< Scalar, Options > RigidConstraintData
Definition: bindings/python/context/generic.hpp:146
pinocchio::DataTpl
Definition: context/generic.hpp:25
pinocchio::computeConstraintDynamicsDerivatives
void computeConstraintDynamicsDerivatives(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const std::vector< RigidConstraintModelTpl< Scalar, Options >, ConstraintModelAllocator > &contact_models, std::vector< RigidConstraintDataTpl< Scalar, Options >, ConstraintDataAllocator > &contact_data, const ProximalSettingsTpl< Scalar > &settings, const Eigen::MatrixBase< MatrixType1 > &ddq_partial_dq, const Eigen::MatrixBase< MatrixType2 > &ddq_partial_dv, const Eigen::MatrixBase< MatrixType3 > &ddq_partial_dtau, const Eigen::MatrixBase< MatrixType4 > &lambda_partial_dq, const Eigen::MatrixBase< MatrixType5 > &lambda_partial_dv, const Eigen::MatrixBase< MatrixType6 > &lambda_partial_dtau)
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::python::exposeConstraintDynamicsDerivatives
void exposeConstraintDynamicsDerivatives()
Definition: expose-constrained-dynamics-derivatives.cpp:38
constrained-dynamics-derivatives.hpp
pinocchio::python::computeConstraintDynamicsDerivatives_proxy
bp::tuple computeConstraintDynamicsDerivatives_proxy(const context::Model &model, context::Data &data, const RigidConstraintModelVector &contact_models, RigidConstraintDataVector &contact_datas, const context::ProximalSettings &settings=context::ProximalSettings())
Definition: expose-constrained-dynamics-derivatives.cpp:22
simulation-contact-dynamics.contact_datas
list contact_datas
Definition: simulation-contact-dynamics.py:60
pinocchio::ProximalSettingsTpl
Structure containing all the settings parameters for the proximal algorithms.
Definition: algorithm/fwd.hpp:13
algorithms.hpp
python
pinocchio::python::PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR
typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintModel) RigidConstraintModelVector
contact-cholesky.contact_models
list contact_models
Definition: contact-cholesky.py:22
std-vector.hpp
pinocchio::python::make_ref
Eigen::Ref< Matrix > make_ref(const Eigen::PlainObjectBase< Matrix > &mat)
Definition: bindings/python/utils/eigen.hpp:17
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::python::context::RigidConstraintModel
RigidConstraintModelTpl< Scalar, Options > RigidConstraintModel
Definition: bindings/python/context/generic.hpp:145
eigen.hpp
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:09