expose-delassus.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020-2021 INRIA
3 //
4 
6 
9 
11 
12 namespace bp = boost::python;
13 
14 namespace pinocchio
15 {
16  namespace python
17  {
19  RigidConstraintModelVector;
21  RigidConstraintDataVector;
22 
24  const context::Model & model,
26  const context::VectorXs & q,
27  const RigidConstraintModelVector & contact_models,
28  RigidConstraintDataVector & contact_datas,
30  {
31  const size_t constraint_size = getTotalConstraintSize(contact_models);
32  context::MatrixXs delassus(constraint_size, constraint_size);
34  make_symmetric(delassus);
35  return delassus;
36  }
37 
39  const context::Model & model,
41  const context::VectorXs & q,
42  const RigidConstraintModelVector & contact_models,
43  RigidConstraintDataVector & contact_datas,
44  const context::Scalar mu,
45  const bool scaled = false)
46  {
47  const size_t constraint_size = getTotalConstraintSize(contact_models);
48  context::MatrixXs delassus_inverse(constraint_size, constraint_size);
50  model, data, q, contact_models, contact_datas, delassus_inverse, mu, scaled);
51  make_symmetric(delassus_inverse);
52  return delassus_inverse;
53  }
54 
56  {
57  using namespace Eigen;
58 
59  bp::def(
60  "computeDelassusMatrix", computeDelassusMatrix_proxy,
61  (bp::arg("model"), bp::arg("data"), bp::arg("q"), bp::arg("contact_models"),
62  bp::arg("contact_datas"), bp::arg("mu") = 0),
63  "Computes the Delassus matrix associated to a set of given constraints.");
64 
65  bp::def(
66  "computeDampedDelassusMatrixInverse", computeDampedDelassusMatrixInverse_proxy,
67  (bp::arg("model"), bp::arg("data"), bp::arg("q"), bp::arg("contact_models"),
68  bp::arg("contact_datas"), bp::arg("mu") = 0),
69  "Computes the inverse of the Delassus matrix associated to a set of given constraints.");
70  }
71  } // namespace python
72 } // namespace pinocchio
pinocchio::computeDampedDelassusMatrixInverse
void computeDampedDelassusMatrixInverse(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const std::vector< RigidConstraintModelTpl< Scalar, Options >, ModelAllocator > &contact_models, std::vector< RigidConstraintDataTpl< Scalar, Options >, DataAllocator > &contact_data, const Eigen::MatrixBase< MatrixType > &damped_delassus_inverse, const Scalar mu, const bool scaled=false, const bool Pv=true)
Computes the inverse of the Delassus matrix associated to a set of given constraints.
boost::python
Eigen
pinocchio::python::context::RigidConstraintData
RigidConstraintDataTpl< Scalar, Options > RigidConstraintData
Definition: bindings/python/context/generic.hpp:146
pinocchio::computeDelassusMatrix
void computeDelassusMatrix(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const std::vector< RigidConstraintModelTpl< Scalar, Options >, ModelAllocator > &contact_models, std::vector< RigidConstraintDataTpl< Scalar, Options >, DataAllocator > &contact_data, const Eigen::MatrixBase< MatrixType > &delassus, const Scalar mu=0)
Computes the Delassus matrix associated to a set of given constraints.
pinocchio::DataTpl
Definition: context/generic.hpp:25
delassus.hpp
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::python::exposeDelassus
void exposeDelassus()
Definition: expose-delassus.cpp:55
pinocchio::python::make_symmetric
void make_symmetric(const Eigen::MatrixBase< Matrix > &mat, const int mode=Eigen::Upper)
Definition: bindings/python/utils/eigen.hpp:24
simulation-contact-dynamics.contact_datas
list contact_datas
Definition: simulation-contact-dynamics.py:60
pinocchio::context::VectorXs
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, Options > VectorXs
Definition: context/generic.hpp:47
algorithms.hpp
pinocchio::context::MatrixXs
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Options > MatrixXs
Definition: context/generic.hpp:49
python
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
pinocchio::getTotalConstraintSize
struct PINOCCHIO_UNSUPPORTED_MESSAGE("The API will change towards more flexibility") RigidConstraintModelTpl size_t getTotalConstraintSize(const std::vector< RigidConstraintModelTpl< Scalar, Options >, Allocator > &contact_models)
Contact model structure containg all the info describing the rigid contact model.
Definition: algorithm/contact-info.hpp:810
mu
double mu
Definition: delassus.cpp:58
pinocchio::python::computeDampedDelassusMatrixInverse_proxy
static const context::MatrixXs computeDampedDelassusMatrixInverse_proxy(const context::Model &model, context::Data &data, const context::VectorXs &q, const RigidConstraintModelVector &contact_models, RigidConstraintDataVector &contact_datas, const context::Scalar mu, const bool scaled=false)
Definition: expose-delassus.cpp:38
pinocchio::python::PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR
typedef PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(context::RigidConstraintModel) RigidConstraintModelVector
pinocchio::python::computeDelassusMatrix_proxy
static const context::MatrixXs computeDelassusMatrix_proxy(const context::Model &model, context::Data &data, const context::VectorXs &q, const RigidConstraintModelVector &contact_models, RigidConstraintDataVector &contact_datas, const context::Scalar mu=context::Scalar(0))
Definition: expose-delassus.cpp:23
contact-cholesky.contact_models
list contact_models
Definition: contact-cholesky.py:22
std-vector.hpp
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::python::context::RigidConstraintModel
RigidConstraintModelTpl< Scalar, Options > RigidConstraintModel
Definition: bindings/python/context/generic.hpp:145
pinocchio::python::context::Scalar
PINOCCHIO_PYTHON_SCALAR_TYPE Scalar
Definition: bindings/python/context/generic.hpp:37
eigen.hpp
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:29