expose-aba-derivatives.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018-2021 CNRS INRIA
3 //
4 
8 
10 
11 namespace pinocchio
12 {
13  namespace python
14  {
15 
16  namespace bp = boost::python;
18  const Eigen::VectorXd & q,
19  const Eigen::VectorXd & v,
20  const Eigen::VectorXd & tau)
21  {
23  make_symmetric(data.Minv);
24  return bp::make_tuple(make_ref(data.ddq_dq),
25  make_ref(data.ddq_dv),
26  make_ref(data.Minv));
27  }
28 
29  typedef PINOCCHIO_ALIGNED_STD_VECTOR(Force) ForceAlignedVector;
30 
32  const Eigen::VectorXd & q,
33  const Eigen::VectorXd & v,
34  const Eigen::VectorXd & tau,
35  const ForceAlignedVector & fext)
36  {
38  make_symmetric(data.Minv);
39  return bp::make_tuple(make_ref(data.ddq_dq),
40  make_ref(data.ddq_dv),
41  make_ref(data.Minv));
42  }
43 
45  {
46  using namespace Eigen;
47 
48  bp::def("computeABADerivatives",
50  bp::args("model","data","q","v","tau"),
51  "Computes the ABA derivatives, store the result in data.ddq_dq, data.ddq_dv and data.Minv (aka ddq_dtau)\n"
52  "which correspond to the partial derivatives of the joint acceleration vector output with respect to the joint configuration,\n"
53  "velocity and torque vectors.\n\n"
54  "Parameters:\n"
55  "\tmodel: model of the kinematic tree\n"
56  "\tdata: data related to the model\n"
57  "\tq: the joint configuration vector (size model.nq)\n"
58  "\tv: the joint velocity vector (size model.nv)\n"
59  "\ttau: the joint torque vector (size model.nv)\n\n"
60  "Returns: (ddq_dq, ddq_dv, ddq_da)");
61 
62  bp::def("computeABADerivatives",
64  bp::args("model","data","q","v","tau","fext"),
65  "Computes the ABA derivatives with external contact foces,\n"
66  "store the result in data.ddq_dq, data.ddq_dv and data.Minv (aka ddq_dtau)\n"
67  "which correspond to the partial derivatives of the acceleration output with respect to the joint configuration,\n"
68  "velocity and torque vectors.\n\n"
69  "Parameters:\n"
70  "\tmodel: model of the kinematic tree\n"
71  "\tdata: data related to the model\n"
72  "\tq: the joint configuration vector (size model.nq)\n"
73  "\tv: the joint velocity vector (size model.nv)\n"
74  "\ttau: the joint torque vector (size model.nv)\n"
75  "\tfext: list of external forces expressed in the local frame of the joints (size model.njoints)\n\n"
76  "Returns: (ddq_dq, ddq_dv, ddq_da)");
77  }
78  } // namespace python
79 } // namespace pinocchio
pinocchio::python::VectorXd
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
Definition: conversions.cpp:16
boost::python
Eigen
pinocchio::DataTpl
Definition: multibody/data.hpp:29
pinocchio::python::make_symmetric
void make_symmetric(Eigen::MatrixBase< Matrix > &mat)
Definition: bindings/python/utils/eigen.hpp:24
pinocchio::python::computeABADerivatives_fext
bp::tuple computeABADerivatives_fext(const Model &model, Data &data, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::VectorXd &tau, const ForceAlignedVector &fext)
Definition: expose-aba-derivatives.cpp:31
setup.data
data
Definition: cmake/cython/setup.in.py:48
eigen-to-python.hpp
aba-derivatives.hpp
forward-dynamics-derivatives.tau
tau
Definition: forward-dynamics-derivatives.py:23
pinocchio::python::computeABADerivativesDefault
bp::tuple computeABADerivativesDefault(const Model &model, Data &data, const Eigen::VectorXd &q, const Eigen::VectorXd &v, const Eigen::VectorXd &tau)
Definition: expose-aba-derivatives.cpp:17
pinocchio::python::exposeABADerivatives
void exposeABADerivatives()
Definition: expose-aba-derivatives.cpp:44
algorithms.hpp
python
pinocchio::python::v
const Vector3Like & v
Definition: bindings/python/spatial/explog.hpp:44
pinocchio::ForceTpl
Definition: force-tpl.hpp:35
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:747
pinocchio::computeABADerivatives
void computeABADerivatives(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 > &tau, const Eigen::MatrixBase< MatrixType1 > &aba_partial_dq, const Eigen::MatrixBase< MatrixType2 > &aba_partial_dv, const Eigen::MatrixBase< MatrixType3 > &aba_partial_dtau)
The derivatives of the Articulated-Body algorithm.
pinocchio::python::PINOCCHIO_ALIGNED_STD_VECTOR
typedef PINOCCHIO_ALIGNED_STD_VECTOR(Force) ForceAlignedVector
pinocchio::python::make_ref
Eigen::Ref< Matrix > make_ref(Eigen::PlainObjectBase< Matrix > &mat)
Definition: bindings/python/utils/eigen.hpp:17
pinocchio::ModelTpl
Definition: multibody/fwd.hpp:23
eigen.hpp
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:746
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:28


pinocchio
Author(s):
autogenerated on Tue Feb 13 2024 03:43:58