GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: bindings/python/algorithm/expose-crba.cpp Lines: 4 10 40.0 %
Date: 2024-04-26 13:14:21 Branches: 1 10 10.0 %

Line Branch Exec Source
1
//
2
// Copyright (c) 2015-2021 CNRS
3
//
4
5
#include "pinocchio/bindings/python/algorithm/algorithms.hpp"
6
#include "pinocchio/algorithm/crba.hpp"
7
8
namespace pinocchio
9
{
10
  namespace python
11
  {
12
    static Eigen::MatrixXd crba_proxy(const Model & model,
13
                                      Data & data,
14
                                      const Eigen::VectorXd & q)
15
    {
16
      data.M.fill(0);
17
      crba(model,data,q);
18
      data.M.triangularView<Eigen::StrictlyLower>()
19
      = data.M.transpose().triangularView<Eigen::StrictlyLower>();
20
      return data.M;
21
    }
22
23
19
    void exposeCRBA()
24
    {
25
19
      bp::def("crba",crba_proxy,
26
38
              bp::args("model","data","q"),
27
              "Computes CRBA, store the result in Data and return it.\n"
28
              "Parameters:\n"
29
              "\tmodel: model of the kinematic tree\n"
30
              "\tdata: data related to the model\n"
31
              "\tq: the joint configuration vector (size model.nq)\n");
32
19
    }
33
34
  } // namespace python
35
} // namespace pinocchio