expose-centroidal-derivatives.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 CNRS
3 //
4 
6 #include "pinocchio/algorithm/centroidal-derivatives.hpp"
7 
8 #include <boost/python/tuple.hpp>
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
16  Data & data,
17  const Eigen::VectorXd & q,
18  const Eigen::VectorXd & v,
19  const Eigen::VectorXd & a)
20  {
21  typedef Data::Matrix6x Matrix6x;
22  Matrix6x partialh_dq(Matrix6x::Zero(6,model.nv));
23  Matrix6x partial_dq(Matrix6x::Zero(6,model.nv));
24  Matrix6x partial_dv(Matrix6x::Zero(6,model.nv));
25  Matrix6x partial_da(Matrix6x::Zero(6,model.nv));
26 
27  computeCentroidalDynamicsDerivatives(model,data,q, v, a,
28  partialh_dq, partial_dq, partial_dv, partial_da);
29 
30  return bp::make_tuple(partialh_dq, partial_dq,partial_dv,partial_da);
31  }
32 
34  Data & data)
35  {
36  typedef Data::Matrix6x Matrix6x;
37 
38  Matrix6x partialh_dq(Matrix6x::Zero(6,model.nv));
39  Matrix6x partial_dq(Matrix6x::Zero(6,model.nv));
40  Matrix6x partial_dv(Matrix6x::Zero(6,model.nv));
41  Matrix6x partial_da(Matrix6x::Zero(6,model.nv));
42 
43  getCentroidalDynamicsDerivatives(model,data, partialh_dq, partial_dq, partial_dv, partial_da);
44  return bp::make_tuple(partialh_dq,partial_dq,partial_dv,partial_da);
45  }
46 
48  {
49  using namespace Eigen;
50 
51  bp::def("computeCentroidalDynamicsDerivatives",
53  bp::args("Model","Data","q","v","a"),
54  "Computes the analytical derivatives of the centroidal dynamics\n"
55  "with respect to the joint configuration vector, velocity and acceleration.");
56 
57  bp::def("getCentroidalDynamicsDerivatives",
59  bp::args("Model","Data"),
60  "Retrive the analytical derivatives of the centroidal dynamics\n"
61  "from the RNEA derivatives.\n"
62  "pinocchio.computeRNEADerivatives should have been called first.");
63  }
64 
65  } // namespace python
66 } // namespace pinocchio
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...
bp::tuple computeCentroidalDynamicsDerivatives_proxy(const Model &model, Data &data, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::VectorXd &a)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
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::computeRNEADerivatives should have been called first.
Eigen::Matrix< double, 6, Eigen::Dynamic > Matrix6x
Definition: joint-mimic.cpp:15
Vec3f a
Main pinocchio namespace.
Definition: timings.cpp:28
int nv
Dimension of the velocity vector space.
bp::tuple getCentroidalDynamicsDerivatives_proxy(const Model &model, Data &data)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
Definition: conversions.cpp:14
Eigen::Matrix< Scalar, 6, Eigen::Dynamic, Options > Matrix6x
The 6d jacobian type (temporary)
JointCollectionTpl & model


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:29