GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/algorithm/expose-aba.cpp Lines: 9 15 60.0 %
Date: 2024-01-23 21:41:47 Branches: 6 12 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/aba.hpp"
7
#include "pinocchio/bindings/python/utils/eigen.hpp"
8
9
namespace pinocchio
10
{
11
  namespace python
12
  {
13
14
    const Data::RowMatrixXs &
15
    computeMinverse_proxy(const Model & model, Data & data, const Eigen::VectorXd & q)
16
    {
17
      computeMinverse(model,data,q);
18
      make_symmetric(data.Minv);
19
      return data.Minv;
20
    }
21
22
19
    void exposeABA()
23
    {
24
      using namespace Eigen;
25
26
19
      bp::def("aba",
27
              &aba<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd,VectorXd>,
28
38
              bp::args("Model","Data","q","v","tau"),
29
              "Compute ABA, store the result in Data::ddq and return it.",
30
              bp::return_value_policy<bp::return_by_value>());
31
32
19
      bp::def("aba",
33
              &aba<double,0,JointCollectionDefaultTpl,VectorXd,VectorXd,VectorXd,Force>,
34
38
              bp::args("Model","Data","q","v","tau","f_ext"),
35
              "Compute ABA with external forces, store the result in Data::ddq and return it.",
36
              bp::return_value_policy<bp::return_by_value>());
37
38
19
      bp::def("computeMinverse",
39
              &computeMinverse_proxy,
40
38
              bp::args("Model","Data","q"),
41
              "Computes the inverse of the joint space inertia matrix using a variant of the Articulated Body algorithm.\n"
42
              "The result is stored in data.Minv.",
43
19
              bp::return_value_policy<bp::return_by_value>());
44
45
19
    }
46
47
  } // namespace python
48
} // namespace pinocchio