expose-centroidal-derivatives.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019-2020 CNRS INRIA
3 //
4 
7 
8 #include <boost/python/tuple.hpp>
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
16  const context::Model & model,
18  const context::VectorXs & q,
19  const context::VectorXs & v,
20  const context::VectorXs & a)
21  {
23  Matrix6x partialh_dq(Matrix6x::Zero(6, model.nv));
24  Matrix6x partial_dq(Matrix6x::Zero(6, model.nv));
25  Matrix6x partial_dv(Matrix6x::Zero(6, model.nv));
26  Matrix6x partial_da(Matrix6x::Zero(6, model.nv));
27 
29  model, data, q, v, a, partialh_dq, partial_dq, partial_dv, partial_da);
30 
31  return bp::make_tuple(partialh_dq, partial_dq, partial_dv, partial_da);
32  }
33 
34  bp::tuple
36  {
38 
39  Matrix6x partialh_dq(Matrix6x::Zero(6, model.nv));
40  Matrix6x partial_dq(Matrix6x::Zero(6, model.nv));
41  Matrix6x partial_dv(Matrix6x::Zero(6, model.nv));
42  Matrix6x partial_da(Matrix6x::Zero(6, model.nv));
43 
45  model, data, partialh_dq, partial_dq, partial_dv, partial_da);
46  return bp::make_tuple(partialh_dq, partial_dq, partial_dv, partial_da);
47  }
48 
50  {
51  using namespace Eigen;
52 
53  bp::def(
54  "computeCentroidalDynamicsDerivatives", computeCentroidalDynamicsDerivatives_proxy,
55  bp::args("model", "data", "q", "v", "a"),
56  "Computes the analytical derivatives of the centroidal dynamics\n"
57  "with respect to the joint configuration vector, velocity and acceleration.");
58 
59  bp::def(
60  "getCentroidalDynamicsDerivatives", getCentroidalDynamicsDerivatives_proxy,
61  bp::args("model", "data"),
62  "Retrive the analytical derivatives of the centroidal dynamics\n"
63  "from the RNEA derivatives.\n"
64  "pinocchio.computeRNEADerivatives should have been called first.");
65  }
66 
67  } // namespace python
68 } // namespace pinocchio
Eigen
pinocchio::DataTpl
Definition: context/generic.hpp:25
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::python::computeCentroidalDynamicsDerivatives_proxy
bp::tuple computeCentroidalDynamicsDerivatives_proxy(const context::Model &model, context::Data &data, const context::VectorXs &q, const context::VectorXs &v, const context::VectorXs &a)
Definition: expose-centroidal-derivatives.cpp:15
pinocchio::context::VectorXs
Eigen::Matrix< Scalar, Eigen::Dynamic, 1, Options > VectorXs
Definition: context/generic.hpp:47
algorithms.hpp
python
pinocchio::python::v
const Vector3Like & v
Definition: bindings/python/spatial/explog.hpp:66
pinocchio::python::exposeCentroidalDerivatives
void exposeCentroidalDerivatives()
Definition: expose-centroidal-derivatives.cpp:49
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
a
Vec3f a
Matrix6x
Eigen::Matrix< double, 6, Eigen::Dynamic > Matrix6x
Definition: joint-mimic.cpp:15
pinocchio::getCentroidalDynamicsDerivatives
void getCentroidalDynamicsDerivatives(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Matrix6xLike1 > &dh_dq, const Eigen::MatrixBase< Matrix6xLike1 > &dhdot_dq, const Eigen::MatrixBase< Matrix6xLike2 > &dhdot_dv, const Eigen::MatrixBase< Matrix6xLike3 > &dhdot_da)
Retrive the analytical derivatives of the centroidal dynamics from the RNEA derivatives....
pinocchio::python::getCentroidalDynamicsDerivatives_proxy
bp::tuple getCentroidalDynamicsDerivatives_proxy(const context::Model &model, context::Data &data)
Definition: expose-centroidal-derivatives.cpp:35
centroidal-derivatives.hpp
pinocchio::DataTpl::Matrix6x
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > Matrix6x
The 6d jacobian type (temporary)
Definition: multibody/data.hpp:92
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::computeCentroidalDynamicsDerivatives
void computeCentroidalDynamicsDerivatives(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &a, const Eigen::MatrixBase< Matrix6xLike0 > &dh_dq, const Eigen::MatrixBase< Matrix6xLike1 > &dhdot_dq, const Eigen::MatrixBase< Matrix6xLike2 > &dhdot_dv, const Eigen::MatrixBase< Matrix6xLike3 > &dhdot_da)
Computes the analytical derivatives of the centroidal dynamics with respect to the joint configuratio...
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