GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/algorithm/expose-centroidal.cpp Lines: 19 26 73.1 %
Date: 2024-01-23 21:41:47 Branches: 16 32 50.0 %

Line Branch Exec Source
1
//
2
// Copyright (c) 2015-2020 CNRS INRIA
3
//
4
5
#include "pinocchio/bindings/python/algorithm/algorithms.hpp"
6
#include "pinocchio/algorithm/centroidal.hpp"
7
8
namespace pinocchio
9
{
10
  namespace python
11
  {
12
13
19
    void exposeCentroidal()
14
    {
15
      using namespace Eigen;
16
17
19
      bp::def("computeCentroidalMomentum",
18
              &computeCentroidalMomentum<double,0,JointCollectionDefaultTpl>,
19
38
              bp::args("model","data"),
20
              "Computes the Centroidal momentum, a.k.a. the total momentum of the system expressed around the center of mass.",
21
              bp::return_value_policy<bp::return_by_value>());
22
23
19
      bp::def("computeCentroidalMomentum",
24
              &computeCentroidalMomentum<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
25
38
              bp::args("model","data","q","v"),
26
              "Computes the Centroidal momentum, a.k.a. the total momentum of the system expressed around the center of mass.",
27
              bp::return_value_policy<bp::return_by_value>());
28
29
19
      bp::def("computeCentroidalMomentumTimeVariation",
30
              &computeCentroidalMomentumTimeVariation<double,0,JointCollectionDefaultTpl>,
31
38
              bp::args("model","data"),
32
              "Computes the Centroidal momentum and its time derivatives, a.k.a. the total momentum of the system and its time derivative expressed around the center of mass.",
33
              bp::return_value_policy<bp::return_by_value>());
34
35
19
      bp::def("computeCentroidalMomentumTimeVariation",
36
              &computeCentroidalMomentumTimeVariation<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd,VectorXd>,
37
38
              bp::args("model","data","q","v","a"),
38
              "Computes the Centroidal momentum and its time derivatives, a.k.a. the total momentum of the system and its time derivative expressed around the center of mass.",
39
              bp::return_value_policy<bp::return_by_value>());
40
41
19
      bp::def("ccrba",
42
              &ccrba<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
43
38
              bp::args("model","data","q","v"),
44
              "Computes the centroidal mapping, the centroidal momentum and the Centroidal Composite Rigid Body Inertia, puts the result in Data and returns the centroidal mapping."
45
              "For the same price, it also computes the total joint jacobians (data.J).",
46
              bp::return_value_policy<bp::return_by_value>());
47
48
19
      bp::def("computeCentroidalMap",
49
              &computeCentroidalMap<double,0,JointCollectionDefaultTpl,VectorXd>,
50
38
              bp::args("model","data","q"),
51
              "Computes the centroidal mapping, puts the result in Data.Ag and returns the centroidal mapping.\n"
52
              "For the same price, it also computes the total joint jacobians (data.J).",
53
              bp::return_value_policy<bp::return_by_value>());
54
55
19
      bp::def("dccrba",
56
              dccrba<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
57
38
              bp::args("model","data","q","v"),
58
              "Computes the time derivative of the centroidal momentum matrix Ag in terms of q and v.\n"
59
              "For the same price, it also computes the centroidal momentum matrix (data.Ag), the total joint jacobians (data.J) "
60
              "and the related joint jacobians time derivative (data.dJ)",
61
              bp::return_value_policy<bp::return_by_value>());
62
63
19
      bp::def("computeCentroidalMapTimeVariation",
64
              computeCentroidalMapTimeVariation<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd>,
65
38
              bp::args("model","data","q","v"),
66
              "Computes the time derivative of the centroidal momentum matrix Ag, puts the result in Data.Ag and returns the centroidal mapping.\n"
67
              "For the same price, it also computes the centroidal momentum matrix (data.Ag), the total joint jacobians (data.J) "
68
              "and the related joint jacobians time derivative (data.dJ)",
69
19
              bp::return_value_policy<bp::return_by_value>());
70
71
19
    }
72
73
  } // namespace python
74
} // namespace pinocchio